src/OPL2.cpp
/**
 * Create and return a new empty instrument.
 */
Create and return a new empty instrument.
Create and return a new empty instrument .
Instrument OPL2::createInstrument() {
	Instrument instrument;
	for (byte op = OPERATOR1; op <= OPERATOR2; op ++) {
		instrument.operators[op].hasTremolo = false;
		instrument.operators[op].hasVibrato = false;
		instrument.operators[op].hasSustain = false;
		instrument.operators[op].hasEnvelopeScaling = false;
		instrument.operators[op].frequencyMultiplier = 0;
		instrument.operators[op].keyScaleLevel = 0;
		instrument.operators[op].outputLevel = 0;
		instrument.operators[op].attack = 0;
		instrument.operators[op].decay = 0;
		instrument.operators[op].sustain = 0;
		instrument.operators[op].release = 0;
		instrument.operators[op].waveForm = 0;
	}
	instrument.feedback = 0;
	instrument.isAdditiveSynth = false;
	instrument.type = INSTRUMENT_TYPE_MELODIC;
	return instrument;
}
Instrument OPL2 :: createInstrument ( ) { Instrument instrument ; for ( byte op = OPERATOR1 ; op <= OPERATOR2 ; op ++ ) { instrument . operators [ op ] . hasTremolo = false ; instrument . operators [ op ] . hasVibrato = false ; instrument . operators [ op ] . hasSustain = false ; instrument . operators [ op ] . hasEnvelopeScaling = false ; instrument . operators [ op ] . frequencyMultiplier = 0 ; instrument . operators [ op ] . keyScaleLevel = 0 ; instrument . operators [ op ] . outputLevel = 0 ; instrument . operators [ op ] . attack = 0 ; instrument . operators [ op ] . decay = 0 ; instrument . operators [ op ] . sustain = 0 ; instrument . operators [ op ] . release = 0 ; instrument . operators [ op ] . waveForm = 0 ; } instrument . feedback = 0 ; instrument . isAdditiveSynth = false ; instrument . type = INSTRUMENT_TYPE_MELODIC ; return instrument ; }
Create and return a new empty instrument.
Create and return a new empty instrument .