1 Reply Latest reply on Jul 13, 2017 9:16 AM by Mylenium

    how can I make expresion work vice versa ?

    zrils I designs



      Been making a music visualizer that includes some speed up expresions. Basicly in one main comp I have 2 pre-comps of visualizer [inside and outside] The outter one is basicly a stroke and audio spectrum, spining in a circle around the logo, and it speeds up every time theres bass [Im using sound keys to check where the bass is]5.png

      [expresion I use]

      spd = thisComp.layer("SoundKeys").effect("Sound Keys")("Output 1")

      mult = .5;

      n = spd.numKeys;

      if (n > 0 && spd.key(1).time < time){

        accum = spd.key(1).value*(spd.key(1).time - inPoint);

        for (i = 2; i <= n; i++){

          if (spd.key(i).time > time) break;

          k1 = spd.key(i-1);

          k2 = spd.key(i);

          accum += (k1.value + k2.value)*(k2.time - k1.time)/2;


        accum += (spd.value + spd.key(i-1).value)*(time - spd.key(i-1).time)/1;


        accum = spd.value*(time - inPoint);


      value + accum*mult


      ------------------------------------------------------------------------------------------ -----------------------------------------------------
      Inside the "Stroke" pre-comp I have stroke and audio visualizer [2collor] keyframed to rotate in place for 10 [its not a loop, its keyframed to rotate like 180 times]6.png

      The problem Im getting is, that in my main comp, when it speeds up and speed downs, the spectrum gets out of sync because it speeds up not only the spining but the spectrum aswell.
        Is there a way for me to effect only spining, but not whole comp ? Maybe I can pre-comp visualizer and aply the same expresion just to slower the video not to speed it up ? [Im not the best with expresions, tried to change numbers in it to negative din't really worked] Or maybe I can apply the expresion not only to time remaping but to rotation aswell ?


      Any suggestions or ideas are apreciated ! 

        • 1. Re: how can I make expresion work vice versa ?
          Mylenium Most Valuable Participant

          Nothing stops you from using the result from one expression as a multiplier on the other, but of course using time-remapping won't work. You can not muddle up things. Either you use the expressions on the native properties or on time-remapping, but not both. You have to make your mind up about it and think it through rather than just grabbing expressions from the web whose inner workings you don't understand.