Jump to content
Search Community

New use for GSAP!

swampthang test
Moderator Tag

Go to solution Solved by swampthang,

Recommended Posts

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

  • Like 3
Link to comment
Share on other sites

  • Solution

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

  • Like 2
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...