private void GetUsedChannels()
{
for (int i = 0; i < a_UsedChannels.Length; i++)
{
a_UsedChannels[i] = false;
}
for (int i = 0; i < i_NumMusicChannels; i++)
{
for (int j = 0; j < midiEventCollection[i + 1].Count; j++)
{
if (midiEventCollection[i + 1][j].CommandCode == MidiCommandCode.NoteOn || midiEventCollection[i + 1][j].CommandCode == MidiCommandCode.NoteOff)
{
a_UsedChannels[midiEventCollection[i + 1][j].Channel - 1] = true;
a_ExistingChannelOrder[midiEventCollection[i + 1][j].Channel - 1] = i + 1;
break;
}
}
}
}