Tonejs / Tone.js

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

Request: Tutorial or example code for using Tone.js with AudioWorklet #1180

Closed ardenschager closed 1 year ago

ardenschager commented 1 year ago

Hello all,

I'm trying to learn WebAudio stuff recently, and am enjoying tone.js + p5.js together. However, I am also bumping up against a performance limit with the polysynth on some browsers (lots of objects making noises), and figured one solution would be putting the audio onto audio worklets. I can't find any documentation or examples of how to do this with Tone.js, except that this function exists: createAudioWorkletNode and the resulting class exists. Guessing it is also a gap in my WebAudio knowledge, but I've actually been using Tone as my entry point for WebAudio and am not used to working from WebAudio back to Tone.

Basically, I was wondering if there were any example projects you could point me to for how to use the function/class above, and also wanted to suggest adding a page to the GitHub Wiki about using audio worklet with the library.

Thanks for your time and best, -Nat