From 1d9757736c5e296d690cc4545f16bce1a5e221d2 Mon Sep 17 00:00:00 2001 From: Uwe Klotz Date: Mon, 21 Aug 2023 00:40:07 +0200 Subject: [PATCH] korg-kaoss-dj: Add shift button led --- src/devices/korg_kaoss_dj/input.rs | 20 ++++++++++---------- src/devices/korg_kaoss_dj/mod.rs | 1 + src/devices/korg_kaoss_dj/output.rs | 19 +++++++++++-------- 3 files changed, 22 insertions(+), 18 deletions(-) diff --git a/src/devices/korg_kaoss_dj/input.rs b/src/devices/korg_kaoss_dj/input.rs index d1df7c7..810e27e 100644 --- a/src/devices/korg_kaoss_dj/input.rs +++ b/src/devices/korg_kaoss_dj/input.rs @@ -7,15 +7,15 @@ use super::{ Deck, CONTROL_INDEX_DECK_A, CONTROL_INDEX_DECK_B, CONTROL_INDEX_DECK_BIT_MASK, CONTROL_INDEX_ENUM_BIT_MASK, MIDI_CHANNEL_DECK_A, MIDI_CHANNEL_DECK_B, MIDI_DECK_CUE_BUTTON, MIDI_DECK_EQ_HI_KNOB, MIDI_DECK_EQ_LO_KNOB, MIDI_DECK_EQ_MID_KNOB, MIDI_DECK_GAIN_KNOB, - MIDI_DECK_MONITOR_BUTTON, MIDI_DECK_PLAYPAUSE_BUTTON, MIDI_DECK_SYNC_BUTTON, - MIDI_DECK_TOUCHSTRIP_CENTER_BUTTON, MIDI_DECK_TOUCHSTRIP_HOTCUE_CENTER_BUTTON, - MIDI_DECK_TOUCHSTRIP_HOTCUE_LEFT_BUTTON, MIDI_DECK_TOUCHSTRIP_HOTCUE_RIGHT_BUTTON, - MIDI_DECK_TOUCHSTRIP_LEFT_BUTTON, MIDI_DECK_TOUCHSTRIP_LOOP_CENTER_BUTTON, - MIDI_DECK_TOUCHSTRIP_LOOP_LEFT_BUTTON, MIDI_DECK_TOUCHSTRIP_LOOP_RIGHT_BUTTON, - MIDI_DECK_TOUCHSTRIP_RIGHT_BUTTON, MIDI_DEVICE_DESCRIPTOR, MIDI_MASTER_LEVEL_KNOB, - MIDI_MONITOR_LEVEL_KNOB, MIDI_MONITOR_MIX_KNOB, MIDI_STATUS_BUTTON_DECK_A, - MIDI_STATUS_BUTTON_DECK_B, MIDI_STATUS_BUTTON_MAIN, MIDI_STATUS_CC_DECK_A, - MIDI_STATUS_CC_DECK_B, MIDI_STATUS_CC_MAIN, MIDI_TAP_BUTTON, + MIDI_DECK_MONITOR_BUTTON, MIDI_DECK_PLAYPAUSE_BUTTON, MIDI_DECK_SHIFT_BUTTON, + MIDI_DECK_SYNC_BUTTON, MIDI_DECK_TOUCHSTRIP_CENTER_BUTTON, + MIDI_DECK_TOUCHSTRIP_HOTCUE_CENTER_BUTTON, MIDI_DECK_TOUCHSTRIP_HOTCUE_LEFT_BUTTON, + MIDI_DECK_TOUCHSTRIP_HOTCUE_RIGHT_BUTTON, MIDI_DECK_TOUCHSTRIP_LEFT_BUTTON, + MIDI_DECK_TOUCHSTRIP_LOOP_CENTER_BUTTON, MIDI_DECK_TOUCHSTRIP_LOOP_LEFT_BUTTON, + MIDI_DECK_TOUCHSTRIP_LOOP_RIGHT_BUTTON, MIDI_DECK_TOUCHSTRIP_RIGHT_BUTTON, + MIDI_DEVICE_DESCRIPTOR, MIDI_MASTER_LEVEL_KNOB, MIDI_MONITOR_LEVEL_KNOB, MIDI_MONITOR_MIX_KNOB, + MIDI_STATUS_BUTTON_DECK_A, MIDI_STATUS_BUTTON_DECK_B, MIDI_STATUS_BUTTON_MAIN, + MIDI_STATUS_CC_DECK_A, MIDI_STATUS_CC_DECK_B, MIDI_STATUS_CC_MAIN, MIDI_TAP_BUTTON, }; use crate::{ ButtonInput, CenterSliderInput, ControlIndex, ControlInputEvent, ControlRegister, ControlValue, @@ -199,7 +199,7 @@ pub fn try_decode_midi_input( MIDI_DECK_TOUCHSTRIP_RIGHT_BUTTON => DeckSensor::TouchStripRightButton, 0x18 => DeckSensor::FxButton, MIDI_DECK_MONITOR_BUTTON => DeckSensor::MonitorButton, - 0x1a => DeckSensor::ShiftButton, + MIDI_DECK_SHIFT_BUTTON => DeckSensor::ShiftButton, MIDI_DECK_PLAYPAUSE_BUTTON => DeckSensor::PlayPauseButton, MIDI_DECK_SYNC_BUTTON => DeckSensor::SyncButton, MIDI_DECK_CUE_BUTTON => DeckSensor::CueButton, diff --git a/src/devices/korg_kaoss_dj/mod.rs b/src/devices/korg_kaoss_dj/mod.rs index e806a22..314dbfe 100644 --- a/src/devices/korg_kaoss_dj/mod.rs +++ b/src/devices/korg_kaoss_dj/mod.rs @@ -84,6 +84,7 @@ const MIDI_DECK_TOUCHSTRIP_LEFT_BUTTON: u8 = 0x15; const MIDI_DECK_TOUCHSTRIP_CENTER_BUTTON: u8 = 0x16; const MIDI_DECK_TOUCHSTRIP_RIGHT_BUTTON: u8 = 0x17; const MIDI_DECK_MONITOR_BUTTON: u8 = 0x19; +const MIDI_DECK_SHIFT_BUTTON: u8 = 0x1a; const MIDI_DECK_PLAYPAUSE_BUTTON: u8 = 0x1b; const MIDI_DECK_SYNC_BUTTON: u8 = 0x1d; const MIDI_DECK_CUE_BUTTON: u8 = 0x1e; diff --git a/src/devices/korg_kaoss_dj/output.rs b/src/devices/korg_kaoss_dj/output.rs index f0a2e25..3cf0faa 100644 --- a/src/devices/korg_kaoss_dj/output.rs +++ b/src/devices/korg_kaoss_dj/output.rs @@ -7,13 +7,14 @@ use super::{ Deck, CONTROL_INDEX_DECK_A, CONTROL_INDEX_DECK_B, CONTROL_INDEX_DECK_BIT_MASK, CONTROL_INDEX_ENUM_BIT_MASK, MIDI_COMMAND_CC, MIDI_COMMAND_NOTE_ON, MIDI_DECK_CUE_BUTTON, MIDI_DECK_EQ_HI_KNOB, MIDI_DECK_EQ_LO_KNOB, MIDI_DECK_EQ_MID_KNOB, MIDI_DECK_GAIN_KNOB, - MIDI_DECK_MONITOR_BUTTON, MIDI_DECK_PLAYPAUSE_BUTTON, MIDI_DECK_SYNC_BUTTON, - MIDI_DECK_TOUCHSTRIP_CENTER_BUTTON, MIDI_DECK_TOUCHSTRIP_HOTCUE_CENTER_BUTTON, - MIDI_DECK_TOUCHSTRIP_HOTCUE_LEFT_BUTTON, MIDI_DECK_TOUCHSTRIP_HOTCUE_RIGHT_BUTTON, - MIDI_DECK_TOUCHSTRIP_LEFT_BUTTON, MIDI_DECK_TOUCHSTRIP_LOOP_CENTER_BUTTON, - MIDI_DECK_TOUCHSTRIP_LOOP_LEFT_BUTTON, MIDI_DECK_TOUCHSTRIP_LOOP_RIGHT_BUTTON, - MIDI_DECK_TOUCHSTRIP_RIGHT_BUTTON, MIDI_MASTER_LEVEL_KNOB, MIDI_MONITOR_LEVEL_KNOB, - MIDI_MONITOR_MIX_KNOB, MIDI_STATUS_BUTTON_MAIN, MIDI_STATUS_CC_MAIN, MIDI_TAP_BUTTON, + MIDI_DECK_MONITOR_BUTTON, MIDI_DECK_PLAYPAUSE_BUTTON, MIDI_DECK_SHIFT_BUTTON, + MIDI_DECK_SYNC_BUTTON, MIDI_DECK_TOUCHSTRIP_CENTER_BUTTON, + MIDI_DECK_TOUCHSTRIP_HOTCUE_CENTER_BUTTON, MIDI_DECK_TOUCHSTRIP_HOTCUE_LEFT_BUTTON, + MIDI_DECK_TOUCHSTRIP_HOTCUE_RIGHT_BUTTON, MIDI_DECK_TOUCHSTRIP_LEFT_BUTTON, + MIDI_DECK_TOUCHSTRIP_LOOP_CENTER_BUTTON, MIDI_DECK_TOUCHSTRIP_LOOP_LEFT_BUTTON, + MIDI_DECK_TOUCHSTRIP_LOOP_RIGHT_BUTTON, MIDI_DECK_TOUCHSTRIP_RIGHT_BUTTON, + MIDI_MASTER_LEVEL_KNOB, MIDI_MONITOR_LEVEL_KNOB, MIDI_MONITOR_MIX_KNOB, + MIDI_STATUS_BUTTON_MAIN, MIDI_STATUS_CC_MAIN, MIDI_TAP_BUTTON, }; use crate::{ ControlIndex, ControlOutputGateway, ControlRegister, LedOutput, MidiOutputConnection, @@ -54,10 +55,11 @@ impl MainLed { #[derive(Debug, Clone, Copy, FromRepr, EnumIter, EnumCount)] #[repr(u8)] pub enum DeckLed { + MonitorButton, + ShiftButton, PlayPauseButton, SyncButton, CueButton, - MonitorButton, TouchStripLeftButton, TouchStripCenterButton, TouchStripRightButton, @@ -163,6 +165,7 @@ pub fn led_output_into_midi_message(led: Led, output: LedOutput) -> [u8; 3] { }; let data1 = match led { DeckLed::MonitorButton => MIDI_DECK_MONITOR_BUTTON, + DeckLed::ShiftButton => MIDI_DECK_SHIFT_BUTTON, DeckLed::PlayPauseButton => MIDI_DECK_PLAYPAUSE_BUTTON, DeckLed::SyncButton => MIDI_DECK_SYNC_BUTTON, DeckLed::CueButton => MIDI_DECK_CUE_BUTTON,