Skip to content

Commit

Permalink
closes #200 reset seq display after freeze
Browse files Browse the repository at this point in the history
  • Loading branch information
scottc11 committed Jun 10, 2023
1 parent 139f2a6 commit 38cba9b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
1 change: 0 additions & 1 deletion Degree/Inc/SuperSeq.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ class SuperSeq {
int newEventPos; // when a new event is created, we store the position in this variable in case we need it for something (ie. sequence overdubing)

int progressDiviser; // lengthPPQN / 16 (num LEDs used)
int progressCounter; // current
int progress;

bool adaptiveLength; // flag determining if the sequence length should increase past its current length
Expand Down
15 changes: 11 additions & 4 deletions Degree/Src/TouchChannel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -503,13 +503,19 @@ void TouchChannel::freeze(bool state)
freezeChannel = state;
if (freezeChannel == true) {
freezeStep = sequence.currStep; // log the last sequence led to be illuminated
// maybe blink the degree LEDs?
// maybe blink the display LED sequence was frozen at?
if (sequence.containsEvents() && sequence.playbackEnabled) {
display->enableBlink();
drawSequenceToDisplay(true);
}
} else {
// reset last led in sequence before freeze
if (sequence.playbackEnabled && sequence.currStep != freezeStep)
if (sequence.containsEvents() && sequence.playbackEnabled)
{
setSequenceLED(freezeStep, PWM::PWM_LOW_MID, false);
if (sequence.currStep < freezeStep) {
display->clear(channelIndex);
}
display->disableBlink();
drawSequenceToDisplay(false);
}
}
}
Expand Down Expand Up @@ -1187,6 +1193,7 @@ TouchChannel::setSequenceLED(uint8_t step, uint8_t pwm, bool blink)
*/
void TouchChannel::drawSequenceToDisplay(bool blink)
{
sequence.setProgress(); // overkill, but ensures all the LEDs get lit
int counter = 0;
while (counter <= sequence.progress)
{
Expand Down

0 comments on commit 38cba9b

Please sign in to comment.