devcurmudgeon / alo

A Looper plugin for MOD duo
MIT License
20 stars 6 forks source link

self->loop_beats is 0 the first time run gets called, resulting in arithmetic error #2

Closed gtrainavicius closed 4 years ago

gtrainavicius commented 4 years ago

As the title says, self->loop_beats is 0 the first time run gets called.

https://github.com/devcurmudgeon/alo/blob/master/source/alo.c#L539

An easy workaround is to check for 0 before attempting division:

if (self->loop_beats != 0 && self->loop_index % (self->loop_samples / self->loop_beats) == 0) {
devcurmudgeon commented 4 years ago

Thanks for raising this @gtrainavicius - I believe it's is now fixed in master by @paulfd changes