Skip to content

Commit

Permalink
Keep re-recording until button is pressed
Browse files Browse the repository at this point in the history
  • Loading branch information
devcurmudgeon committed Aug 9, 2018
1 parent aac4911 commit 9bcc8bb
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions source/alo.c
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,6 @@ button_logic(LV2_Handle instance, bool new_button_state)
log("STATE: RECORDING (button reset)");
}
}

}

/**
Expand Down Expand Up @@ -357,12 +356,17 @@ run(LV2_Handle instance, uint32_t n_samples)
// log("Sample: %.9f", sample);
recording[self->loop_index] = sample;
if (self->phrase_start && self->phrase_start == self->loop_index) {
if (new_button_state) {
if (self->button_state) {
self->state = STATE_LOOP_ON;
log("STATE: LOOP ON");
} else {
self->state = STATE_LOOP_OFF;
log("STATE: LOOP OFF");
if (self->state == STATE_RECORDING) {
self->phrase_start = 0;
log("STATE: RECORDING... going round again");
} else {
self->state = STATE_LOOP_OFF;
log("STATE: LOOP OFF");
}
}
}
if (self->state == STATE_RECORDING) {
Expand Down

0 comments on commit 9bcc8bb

Please sign in to comment.