Activity › Forums › Adobe After Effects Expressions › Using soundkeys to control 2 different comps….
-
Using soundkeys to control 2 different comps….
Posted by Aza Allen on March 11, 2010 at 3:42 amIt was hard to phrase the question, but here’s what I’m trying to do…
I have a Main Comp with a soundtrack, and a bunch of Nested Comps in the Main comp.
I want to control things inside a couple of those Nested comps using soundkeys.
So for example…
In one of my Nested Comps, I am using Video CoPilot’s Sure Target to move my camera from one object to the next which basically just needs the output of sound keys to count sequentially so I can go from 1 to 2, 3, 4, etc.
Is it possible to do this?
Make sure to check out my Heroes Fan Film at https://ruesterprod.blip.tv
Anthony Jestin replied 13 years, 3 months ago 4 Members · 17 Replies -
17 Replies
-
Dan Ebberts
March 11, 2010 at 4:35 amIf you’re asking if you can use a Sound Keys output to drive an expression in another comp, the answer is yes — you can either open both timelines so you can use the pick whip to help generate the code, or enter it by hand. In either case it will look like this:
comp(“Sound Keys Comp”).layer(“Solid 1”).effect(“Sound Keys”)(“Output 1”)
If you’re asking if you can use Sound Keys to count beats so your camera can move to a new target on each beat, I’d say the answer is not directly. You can set the output’s Falloff to None(integrate) so that the output value always increases, but not in discrete steps. One alternative would be to use a beat counting expression like the one described here:
https://www.motionscript.com/design-guide/audio-count.html
You could either adapt it to work with Sound Keys, or convert your audio to keyframes and use it the way it is.
Hope that’s helpful.
Dan
-
Aza Allen
September 23, 2010 at 5:32 amWell, I did it by hand last time, but now I’m running into an issue on a larger project where I need to count up from 1. I saw the expression that you linked to above, but I’m not sure how to modify it for SoundKeys.
I can get sound keys to go from 0 to 1 each time it’s activated, but it goes back to zero, how do I get it to go up to 2, 3, 4, etc?
Thanks for any help I can get!
Aza
Make sure to check out our website http://www.makeyourfriendsuncomfortable.com and my personal website http://www.ruesterprod.com
-
Aza Allen
September 23, 2010 at 9:09 pmThanks for your response Dan!
Yes, (forgot to mention in my post, sorry) I used the settings as follows –
Range1: type = On/Off Trigger
Falloff = None
Output Min/Max = 0..1…and if I do that, it counts up 1 for every frame the beat is present inside the box (instead of 1 for every beat, and the beat lasts 3-5 frames)
Is there a way to get it to just use one frame while the beat is present and reject the rest, so that every time the beat hits it only counts one frame?
Thanks all,
AzaMake sure to check out our website http://www.makeyourfriendsuncomfortable.com and my personal website http://www.ruesterprod.com
-
Aza Allen
September 24, 2010 at 2:16 am…I would even be happy if someone could let me know how to modify the code I’m attaching so that it might work with my purposes…
(This is the code from Dan’s link above, I’m just not quite sure I know how to modify it to work for this)Thanks all,
Aza
threshold = 10.0;audioLev = thisComp.layer("Audio Amplitude").effect("Both Channels")("Slider");
above = false;
frame = Math.round(time / thisComp.frameDuration);
n = 0;
while (frame >= 0){
t = frame * thisComp.frameDuration;
if (above){
if (audioLev.valueAtTime(t) < threshold){
above = false;
}}else if (audioLev.valueAtTime(t) >= threshold){
above = true;
n++;
}
frame--
}n
Make sure to check out our website http://www.makeyourfriendsuncomfortable.com and my personal website http://www.ruesterprod.com
-
Dan Ebberts
September 24, 2010 at 5:17 amTry changing your Sound Keys settings back to the default: Type = Average of Range, Falloff = Instant, Output Min/Max = 0..100. Then just change the second line of my expression to point audioLev at Sound Keys Output 1. The expression should count the beats.
Dan
-
Aza Allen
September 24, 2010 at 6:03 amThank you so much Dan!
That works!
I am good at math, and bad at expressions, which seems odd to me, seems like the two would go hand in hand…. I never get a chance to sit with them, but I need to make time for that.
Thanks again!
Aza
Make sure to check out our website http://www.makeyourfriendsuncomfortable.com and my personal website http://www.ruesterprod.com
-
Aza Allen
September 26, 2010 at 12:43 am… Okay, well, I ran into an issue… oops, (this may be asking too much now) technically the expression does exactly what I asked for it to do, but I didn’t realize that the way Soundkeys animates is by also using the numbers between each integer value so that the animations can ramp/ease in/out…
So… is there a way to modify this once more to have decimal values between the beats?
What I am trying to do is use Soundkeys in conjunction with VideoCopilot.net’s “Sure Target 2.0” ( https://www.videocopilot.net/presets/sure_target_2/ ) to drive an animation.
So I may have been going about this all the very wrong way, but I am working on a music video that is all text, and I’m trying to hget words to fly up on the screen with the vocals of the track (which I am using an A Capella version of the track to try and use soundkeys to drive the animation, and Sure Target to focus the camera on the words, or groups of words sang)
The expression is basically posterizing the camera movements instead of transitioning smoothly.
Is there any way to do this – I am sorry I didn’t state my original intentions up front, since this may change everything we’ve discussed.
Thanks,
AzaMake sure to check out our website http://www.makeyourfriendsuncomfortable.com and my personal website http://www.ruesterprod.com
-
Aza Allen
September 26, 2010 at 12:49 am…basically I need to add falloff, I tried changing falloff settings in Soundkeys, but that didn’t work.
Make sure to check out our website http://www.makeyourfriendsuncomfortable.com and my personal website http://www.ruesterprod.com
-
Dan Ebberts
September 26, 2010 at 10:34 pmThat would be a similar expression, but different enough that it would be some work. Maybe somebody has time to tackle it. Basically you need to find the beats on both sides of the current time and then (using linear() most likely) calculate the percentage of time elapsed between those two beats. Then you just convert the percentage to decimal and add it to number of the previous beat. That should give you the tween values you’re looking for.
Dan
Reply to this Discussion! Login or Sign Up