public void InputControlChange(Midi.ControlChangeMessage msg) { if (channel == 0 || channel == (int)msg.Channel + 1) { _deviceInterface.OnMidiCC((int)msg.Channel + 1, (int)msg.Control, msg.Value); } }
public void onControlChange(Midi.ControlChangeMessage e) { if (OnLaunchpadCCKeyPressed != null) { OnLaunchpadCCKeyPressed(this, new LaunchpadCCKeyEventArgs(int.Parse(e.Control.ToString()), e.Value)); } }
//Event handler for Control Change (top buttons) private void controlChange(Midi.ControlChangeMessage msg) { if (OnLaunchpadCCKeyPressed != null && int.Parse(msg.Control.ToString()) >= 104 && int.Parse(msg.Control.ToString()) <= 111 && msg.Value != 0) { OnLaunchpadCCKeyPressed(this, new LaunchpadCCKeyEventArgs(int.Parse(msg.Control.ToString()), 1)); } }
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 } }
private void OnInputDeviewControlChange(ControlChangeMessage msg) { var control = (ValueControl)msg.Control; var direction = msg.Value == 63 ? Direction.Down : Direction.Up; // update madded values var value = GetControlValue(control); value += (int) direction; SetControlValue(control, value); // send event OnControlChange(control, direction); }
private void OnControlChange(ControlChangeMessage msg) { Invoke((Action<ControlChangeMessage>)delegate(ControlChangeMessage message) { Change(InputDevice.InstalledDevices.IndexOf((InputDevice)message.Device), (int)message.Control, message.Value); }, msg); }
private void mInputDevice_ControlChange(ControlChangeMessage msg) { ToolbarButton toolbarButton = (ToolbarButton)((int)msg.Control - 104); LaunchpadButton button = GetButton(toolbarButton); if (button == null) return; button.State = (ButtonPressState)msg.Value; if (ButtonPressed != null && button.State == ButtonPressState.Down) { ButtonPressed.Invoke(this, new ButtonPressEventArgs(toolbarButton)); } }