gibber-cc / gibber

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

Slowdown/jitter for certain instruments, note and loudness/gain combinations? #59

Open abetusk opened 3 years ago

abetusk commented 3 years ago

I'm not sure if this is a bug or a "feature" but for certain combinations of instruments and loudness and/or gain settings, there are playback issues, with playback jitter, slowdown and clipping.

I'm running Firefox 83.0. Here is a minimal example that causes jitter on my system:

Clock.bpm=180;
Theory.mode = "chromatic";
Theory.root = "a4";
m1 = Monosynth("bass", {"decay":0.25,"loudness": 2});
m1.note.seq( [ 16, 16, 12, 14, 14, 14, 24, 14, 14, 14, 14, 14, 14 ], [ 0.5, 0.25, 0.25, 0.5, 0.25, 0.25, 0.5, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25] );

The specific note is the 24 in the sequence that causes the jitter. Putting more notes of equal or greater value causes more jitter. Also, decreasing the loudness parameter to 1 causes the jitter to go away.

Note that the 24 note in the sequence is upwards of a7 or so, which I assume is on the high end of the note range.

Other instruments with certain note and loudness settings causes similar slowdown/jitter issues. I've encountered it enough, especially with the Monosynth's, that I have to be cautious about what note, loudness and instrument combinations I use.

I've encountered similar jitter/slowdown issues with shoving weird parameters in synthesizers in a wide range of applications so I suspect this is the nature of doing complex synthesizer manipulation in software. I hesitate to open an issue as it might either be something that takes too much work to fix or caused by the underlying audio API but I thought I'd pass along anyway.