From dcab07e89b762bf7e5d4a17eabd74db80a2ff067 Mon Sep 17 00:00:00 2001 From: Zach DeCook Date: Sat, 11 Mar 2023 16:09:02 -0500 Subject: Write sequencer play next note --- HexBoard_V1.1.ino | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) (limited to 'HexBoard_V1.1.ino') diff --git a/HexBoard_V1.1.ino b/HexBoard_V1.1.ino index 4c438d3..550f572 100644 --- a/HexBoard_V1.1.ino +++ b/HexBoard_V1.1.ino @@ -204,10 +204,16 @@ typedef struct { bool steps[32] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; bool bank = 0; int state = 0;// TODO: change to enum: normal, mute, solo, mute&solo + int instrument = 0; } Lane; +#define STATE_MUTE 1 +#define STATE_SOLO 2 + #define NLANES 7 Lane lanes[NLANES]; +int sequencerStep = 0; // 0 - 31 + bool sequencerMode=1; // MENU SYSTEM SETUP // @@ -274,6 +280,13 @@ byte midiVelocity = 100; // Default velocity // ------------------------------------------------------------------------------------------------------------------------------------------------------------ void setup() { +lanes[0].instrument = 36; // Bass Drum 1 +lanes[1].instrument = 40; // Electric Snare +lanes[2].instrument = 46; // Open Hi-Hat +lanes[3].instrument = 42; // Closed Hi-Hat +lanes[4].instrument = 49; // Crash Cymbal 1 +lanes[5].instrument = 45; // Low Tom +lanes[6].instrument = 50; // Hi Tom #if defined(ARDUINO_ARCH_MBED) && defined(ARDUINO_ARCH_RP2040) // Manual begin() is required on core without built-in support for TinyUSB such as mbed rp2040 @@ -654,7 +667,37 @@ int map2step(int i){ } void sequencerMaybePlayNotes(){ + // TODO: sometimes call sequencerPlayNextNote(); +} + +// Do the next note, and increment the sequencer counter +void sequencerPlayNextNote(){ + bool anySolo = false; + for(int i = 0; i