SammyIAm/Moppy — pull request #47 by jeremyvisser (2013-12-20 01:18:26+00:00)
Title: Map MIDI channels to Arduino pins on a first-come-first-served basis.

Helps avoid missing parts in the situation where fewer than 16 floppy drives have been connected, and MIDI channels have not been assigned sequentially starting from 1.

I'm aware that MoppyAdvanced already has mapping strategies, but I found the mapping to be buggy (the strategy I wanted kept messing up lots of notes) and eventually found that this simple but dumb solution worked the best for me.

The reason why I am mapping pins on-the-fly during playback is because the Track class does not appear to be able to reveal its internal MIDI channel number. I can see you are retrieving the channel number through the MidiMessage.getStatus() function, which is also a bit of a hack.

If you can think of a more elegant way to do this, by all means suggest it. But then you've got to write it. :-)