1 Reply Latest reply on Aug 3, 2008 11:37 PM by Mylenium

    Expression with Audio Amp and the Puppet tool


      I was wondering if anyone could give me a hand trying to figure out if an expression would work to accomplish the animation I am after.

      I have a music file converted to Key frames based on its amplitude. I have another layer with the puppet tool mesh on it. What I am after is having the character dance to the music. I was curious if I could set up an expression so allow it to detect if the amplitude is greater than a value and move the deform position to a specific value (example: When the amplitude is greater than 15 [Drumbeat] the foot will touch the ground).

      I was worried if I did this the Dance would be jerky as I have this in mind for one of the feet:

      effect("Puppet").arap.mesh("Mesh 1").deform("Right").position=
      if (Other Layers amplitude > 15){
      position(5,5); (**position at ground**)
      }else if (Other Layers amplitude > 15){
      position(10,10); (**position at knee**)

      I know this formula currently will not work. But could a formula written do this type of movement in line with the music? Would the movements between the key frames be smooth or would the movement be jerky from one spot to the other without interpolation ?

      If anyone could point me towards some information or knowledge regarding expressions and making objects "dance" I would be very much appreciative. Thanks.
        • 1. Re: Expression with Audio Amp and the Puppet tool
          Mylenium Most Valuable Participant
          Conditional statements are always "jerky" - it's the nature of the beast. A branching state can only have an x number of fixed values, but none inbetween. You'd have to create different code that measures the actual temporal distance from a trigger keyframe and modulates the interpolation, contained in a loop. Depending on the density of the cues, you'd also have to define additional behaviors for how a new beat mixes/ overrides a previous one, how to smooth out ambiguous areas inbetween, flatten inactive areas and a few other things. This can become quite complex. Therefore a better solution may be to rely on available scripts (e.g. nabscript's audio amplitude scripts) or plugins such as Trapcode's Soundkeys that provide a more direct way of dealing with audio-generated data.