If i'm understanding you correctly you need to pre-comp the dots or parent them to a single null so they are one unit and then parent that single unit to the scale. Think about it, you are pick whipping position in x & y to scale in x, y. The scale is a value of 90 in x and y. Show your rulers and find the 90,90 point on the screen. It's in the upper left hand corner. Basically scale interpolates differently than position. Position originates at the upper left of the comp and increases right & down. Scale originates at the anchor point of the layer and radiates outward.
1 person found this helpful
You need to add the original position value of the points to the expression. Your expression should be like this:
temp = thisComp.layer("Amplitud de audio").effect("Ambos canales")("Deslizador");
Anyway, i think this is not what you are looking for. I think the best way to do this is to link the outer dots to a new null object via parenting, and link the scale of this new null to the scale of the "Central Pulse" layer via expression.
This is pretty much what I'm trying to do. So do I need to apply your expression to the central pulse layer and then add the values for the individual dots?
The expression is only to apply to individual dots in case you don't link those dots to a new null. But I think the offset will be always in the positive ranges of position values so i'm not sure this is what you need.
The second way to do it is to link the outer dots to a null, then link the scale of the null to the audio keyframes in the Audio Amplitude layer.
I tried using your second method already and this causes the size of the dots to change unfortunately. In your first method am I applying this expression to the dots position?
If you try to link the position of your dots to the scale of the null, even if you get them to move relative the their starting position they are all going to move down and to the right exactly the same together since they're all being driven by the same exact value. Because you're using beam effect and all the lines are parented to the dots, that means all the beams are going to move with the dots. The end result will be the entire object jumping down and to right in sync with the music. If that's what your trying to achieve then there are slightly less convoluted ways to achieve it. But I suspect that is not what you are going for.
I suggest trying again to explain what you are trying to achieve in ridiculous, painstaking detail as it is not entirely clear (at least to me). If you can they someone might be able to tell you how to achieve it.
Yes I see your point.
Essentially what I want the dots to do is wiggle which I can do with an expression. However I want the outer dots to wiggle in a more exaggerated fashion in relation to the audio. For example if the keyframes in the audio amplitude have a higher value then the outer dots will wiggle more. The main problem with this however is that the dots will all move in the same direction, what I want them to do is move in a direction that is outward from the centre of the composition.
Have you tried to put the anchor point of these outer dots in the center of the composition?
...what I want them to do is move in a direction that is outward from the centre of the composition.
I'm quite sure an expression can be crafted to do what you want. But as expressions are absolutely literal in interpretation you need to be absolutely exact in defining what you want - as Gutter-Fish requests.
The above quote says to me that you want the dots to wiggle ONLY on an axis between the centre of the comp (?) and their non-expressed position. My gut feeling is that isn't quite what you want.
Please think carefully about exactly what you want - or people will be wasting their time writing expressions trying to help you.
Yes you are exactly right. I want the dots to move on an axis between the centre of the comp and their original position if this is possible. As they are positioned in a ring shape I want them to wiggle outwards using an axis from the centre of the comp and their original position, and I would like them to move in relation to the audio. My apologies for being somewhat vague.
Yes I have also tried this however parenting the dots to the central null object has caused my beams to disconnect from the dots
2 people found this helpful
OK, I was feeling generous... here's a solution - I hope ; )
This expression assumes that your dot layers are not parented to any other layer.
1. Audio layer. [menu] Animation > Keyframe Assistant > Convert Audio to keyframes.
2. Paste this expression onto your first dot layer position property:
audioMin = 0;
audioMax = 50;
maxMove = 100;
radius = 500;
audioAmp = thisComp.layer("Audio Amplitude").effect("Both Channels")("Slider");
compCentre = [thisComp.width/2, thisComp.height/2];
objPos = thisLayer.position - compCentre;
Len = length(objPos);
Angle = radiansToDegrees(Math.atan2(objPos,objPos))
move1 = linear(Len, 0, radius, 0, maxMove);
move2 = linear (audioAmp, audioMin, audioMax, 0, move1);
LenW = Len + move2;
objPos2 = [ LenW * Math.cos(degreesToRadians(Angle)), LenW * Math.sin(degreesToRadians(Angle))] + compCentre
You'll need to copy this to each of your dot layers - but before you do you, adjust the values on the first four lines:
audioMin = the minimum audio level to create any dot movement ;
audioMax = the maximum audio level to create dot movement ;
(look at the graph editor value graph for the audio amplitude 'both channels' property to decide on these values - vertical scale)
maxMove = the maximum amount of dot movement ;
radius = the radius of the outermost dot's position from comp centre ;
3. Once you've set the above values copy the expression to all the other dot layers.
Preview and report back.... : )
I don't have time to play with your problem right now but my approach would be to use the length(point1, point2) method to retrieve the distance from the anchor point of the null and the anchor point of each dot then work out a linear or even ease method that adjusts that multiplies that value based on distance. The anchor point of each dot would need to be in the exact center of the dot.
The goal is to give you a new length based on the scale value of the null. Then you convert that length into a new position by retrieving the angle from the null's anchor point and the dot's anchor point.
I think that Mike Abbot may be on to something with his expression. I would have arranged it a little differently and used the position of the null rather than comp center, but his approach would probably work. I would probably throw in something like parent.toWorld (parent.anchorPoint) to take care of any parenting issues that you may have with the artwork.
On the other hand a much simpler approach would be to simply apply a displacement map driven by a simple multiplier based on scale to move things around. If you created a circular gradient shape layer with gray in the middle and white or black on the outside you would have it. This would make the dots grow but it would keep everything together. A slightly different look with a very simple expression and an adjustment layer or pre-composed dot/line comp.
Have just tested your expression and it works perfectly. Thank you so much for writing this for me! All the dots are reacting to the audio and pushing outwards from the centre of the comp which is exactly what I wanted them to do. A very clever expression indeed!
Glad it worked for you, and I appreciate the kind words : )
No problem mate
I'm still studying as a student so it's great to get some help from a professional