Firmware for HexBoard MIDI controller
Arpeggiator: Allow configuring speed
| -rw-r--r-- | HexBoard_V1.1.ino | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/HexBoard_V1.1.ino b/HexBoard_V1.1.ino index d051997..80f40e5 100644 --- a/HexBoard_V1.1.ino +++ b/HexBoard_V1.1.ino @@ -321,8 +321,7 @@ int screenTime = 0; // Used to dim screen after a set time to prolo // Arpeggiator variables int arpTime = 0; // Measures time per note -// TODO: Make this a configurable variable? -#define ARP_THRESHOLD 100 // Set arp speed (in milliseconds) +int arpThreshold = 20; // Set arp speed (in milliseconds) byte curr_pitch = 128; // Keep track of whether this note is held or not. bool pitchRef[256]; @@ -510,6 +509,10 @@ SelectOptionInt selectTonesOptions[] = {{"12", 12}, {"19", 19}, {"24", 24}, {"31 GEMSelect selectTones(sizeof(selectTonesOptions)/sizeof(SelectOptionInt), selectTonesOptions); GEMItem menuItemTones("Tones:", tones, selectTones); +SelectOptionInt selectArpOptions[] = {{"Fast", 20}, {"Medium", 40}, {"Slow", 80}, {"sloooow", 120}}; +GEMSelect selectArp(sizeof(selectArpOptions)/sizeof(SelectOptionInt), selectArpOptions); +GEMItem menuItemArp("Arp Speed:", arpThreshold, selectArp); + // Create menu object of class GEM_u8g2. Supply its constructor with reference to u8g2 object we created earlier byte menuItemHeight = 10; byte menuPageScreenTopOffset = 10; @@ -985,7 +988,7 @@ void reactiveLighting() { starPattern(i); // Creates a starburst around the pressed button. break; case 5: - orbitPattern(i); // Creates a starburst around the pressed button. + orbitPattern(i); // Lights orbit around the pressed button. break; default: // Just in case something goes wrong? buttonPattern(i); @@ -1289,7 +1292,7 @@ byte getNextNote(int direction, byte note) { } void arp(int direction) { - if (currentTime - arpTime > ARP_THRESHOLD){ + if (currentTime - arpTime > arpThreshold){ arpTime = millis(); byte target = 128; target = getNextNote(direction, curr_pitch); @@ -1451,6 +1454,7 @@ void setupMenu() { menuPageTesting.addMenuItem(menuItemFull); menuPageTesting.addMenuItem(menuItemVersion); menuPageTesting.addMenuItem(menuItemTones); + menuPageTesting.addMenuItem(menuItemArp); // Specify parent menu page for the other menu pages menuPageLayout.setParentMenuPage(menuPageMain); menuPageTesting.setParentMenuPage(menuPageMain); |