From 94fcb2bf81065fb91533f300ae03b4d863cb4e8e Mon Sep 17 00:00:00 2001 From: Paul Sherwood Date: Sun, 19 Aug 2018 15:50:53 +0100 Subject: [PATCH] Restart loop index when BPM changes --- source/alo.c | 1 + 1 file changed, 1 insertion(+) diff --git a/source/alo.c b/source/alo.c index 360d289..39f685b 100644 --- a/source/alo.c +++ b/source/alo.c @@ -267,6 +267,7 @@ update_position(Alo* self, const LV2_Atom_Object* obj) self->bpm = ((LV2_Atom_Float*)bpm)->body; self->loop_beats = 4 * (uint32_t)floorf(*(self->ports.bars)); self->loop_samples = self->loop_beats * self->rate * 60.0f / self->bpm; + self->loop_index = 0; log("BPM: %G", self->bpm); log("Loop_samples: %d", self->loop_samples); for (int i = 0; i < NUM_LOOPS; i++) {