soundshader / soundshader.github.io

https://soundshader.github.io
347 stars 17 forks source link

Delay / lag / synchronization #6

Open ibis85 opened 4 years ago

ibis85 commented 4 years ago

Fantastic visualizer and amazing work; thank you very much for making this.

Maybe it's just a placebo effect, but I feel like the phase of the visualizer isn't quite in sync with the music I've tried playing. I'm not sure, but I think it seems to be noticeably delayed, and the delay doesn't seem to be at a simple beat division, so the movement of the visualizer feels like it doesn't fit the rhythm of what I'm hearing. This is probably the most beautiful and intuitive music visualizer I've used, but due to this perception, when it's actually playing live I can't really appreciate it.

If it's doing all of the calculations in real-time, is there any way to run it ahead of time against an audio file and pre-generate the visualization so that it can play perfectly in sync with the audio?

If I'm just crazy or something, please let me know. I'm just trying to understand why it subjectively seems like a rhythmic mismatch to my ears.

soundshader commented 4 years ago

I tried reducing the lag by starting the computation first: https://github.com/soundshader/soundshader.github.io/blob/master/audio/controller.js#L212

However even in the worst case, the lag shouldn't be more than 1/60 sec.

My impression has been that the lag is not real, but perceived. When we hear a new sound pattern, it's being rendered at the same time in the middle of the circle, but we recognize this circle as a distinct shape only when it sufficiently expands, say to 10% of the screen and 10% corresponds to about 1.5 sec. If my guess is correct, the lag can be fixed by mapping the t=0 moment to the r=50px circle.

soundshader commented 4 years ago

Try adding ?acf.r0=0.3 to the URL.

afiaka87 commented 4 years ago

@ibis85 Have you tried using the mouseover zoom feature?