swampthang Posted December 7, 2021 Share Posted December 7, 2021 I needed to create what's known as side chain compression in real time using the Web Audio api but it doesn't have that built-in functionality. It does have the ability to change each of the params AND it has a setValueAtTime method but that has NO CALLBACK which is crazy! So, I turned to good ole GSAP and thought I'd post the results here for anyone who might be able to get something out of this. I haven't been in here in a while so wanted to at least contribute something. Hope it helps someone. See the Pen rNGONbN?editors=1010 by swampthang (@swampthang) on CodePen 3 Link to comment Share on other sites More sharing options...
GreenSock Posted December 8, 2021 Share Posted December 8, 2021 Hey, thanks for sharing, @swampthang! Clever. I always love seeing the creative ways people leverage GSAP. 1 Link to comment Share on other sites More sharing options...
Solution swampthang Posted December 9, 2021 Author Solution Share Posted December 9, 2021 This version works much better. I'm only changing the gain level of the background music in this one. There is no compression on the track. I created 2 GSAP timelines, 1 to be used for lowering the music (duckingTL) and one for handling turning it back up (releasingTL) because a user might choose a release speed value longer than the attack (lowering) speed value or visa versa. Also, the knee value is really a slope setting so I chose varying eases based on the knee value. See the Pen poWbMdK?editors=1010 by swampthang (@swampthang) on CodePen 2 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now