-
Audio reactive shape layer query
Hi AFX expression experts
I’m going to try and get away with asking for help with two problems, however they are related:
1) I want to use the audio amplitude from a track to change the number of points in a shape layer, so that the points change with the main beat of a piece of music. I know that I can use the following expression to achieve this, which will also use a selected range of keyrames from the audio amplitude that’s mapped to a range of points on the shape layer:
maxAudio = 45;
temp = thisComp.layer(“Audio Amplitude”).effect(“Both Channels”)(“Slider”);
linear(temp,35,maxAudio,3,20)So with this, the shape has 3 points at 35 audio units or less. This results in the shape having 3 points (a triangle!) most of the time, as there is a keyframe on every frame, and most of these are under 35, apart from the main beat which is approximately every 12 frames.
However, is there a way for the keyframes that fall beneath the range (under 35) to be disregarded entirely? So that the shape only reacts to the keyrames within the range (35-45), and keeps the number of points from last keyframe that falls in that range?
2) Can the number of points in the above shape layer that are reacting to the audio be randomised, but, still fall within a range (e.g. a random number of points between 3 and 20 that are reacting to the beat of the song)?
I hope that makes sense!
Many thanks for any help
Ben