Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save applecargo/169564e3a7a8043aad0d7ab11abc7eb4 to your computer and use it in GitHub Desktop.
Save applecargo/169564e3a7a8043aad0d7ab11abc7eb4 to your computer and use it in GitHub Desktop.
// for example, if we have a mp3 at "audio/tuba@7/01.mp3"
var test = new Tone.Player("audio/tuba@7/01.mp3").toMaster(); // load and connect
test.retrigger = true; // enable retrigger
test_srcs = []; // prepare an array to keep track of sounds..
test_srcs.push(test.start()._source); // start playbacks and collect their '_source's..
test_srcs.push(test.start()._source);
//...
// do it as much as u want. over and over.. it will accumulate on and on.
//...
// and then, to stop all at once. -->
test_srcs.forEach(function(item){item.stop()});
//Viola!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment