src/OPL2.cpp
/**
 * Create a new drum instrument that can be used in percussion mode. The drumType is one of INSTRUMENT_TYPE_* other than
 * MELODIC and this determines the channel operator(s) to be loaded into the instrument object.
 */
Create a new drum instrument that can be used in percussion mode. The drumType is one of INSTRUMENT_TYPE_* other than
MELODIC and this determines the channel operator(s) to be loaded into the instrument object.
Create a new drum instrument that can be used in percussion mode . The drumType is one of INSTRUMENT_TYPE_ * other than MELODIC and this determines the channel operator ( s ) to be loaded into the instrument object .
Instrument OPL2::getDrumInstrument(byte drumType) {
	byte channel = drumChannels[drumType - INSTRUMENT_TYPE_BASS];
	Instrument instrument = createInstrument();
	for (byte op = OPERATOR1; op <= OPERATOR2; op ++) {
		if (drumRegisterOffsets[op][drumType - INSTRUMENT_TYPE_BASS] != 0xFF) {
			instrument.operators[op].hasTremolo = getTremolo(channel, op);
			instrument.operators[op].hasVibrato = getVibrato(channel, op);
			instrument.operators[op].hasSustain = getMaintainSustain(channel, op);
			instrument.operators[op].hasEnvelopeScaling = getEnvelopeScaling(channel, op);
			instrument.operators[op].frequencyMultiplier = getMultiplier(channel, op);
			instrument.operators[op].keyScaleLevel = getScalingLevel(channel, op);
			instrument.operators[op].outputLevel = getVolume(channel, op);
			instrument.operators[op].attack = getAttack(channel, op);
			instrument.operators[op].decay = getDecay(channel, op);
			instrument.operators[op].sustain = getSustain(channel, op);
			instrument.operators[op].release = getRelease(channel, op);
			instrument.operators[op].waveForm = getWaveForm(channel, op);
		}
	}
	instrument.feedback = 0x00;
	instrument.isAdditiveSynth = false;
	instrument.type = drumType;
	return instrument;
}
Instrument OPL2 :: getDrumInstrument ( byte drumType ) { byte channel = drumChannels [ drumType - INSTRUMENT_TYPE_BASS ] ; Instrument instrument = createInstrument ( ) ; for ( byte op = OPERATOR1 ; op <= OPERATOR2 ; op ++ ) { if ( drumRegisterOffsets [ op ] [ drumType - INSTRUMENT_TYPE_BASS ] != 0xFF ) { instrument . operators [ op ] . hasTremolo = getTremolo ( channel , op ) ; instrument . operators [ op ] . hasVibrato = getVibrato ( channel , op ) ; instrument . operators [ op ] . hasSustain = getMaintainSustain ( channel , op ) ; instrument . operators [ op ] . hasEnvelopeScaling = getEnvelopeScaling ( channel , op ) ; instrument . operators [ op ] . frequencyMultiplier = getMultiplier ( channel , op ) ; instrument . operators [ op ] . keyScaleLevel = getScalingLevel ( channel , op ) ; instrument . operators [ op ] . outputLevel = getVolume ( channel , op ) ; instrument . operators [ op ] . attack = getAttack ( channel , op ) ; instrument . operators [ op ] . decay = getDecay ( channel , op ) ; instrument . operators [ op ] . sustain = getSustain ( channel , op ) ; instrument . operators [ op ] . release = getRelease ( channel , op ) ; instrument . operators [ op ] . waveForm = getWaveForm ( channel , op ) ; } } instrument . feedback = 0x00 ; instrument . isAdditiveSynth = false ; instrument . type = drumType ; return instrument ; }
Create a new drum instrument that can be used in percussion mode.
Create a new drum instrument that can be used in percussion mode .