 
 #include <SPI.h>
 #include <OPL2.h>
-
-// For better results with midi files created for Window exchange midi_instruments.h for midi_instruments_win31.h
-// #include <midi_instruments_win31.h>
 #include <midi_instruments.h>
 #include <midi_drums.h>
 

	}

	// Get an available OPL2 channel and setup instrument parameters.
	byte i = getFreeChannel(channel);
	if (channel != MIDI_DRUM_CHANNEL) {
		opl2.setInstrument(i, midiInstruments[programMap[channel]]);
	} else {
		if (note >= DRUM_NOTE_BASE && note < DRUM_NOTE_BASE + NUM_MIDI_DRUMS) {
			opl2.setInstrument(i, midiDrums[note - DRUM_NOTE_BASE]);
		} else {
			return;
		}
	}

	// Register channel mapping.
	channelMap[i].midiChannel  = channel;
	channelMap[i].midiNote     = note;
	channelMap[i].midiVelocity = round(velocity / 127.0);
	channelMap[i].op1Level     = round((63 - opl2.getVolume(i, OPERATOR1)) / 63.0);
	channelMap[i].op2Level     = round((63 - opl2.getVolume(i, OPERATOR2)) / 63.0);

	// Set operator output levels based on note velocity.
	setOpl2ChannelVolume(i, channel);

	// Calculate octave and note number and play note!
	byte opl2Octave = 4;

		opl2Octave = 1 + (note - 24) / 12;
		opl2Note   = note % 12;
	}
	opl2.playNote(opl2Channel, opl2Octave, opl2Note);
}


