src/OPL2.cpp
/**
 * Enable or disable various drum sounds.
 * Note that keyOn for channels 6, 7 and 8 must be false in order to use rhythms.
 */
Enable or disable various drum sounds.
Note that keyOn for channels 6, 7 and 8 must be false in order to use rhythms.
Enable or disable various drum sounds . Note that keyOn for channels 6 7 and 8 must be false in order to use rhythms .
byte OPL2::setDrums(bool bass, bool snare, bool tom, bool cymbal, bool hihat) {
	byte drums = 0;
	drums += bass   ? DRUM_BITS_BASS   : 0x00;
	drums += snare  ? DRUM_BITS_SNARE  : 0x00;
	drums += tom    ? DRUM_BITS_TOM    : 0x00;
	drums += cymbal ? DRUM_BITS_CYMBAL : 0x00;
	drums += hihat  ? DRUM_BITS_HI_HAT : 0x00;
	setRegister(0xBD, oplRegisters[0xBD] & ~drums);
	return setRegister(0xBD, oplRegisters[0xBD] | drums);
}
byte OPL2 :: setDrums ( bool bass , bool snare , bool tom , bool cymbal , bool hihat ) { byte drums = 0 ; drums += bass ? DRUM_BITS_BASS : 0x00 ; drums += snare ? DRUM_BITS_SNARE : 0x00 ; drums += tom ? DRUM_BITS_TOM : 0x00 ; drums += cymbal ? DRUM_BITS_CYMBAL : 0x00 ; drums += hihat ? DRUM_BITS_HI_HAT : 0x00 ; setRegister ( 0xBD , oplRegisters [ 0xBD ] & ~ drums ) ; return setRegister ( 0xBD , oplRegisters [ 0xBD ] | drums ) ; }
Enable or disable various drum sounds.
Enable or disable various drum sounds .