diff --git a/kikpad.h b/kikpad.h index 3835eb9..d27e64b 100644 --- a/kikpad.h +++ b/kikpad.h @@ -200,7 +200,7 @@ EV_NONE, EV_ERROR, EV_BTN_PRESSED, EV_BTN_RELEASED, -EV_BTN_HOLDED, +EV_BTN_HELD, EV_PAD_PRESSED, EV_PAD_RELEASED, EV_EC_CW, @@ -248,7 +248,7 @@ uint8_t ButtonGetLed(uint8_t bt); void ButtonsBarSetLedMsk(uint8_t btBar,uint32_t bitMsk); uint32_t ButtonsBarGetLedMsk(uint8_t btBar); boolean ButtonIsPressed(uint8_t bt); -boolean ButtonIsHolded(uint8_t bt); +boolean ButtonIsHeld(uint8_t bt); boolean PadIsPressed(uint8_t padIdx); #endif diff --git a/kikpad.ino b/kikpad.ino index 78af9b3..eda1789 100644 --- a/kikpad.ino +++ b/kikpad.ino @@ -175,10 +175,12 @@ volatile uint16_t BtnScanStates[8][11] = { // Kikpad functionnal module.Uncomment only one. + +#include "mod_kikpad_io.h" //#include "mod_kikpad_demo.h" //#include "mod_kikpad_MPC.h" //#include "mod_kikpad_MPCClipsTest.h" -#include "mod_kikpad_MPCClipLauncher.h" +//#include "mod_kikpad_MPCClipLauncher.h" //#include "mod_kikpad_MPCForce.h" @@ -469,7 +471,7 @@ void UserEventsTim3Handler() { if ( BtnScanStates[r][c] < BT_HOLD_THRESHOLD ) BtnScanStates[r][c]++; else if ( BtnScanStates[r][c] == BT_HOLD_THRESHOLD ) { BtnScanStates[r][c] ++; - UserEvent_t ev = { .ev = EV_BTN_HOLDED, .d1 = c-8 , .d2 = r } ; + UserEvent_t ev = { .ev = EV_BTN_HELD, .d1 = c-8 , .d2 = r } ; UserEventQueue.write((uint8_t*)&ev,sizeof(UserEvent_t)); } } @@ -624,7 +626,7 @@ boolean ButtonIsPressed(uint8_t bt) { /////////////////////////////////////////////////////////////////////////////// // Get the current holded state of a button (not a pad !) /////////////////////////////////////////////////////////////////////////////// -boolean ButtonIsHolded(uint8_t bt) { +boolean ButtonIsHeld(uint8_t bt) { if (bt >= BT_NB_MAX ) return false; // r and c are inversed in the scan array uint8_t r = bt/8 ; @@ -690,7 +692,7 @@ static void ProcessUserEvent(UserEvent_t *ev){ } else - // UPDATE = HOLD MODE2 & MASTER7 THEN PRESS SET + // UPDATE = HOLD BT_CONTROL4 & MASTER7 THEN PRESS SET if ( ButtonIsPressed(BT_MS7) ) { PadLedStates[0] = PadLedStates[1] = ButtonsLedStates[0] = ButtonsLedStates[1] = 0; delay(100); @@ -799,7 +801,7 @@ void setup() { RGBRefreshTim2.resume(); // All Leds On - PadLedStates[0] = PadLedStates[1] = ButtonsLedStates[0] = ButtonsLedStates[1] = 0xFFFFFFFF; + PadLedStates[0] = PadLedStates[1] = ButtonsLedStates[0] = ButtonsLedStates[1] = 0; // Show all colors for (uint8_t i=0; i != 64 ; i ++ ) PadColorsCurrent[i]=i; diff --git a/mod_kikpad_demo.h b/mod_kikpad_demo.h index 208d7c1..f2a731e 100644 --- a/mod_kikpad_demo.h +++ b/mod_kikpad_demo.h @@ -161,6 +161,22 @@ void KikpadMod_ProcessUserEvent(UserEvent_t *ev){ PadSetColor(55, GREEN); } } + + else if (keyBoardMap[i] == -3 ) { + midiNoteTranspose += 12; + if ( midiNoteTranspose > 0) { + PadSetColor(48, GREEN); + PadSetColor(55, CYAN); + } + else if ( midiNoteTranspose == 0) { + PadSetColor(48, GREEN); + PadSetColor(55, GREEN); + } + else { + PadSetColor(48, CYAN); + PadSetColor(55, GREEN); + } + } } break; @@ -194,6 +210,22 @@ void KikpadMod_ProcessUserEvent(UserEvent_t *ev){ PadSetColor(55, GREEN); } } + + else if (keyBoardMap[i] == -3 ) { + midiNoteTranspose -= 12; + if ( midiNoteTranspose > 0) { + PadSetColor(48, GREEN); + PadSetColor(55, CYAN); + } + else if ( midiNoteTranspose == 0) { + PadSetColor(48, GREEN); + PadSetColor(55, GREEN); + } + else { + PadSetColor(48, CYAN); + PadSetColor(55, GREEN); + } + } } break;