redFrik / f0plugins

plugins for supercollider
https://www.fredrikolofsson.com/
42 stars 3 forks source link

Dbjorklund offset bug? #4

Open dietcv opened 6 months ago

dietcv commented 6 months ago

hey,

If you use the offset param of Dbjorklund the pattern does not start at initial time. I think this is a bug:

compare: {Duty.ar(1/100, 0, Dbjorklund(5, 8, 0)) * Impulse.ar(100) }.plot(0.1); // starts with an initial trigger

with: {Duty.ar(1/100, 0, Dbjorklund(5, 8, 1)) * Impulse.ar(100) }.plot(0.1); // is shifted in time without an initial trigger

same is not true for Dbjorklund2

dietcv commented 6 months ago

I think it would be desirable to skip events instead of steps when offsetting the pattern.

I currently have the same problem with this bresenham implementation, that its offsetting steps instead of events. EDIT: fixed that with offset = (offset.neg / (n / k)).ceil; https://scsynth.org/t/bresenham-implementation-of-the-euclidean-rhythm-algorithm-in-supercollider/3127/4