public override void OnMidiCC(int channel, int ID, int value) { midiCC m = getMidiCC(channel, ID); if (m != null) { m.UpdateValue(value); } else { midiToDo.Add(new simpleMIDI(channel, ID, value, true)); } }
void Update() { if (midiToDo.Count > 0) { for (int i = 0; i < midiToDo.Count; i++) { if (midiToDo[i].CC) { midiCC m = createMidiCC(midiToDo[i].channel, midiToDo[i].ID); m.UpdateValue(midiToDo[i].value); m.UpdateJackID(midiToDo[i].jackID); } else { midiNote m = createMidiNote(midiToDo[i].channel, midiToDo[i].ID); m.UpdateValue(midiToDo[i].value != 0); m.UpdateJackID(midiToDo[i].jackID); } } midiToDo.Clear(); } }