Tone.js icon indicating copy to clipboard operation
Tone.js copied to clipboard

Strange cracking noises with PolySynth

Open olivdee opened this issue 1 year ago • 2 comments
trafficstars

I would like to use tone.js for my next art project, but experience strange cracking noises, when playing back 2 or more tones at once.

To Reproduce Please find the code I am using attached. tone.js.testcase.zip

Expected behavior No cracking noises.

What I've tried All kinds of different settings for the oscillator and envelope, also tried out the code on the latest versions of chrome, firefox and edge.

olivdee avatar Feb 25 '24 23:02 olivdee

It's not ideal to provide code only as a ZIP especially when it doesn't contain all the files. Also, you don't need jQuery for such a basic example. I recommend to create a codepen or a glitch.com so that it's easier for people to help. You can fork this as a starting point: https://codepen.io/dirkk0/pen/OJdMGPY

Good luck!

dirkk0 avatar Feb 27 '24 14:02 dirkk0

Thank you Dirk and sorry for the late reply! I finaly got to create a pin, thanks for the codepen starting point: https://codepen.io/olivnewton/pen/qBwYmJa

I did have some trouble with this way of using PolySynth though: as long as I was defining the "polyphony" as seen in https://tonejs.github.io/docs/r13/PolySynth ...new Tone.PolySynth(3, Tone.Synth)... it was not working (strangely it is working this way in my project - but with the cracking noises). As soon as I removed the number of voices it started working. Why is that?

Anyway, your example with gain helped a lot of debugging this - now I now how to correctly use the gain in order to remove the cracking noises. Hopefully I can implement this in my project.

Thanks again!

olivdee avatar Apr 09 '24 19:04 olivdee