src/OPL2.cpp
/**
 * Play a drum sound at a given note and frequency.
 * The OPL2 must be put into percusive mode first and the parameters of the drum sound must be set in the required
 * operator(s). Note that changing octave and note frequenct will influence both drum sounds if they occupy only a
 * single operator (Snare + Hi-hat and Tom + Cymbal).
 */
Play a drum sound at a given note and frequency.
The OPL2 must be put into percusive mode first and the parameters of the drum sound must be set in the required
operator(s). Note that changing octave and note frequenct will influence both drum sounds if they occupy only a
single operator (Snare + Hi-hat and Tom + Cymbal).
Play a drum sound at a given note and frequency . The OPL2 must be put into percusive mode first and the parameters of the drum sound must be set in the required operator ( s ) . Note that changing octave and note frequenct will influence both drum sounds if they occupy only a single operator ( Snare + Hi - hat and Tom + Cymbal ) .
void OPL2::playDrum(byte drum, byte octave, byte note) {
	drum = drum % DRUM_SOUND_MAX;
	byte drumState = getDrums();
	setDrums(drumState & ~drumBits[drum]);
	byte drumChannel = drumChannels[drum % DRUM_SOUND_MAX];
	setBlock(drumChannel, max(ZERO, min(octave, OCTAVE_MAX)));
	setFNumber(drumChannel, noteFNumbers[max(ZERO, min(note, NOTE_MAX))]);
	setDrums(drumState | drumBits[drum]);
}
void OPL2 :: playDrum ( byte drum , byte octave , byte note ) { drum = drum % DRUM_SOUND_MAX ; byte drumState = getDrums ( ) ; setDrums ( drumState & ~ drumBits [ drum ] ) ; byte drumChannel = drumChannels [ drum % DRUM_SOUND_MAX ] ; setBlock ( drumChannel , max ( ZERO , min ( octave , OCTAVE_MAX ) ) ) ; setFNumber ( drumChannel , noteFNumbers [ max ( ZERO , min ( note , NOTE_MAX ) ) ] ) ; setDrums ( drumState | drumBits [ drum ] ) ; }
Play a drum sound at a given note and frequency.
Play a drum sound at a given note and frequency .