Firmware for HexBoard MIDI controller
Diffstat (limited to 'HexBoard_V1.ino')
| -rw-r--r-- | HexBoard_V1.ino | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/HexBoard_V1.ino b/HexBoard_V1.ino index 1e3b3c0..99737e8 100644 --- a/HexBoard_V1.ino +++ b/HexBoard_V1.ino @@ -242,17 +242,17 @@ void playNotes() { if (activeButtons[i] == 1) // If the button is active (newpress) { - if (wickiHaydenLayout[i] < 128) { - noteOn(midiChannel, (wickiHaydenLayout[i] + octave) % 128 , velocity); + if (currentLayout[i] < 128) { + noteOn(midiChannel, (currentLayout[i] + octave) % 128 , velocity); } else { - commandPress(wickiHaydenLayout[i]); + commandPress(currentLayout[i]); } } else { // If the button is inactive (released) - if (wickiHaydenLayout[i] < 128) { - noteOff(midiChannel, (wickiHaydenLayout[i] + octave) % 128, 0); + if (currentLayout[i] < 128) { + noteOff(midiChannel, (currentLayout[i] + octave) % 128, 0); } else { - commandRelease(wickiHaydenLayout[i]); + commandRelease(currentLayout[i]); } } } @@ -288,6 +288,15 @@ void commandPress(byte command) octave += 12; setOctLED(); leds[octUpSW] = CRGB::White; } + } else if (command == LAY_MD) { + if (currentLayout == wickiHaydenLayout) { + currentLayout = harmonicTableLayout; + } else if (currentLayout == harmonicTableLayout) { + currentLayout = gerhardLayout; + } else { + currentLayout = wickiHaydenLayout; + } + setLayoutLED(); } } void commandRelease(byte command) |