gibber-cc / gibber

An audiovisual live coding environment for the browser
MIT License
902 stars 79 forks source link

btof not in sync with sequences #70

Closed ianhattwick closed 2 years ago

ianhattwick commented 3 years ago

Drifts relative to both .seq and .tidal methods:

bd= Kick().trigger.tidal('1 0.25 0.5 [~ 0.25]') bd= Kick().trigger.seq([1,0.5], 1/4) bd.decay = lfo('saw', btof(4), 0.05, 0.93)

charlieroberts commented 3 years ago

so, I'm noticing that it's centered around the bias value instead of starting there, which means the trough of the waveform comes at beat 3 instead of on beat 1. Is that what you're referring to? Or do you mean it actually goes out of phase? I only tried the .seq() test but it seemed like it stayed in time for quite a while...

charlieroberts commented 3 years ago

I guess another question is if the bias value should be the center point or the trough. For sine waves it makes sense that it would be the center point, but for modulations using saw waves it doesn't make quite as much sense... anyways, I wanted to keep things consistent. Maybe I should add a phase offset?

ianhattwick commented 3 years ago

It was actually going out of phase very slowly. I’ll check again to see if I can reproduce but it was consistent, at least for that session.

Phase offset would be useful - maybe as an optional fourth argument?

-ian

On May 4, 2021, at 10:05 PM, charlie roberts @.***> wrote:

I guess another question is if the bias value should be the center point or the trough. For sine waves it makes sense that it would be the center point, but for modulations using saw waves it doesn't make quite as much sense... anyways, I wanted to keep things consistent. Maybe I should add a phase offset?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/gibber-cc/gibber/issues/70#issuecomment-832366585, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAPGSWGFYT7USUTT4PADTRDTMCRWHANCNFSM44DHRHHQ.

charlieroberts commented 2 years ago

Just checked again (against .seq() ) and didn't hear any drift. I did correct some sample math in the engine semi-recently so there's a chance that fixed it, or I still haven't found a way to reproduce the problem. I'm going to close for now but am happy to re-open if you can provide a test case. I'll also create a new issue / feature request for the phase offset.