Added support for multiple tracks in MIDI code