5 Replies Latest reply on Sep 16, 2012 11:02 AM by Rick Gerard

    audiolayer for all the precomps

    distortedkick

      Hey,

       

      I'm doing an audio visualization video (I'm working with Trapcode Soundkeys) and for every special Audio part, I devided the main comp into several precomps.
      (Firstly, I didn't want to do this but I had to because I couldn't find any ways to deactivate a soundkey value transfer at a specific time; so if anyone can help me here I'd be glad)

       

      So my actual problem is that I want to have a single audiolayer in the main comp and every precomp should only contain the specific part of the audiotrack.
      But I have no clue how to do it. Atm I always have to drag the audiolayer bar in the precomp to the right position but even if it is at the right position, it isn't synched!

       

      Thanks in advance!

        • 1. Re: audiolayer for all the precomps
          Rick Gerard Adobe Community Professional & MVP

          You have a couple of options here. The first is to keep everything in a single comp but split the Sound Keys layers where they need to be split. You can also animate the values in Sound Keys if that will do. There's nothing anywhere that says you can't apply sound keys to several different layers.

           

          The second is to split (Ctrl/Cmnd + Shift + D) the sound layer for each section, run sound keys on the split layers, then pre-compose each section. If your preferences are set to syncronize related events you should be fine.

          • 2. Re: audiolayer for all the precomps
            distortedkick Level 1

            Thanks for your help!

            I could solve the problem with the sound layer.

             

            But how do I animate a Sound Keys value ? Because the value is coloured red and I can't change it..I want to use the soundkey value for example for like 5s and then a normal value should be applied..
            So is that possible to do in one layer?

            • 3. Re: audiolayer for all the precomps
              Rick Gerard Adobe Community Professional & MVP

              The usual workflow when using sound keys is to create a solid layer and apply sound keys. You assign the audio track and then Sound Keys generates a bunch of keyframes. You then tie the keyframes generated by sound keys to what ever effect you want to use with an expression.

               

              As I said before, there's nothing keeping you from adding multiple copies of sound keys to a layer and then animating (that means setting or removing keyframes) the values. Take a look at this screenshot. I've got a total of 6 soundkeys sets of keyframes. Some have been removed.

               

              If you then use the pickwhip to tie a property like scale to say Output 1 of the first Sound Keys you would simply add a value + to the front of the last line. Say the maximum value of Output 1 was 30 and you wanted the scale to vary between 50% and 100% the expression would look like this:

               

              newScale = thisComp.layer("LikeParticles").effect("Sound Keys")("Output 1");

              expScale = ease(newScale, 0, 30, -50, 0);

              value + [expScale, expScale]

               

              I've never had a situation come up where I couldn't do what I wanted by carefully setting the input and output range this technique.

              • 4. Re: audiolayer for all the precomps
                distortedkick Level 1

                Thanks for your response.
                I can't see your screenshot. Did you forget to post it?

                 

                Sorry, but I don't understand the code. Could you explain it to me?
                The first line is clear. It's the way how I tie a property to an Output of  Sound Keys.
                I don't get the other two lines. What do they exactly mean?

                • 5. Re: audiolayer for all the precomps
                  Rick Gerard Adobe Community Professional & MVP

                  The first line just grabs the value from the keyframes and defines that value as newScale (you get that)

                  The second line adjusts the output range of the newScale value and eases the transition between keyframes. This adjusted value is defined as expScale. The name could be anything.

                   

                  I use the interpolation method ease(t, tMin, tMax, value1, value2) to calculate the new values for expScale. The interpolation method is available from the Timeline Expression Language Menu. The variable "t" is replaced with the newScale property. That's where we get the values used for calculations. By selecting the Sound Keys Output 1 property in the timeline and revealing the Graph editor I could see that the maximum value for Output 1 was 29.9 and the lowest was 0. To make those values translate into usable scale values I set the output range to -50 and 0. The explanation of line 3 will give you the reason that I chose these values. If I had set the values to 0 and 500 and not modified the array in line 3  then the layer would scale from 0% to 500% while the value of the Output 1 keyframes changed. An Output 1 value of 15 would give a scale value of 500%. Do you get line 2 now?

                   

                  In line 3 I set up the array by enclosing the values in an array for scale. An array is anything in square brackets. Since scale has an x and y value for a 2D layer and I want the scale to not change the aspect ratio of the layer defining the array as [expScale, expScale] sets both x and y values for scale to the result of the method in line 2. As a final modification to the array I want to add the values calculated in line 2 to the original value of scale. To do that I simply called the original value and added it to the new value calculated by line 2. That is simply written value + [what ever array you want].

                   

                  Now why did I choose -50 and 0 for my values in the Interpolation method in line 2? Because I wanted to limit the layer scale from 50% to 100% for the entire animation. When the keyframe value for Output 1 is 0 the calculated value in line 2 will be 50% because 100 - 50 is 50. When the value for Output 1 is 15 then the calculated value will be 75% because my range for Output 1 is 0 to 30 and 15 is half way between 0 and 30 so the interpreted value will be -25 (half way between 0 and -50).

                   

                  You should get it now.

                   

                  If your keyframe values from sound keys were from 0 to 40 and you wanted to not have the attached property change when the value fell below 20 then you could modify the method in line 2. Let's say that you were using rotatiion (only one value) and you wanted to rotate between -45º and 45º but have the rotation value at 0º when the value of Output 1 was below 20. Your expression would only need two lines because no array would be needed. It would look like this:

                   

                  newScale = thisComp.layer("LikeParticles").effect("Sound Keys")("Output 1");

                  expScale = ease(newScale, 20, 40, -45, 45);

                   

                  Now a value of 20 would give you -45º, a value of 30 would give you 0º, and a value of 40 would give you an angle of 45º