rserota / wad

Web Audio DAW. Use the Web Audio API for dynamic sound synthesis. It's like jQuery for your ears.
MIT License
1.88k stars 160 forks source link

Trouble applying compression #141

Closed swampthang closed 2 years ago

swampthang commented 2 years ago

This library looks like it is well organized and well thought out. Kudos!

I'm giving this a go and thinking maybe I don't have it set up right. Ultimately I'd like to set up side-chain compression (ducking) for background music and narration. For now, just to see how things work, I created a codepen here:

https://codepen.io/swampthang/pen/gOGpjOg

I created a Wad for the audio file, a Wad for compression and a Poly. I added the audio file and then the compression but I don't hear any difference.

Question regarding the library: Can compression params be adjusted in real time using input sliders, etc? Also, is there an example somewhere of using wad to do side-chain compression? Would be very helpful.

swampthang commented 2 years ago

Here's another codepen where I've added range sliders. I also changed the compressor into a Poly to see if that might be the issue. https://codepen.io/swampthang/pen/PoJqyjq Any guidance would be appreciated.

swampthang commented 2 years ago

Looks like I needed to add the audio to the compressor Poly. Here's a working version... https://codepen.io/swampthang/pen/eYGpOPr

rserota commented 2 years ago

It looks like you figured out your own issue: The compressor belongs on the PolyWad, not the actual Wad containing the audio source. Let me know if you think the docs could be more clear about this.

Thanks for using WadJS! Cheers.