Exemplo n.º 1
0
 private void midiCC(Midi.ControlChangeMessage msg)
 {
     //Console.WriteLine($"<MIDI> CC {msg.Channel} {msg.Device} {msg.Control} {msg.Value}");
     if (msg.Value > 0)
     {
         OnLaunchpadKeyPressed?.Invoke(this, new LaunchpadKeyEventArgs(midiCCToLed(msg.Control), -1, msg.Value));  // top row buttons
     }
     else
     {
         OnLaunchpadKeyReleased?.Invoke(this, new LaunchpadKeyEventArgs(midiCCToLed(msg.Control), -1, msg.Value));  // top row buttons
     }
 }
Exemplo n.º 2
0
 private void midiPress(Midi.NoteOnMessage msg)
 {
     //Console.WriteLine("<MIDI> "+msg.Channel+" "+msg.Device+" "+msg.Pitch+" "+msg.Velocity);
     if (msg.Velocity > 0)
     {
         OnLaunchpadKeyPressed?.Invoke(this, new LaunchpadKeyEventArgs(midiNoteToLed(msg.Pitch)[1], midiNoteToLed(msg.Pitch)[0], msg.Velocity));
     }
     else
     {
         OnLaunchpadKeyReleased?.Invoke(this, new LaunchpadKeyEventArgs(midiNoteToLed(msg.Pitch)[1], midiNoteToLed(msg.Pitch)[0], msg.Velocity));
     }
 }