src/OPL2.cpp
/**
 * Create a new instrument from the given OPL2 channel.
 */
Create a new instrument from the given OPL2 channel.
Create a new instrument from the given OPL2 channel .
Instrument OPL2::getInstrument(byte channel) {
	Instrument instrument;
	for (byte op = OPERATOR1; op <= OPERATOR2; op ++) {
		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 = getFeedback(channel);
	instrument.isAdditiveSynth = getSynthMode(channel);
	instrument.type = INSTRUMENT_TYPE_MELODIC;
	return instrument;
}
Instrument OPL2 :: getInstrument ( byte channel ) { Instrument instrument ; for ( byte op = OPERATOR1 ; op <= OPERATOR2 ; op ++ ) { 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 = getFeedback ( channel ) ; instrument . isAdditiveSynth = getSynthMode ( channel ) ; instrument . type = INSTRUMENT_TYPE_MELODIC ; return instrument ; }
Create a new instrument from the given OPL2 channel.
Create a new instrument from the given OPL2 channel .