I would use the Audio Waveform layer as an alpha track matte for a shape layer with an animated gradient fill.
Use a duplicate of the waveform/ audio spectrum as an Alpha matte for the color.
Hey Rick, thanks for the response. I thought of this too. The issue is that I am using an expression on a solid that generates the size of the next block with respect to the Audio Amplitude Keyframe. Therefore, I have about 100 duplicates of the solid to generate that whole waveform. If I duplicated the whole thing again, it just adds on to the end of the existing spectrum thanks to the expression code :/ Here is the code I used: How to generate a static waveform presentation of an audio file. : Adobe After Effects Expressions. Do you have any suggestions to make this waveform easier? Or a different way to make the duplicate waveform/ alpha matte process work?
Is there a way I can post my project for you to look at?
Thank you again for your help
Thanks for the suggestion, please look at my previous response to Rick to see if you have any other suggestions
So just to clarify you are trying to create a levels representation for the duration of an audio file and not an animated audio frequency analysis. If that's what you're doing just pre-compose those hundreds of layers or nest the comp in your main comp and then use the track matte. If it were me I'd probably just import the audio layer into the comp, press the L key twice to reveal the audio wave form, press the ~ key to make the timeline full screen, expand the wave form, take a screenshot, add the screenshot to the comp, apply Keylight, then add a shape layer below the screenshot, set the screenshot as an inverted alpha track matte for the animated gradient and be done with it. This comp would be nested in my main comp to complete the effect.
If I wanted a different look for the waveform I would edit the screenshot in Photoshop or use a Premiere Pro or any other program to capture a screenshot of the waveform. Since you've done all the work of creating your hundreds of layers I'd just pre-compose them all, drop a shape layer with an animated gradient below the pre-comp and set up the track matte.
Hey Rick, one last question. Do you know of an expression that would duplicate the solid for me? So instead of having 100+ solid layers, I could have 1 solid layer that duplicates a solid and "offsets" it? Just curious if this is an option since the pre-comp with 100 solids takes quite a long time to render. The above tips were extremely helpful
You could use this expression on the position property of your first layer to offset duplicates 20 pixels to the right:
ofst = index*20;
x = value + ofst;
Add the expression, position the first layer then add your other expression and start duplicating.
There is no expression or way to do this on a single layer. You could use 100 rectangles on a single shape layer but the expression for offset would be more complicated.
100 Solids that were no bigger than your tallest bar would not much longer to render than a single solid the size of the comp but when you throw in an expression that looks at a different value in time for each copy things are going to slow down considerably.
Alright, well thank you very much Rick, your help is greatly appreciated. I ended up doing a variation of your idea using Keylight. Saves so much time on rendering!