MD_YM2413 Library 1.0
Library for Yahama YM2413 sound synthesizer
|
The object definition include a list of all the I/O pins that are used to connect the MCU to the YM2413 IC.
The setup() function must include the begin() method. All the I/O pins are initialized at this time.
Automatic note off events (see below) are managed by the library. For this to happen in a timely manner, the loop() function must invoke run() every iteration through loop(). The run() method executes very quickly if the library has nothing to process, imposing minimal overheads on the user application.
run() may be omitted if the application manages all the noteOn() and noteOff() events within the application.
A note starts with a note on event and ends with a note off event. The note on event is generated when the noteOn() method is invoked in the application code.
The library provides flexibility on how the note off events are generated.
Invoking noteOn() without a duration parameter means the user code needs to generate the note off for the channel. This method is suited to applications that directly link a physical event to playing the note (eg, switch on for note on and switch off for note off), or where the music being played includes its own note on and off events (eg, a MIDI score).
Invoking noteOn() with a duration parameter causes the library to generate a note off event at the end of the specified total duration. This method suits applications where the sound duration is defined by the music being played (eg, RTTTL tunes). In this case the user code can determine if the noteOff() event has been generated by using the isIdle() method.