Tonejs / Tone.js

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

Performance question, related to multiple effects #1092

Closed jase741 closed 2 years ago

jase741 commented 2 years ago

Hi all,

I'm having 1 FMsynth, 1 Membrane Synth, 6 Sampler tracks. Using scheduled Transport. Tried setting own context to 22000 rate. Converted WAV to MP3 Each of my instruments have their own Effects, Reverb, distortion and a low pass filter.

Q: am I being stupid? I have thought it would be fine to have one reverb and distortion and just 'send' from each instrument, but I didn't so far see any example of using send. Would this have a positive impact on performance or not?

I sometimes get crackling and popping, I'm using a limiter so I'm wondering if it's my connections which are maybe unwisely configured.

Thank you

marcelblum commented 2 years ago

Short answer: it's probably the reverb which is one of the most expensive effects. Which type of reverb are you using? What kind of device are you getting glitching on?

It would definitely help to use single shared effects nodes where possible (as in, 1 reverb node that all source nodes are connected to). You can use individual gain nodes as reverb sends so you can vary the send amount from each source while only using a single reverb node.