From 2d201bd278efe554a4c3329c21b4b6bda500682e Mon Sep 17 00:00:00 2001 From: Zach DeCook Date: Sat, 11 Mar 2023 16:13:20 -0500 Subject: Sequencer: rely on the steps toggles instead of just playing all the time lol --- HexBoard_V1.1.ino | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'HexBoard_V1.1.ino') diff --git a/HexBoard_V1.1.ino b/HexBoard_V1.1.ino index 550f572..fe1c66b 100644 --- a/HexBoard_V1.1.ino +++ b/HexBoard_V1.1.ino @@ -689,15 +689,18 @@ void sequencerPlayNextNote(){ if(lanes[i].state & STATE_MUTE){ continue; } - // do the thing. - noteOn(midiChannel, lanes[i].instrument % 128, midiVelocity); - // TODO: Change when the noteoff is played? - noteOff(midiChannel, lanes[i].instrument % 128, 0); + int offset = lanes[i].bank * 16; + if(lanes[i].steps[sequencerStep+offset]){ + // do the thing. + noteOn(midiChannel, lanes[i].instrument % 128, midiVelocity); + // TODO: Change when the noteoff is played? + noteOff(midiChannel, lanes[i].instrument % 128, 0); + } } // increment and confine to limit sequencerStep++; - sequencerStep%=32; + sequencerStep%=16; } // Return the first note that is currently held. -- cgit 1.4.1