//! The Yamaha YM2612 and YM3438 (OPN2), written from documents and measurements. //! //! See README.md for what is known and how, and the reference's docs/claims.md for each claim. //! //! A transcription of ym2612-python (at a6e8e5d): `variant`, `tables`, `operator` and `chip` are //! its four modules, function for function, in the same order, with the same names and //! comments; this file is its `__init__.py`, whose `__all__` names are re-exported here. Each //! module's header says where Rust forced a difference. //! //! ``` //! use ym2612::{YM2612, YM2612_DISCRETE}; //! //! let mut fm = YM2612::new(YM2612_DISCRETE); // the model 1's discrete chip; YM3438_ASIC for later boards //! fm.write(0, 0x22); // address, part I //! fm.write(1, 0x00); // data //! fm.run(7_670_453); // one second of the chip's clock pin (NTSC) //! let frames = fm.take_samples(); // one (left, right) pair per 144 clocks //! assert_eq!(frames.len(), 7_670_453 / 144); //! ``` pub mod chip; pub mod operator; pub mod tables; pub mod variant; pub use chip::{ BUSY_CLOCKS, CLOCKS_PER_SAMPLE, WAIT_AFTER_ADDRESS, WAIT_AFTER_CHANNEL_DATA, WAIT_AFTER_OPERATOR_DATA, YM2612, }; pub use variant::{FMVariant, YM2612_DISCRETE, YM3438_ASIC};