Tonejs / Tone.js

A Web Audio framework for making interactive music in the browser.
https://tonejs.github.io
MIT License
13.52k stars 983 forks source link

NoiseSynth will not play more than once. #989

Closed jacksoncapper closed 2 years ago

jacksoncapper commented 2 years ago

The NoiseSynth will not play more than once.

let noiseSynth;
document.body.addEventListener("click", function () {
      noiseSynth = noiseSynth || new Tone.NoiseSynth().toDestination();
      noiseSynth.triggerAttackRelease("8n", 0.05);
});

MembraneSynth, MonoSynth, PolySynth ect. will all play again onclick.

jacksoncapper commented 2 years ago

Using the single parameter solved the problem:

noiseSynth.triggerAttackRelease("8n")

curtgrimes commented 2 years ago

Thanks, I experienced the same problem. I think the documentation should be updated if this is not a bug.