public override void OnMidiNote(int channel, bool on, int pitch) { midiNote m = getMidiNote(channel, pitch); if (m != null) { m.UpdateValue(on); } else { midiToDo.Add(new simpleMIDI(channel, pitch, on ? 127 : 0, false)); } }
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(); } }