6 Replies Latest reply on Jun 24, 2016 2:26 PM by A_omry

    How to make photos jump up and down to the beat of a song?

    A_omry Level 1

      Hi.

      I have a bunch of photos — head shots.

      I want to place them on the timeline on after the other, so for example, if I have 20 head shots, I'll essentially have 20 clips on my timeline.

      Also on the timeline will be an audio track with a song.

      I want to animate each of the head shots, so that they slightly bounce up and down in the frame to the rhythm of the song.

      Ultimately I should end up with a sequence of heads jumping up and down to beat as the song plays.

      Is there any quick way to do this?

      I have close to zero experience using After Effects. I catch on quick and research manuals or tutorials when I run into something I don't understand. So far I've been able to achieve this by setting up markers to the beat and then placing key frames accordingly. It works, but I'm doing this individually and manually for each key frame and for every clip.

      I have a feeling there's a way to do this so much faster that I'm just not aware of. Maybe some sort of expression to do this?

      Any help here will be greatly appreciated.

      Thanks!

        • 2. Re: How to make photos jump up and down to the beat of a song?
          A_omry Level 1

          Hi Mylenium,

          Thanks for your reply!

          Your suggestion may be overkill for what I need

          I'm looking for a very simple uniform and consistent up and down bouncing movement to the beat of a song. It should be really simple. My aim is for a somewhat "robotic feel" to the movement rather than dynamic movement that might change depending on the amplitude of the audio.

          Just simple up and down with a bit of ease-in and ease-out at the "up" position, to better simulate jumping motion. Something like that.

          • 3. Re: How to make photos jump up and down to the beat of a song?
            DonaldDoss Level 1

            Add this to your position for each head. Change the framesPerBeat to match your music, and amp to match how much movement you want.

             

            posx=transform.position[0];

            posy=transform.position[1];

             

            framesPerBeat=15;

            amp=160;

             

            curframe=timeToFrames(t = time + thisComp.displayStartTime, fps = 1.0 / thisComp.frameDuration, isDuration = false);

            cyc=(curframe%framesPerBeat)+1;

            cyc2=Math.abs((framesPerBeat/2)-cyc)

            bob=easeOut(cyc2, 1, 30, 0, amp);

             

            [posx,posy-bob]

            • 4. Re: How to make photos jump up and down to the beat of a song?
              DonaldDoss Level 1

              Since you are making a crowd of heads dance, I would assume that you want to offset them a bit to look more natural.

              I added random offset to the time and amplitude.

               

              posx=transform.position[0];

              posy=transform.position[1];

               

              framesPerBeat=15;

              amp=60;

              seedRandom(3, timeless = true);

              offsetTime=random(2),

              offsetAmp=random(amp/3);

              curframe=timeToFrames(t = time + thisComp.displayStartTime, fps = 1.0 / thisComp.frameDuration, isDuration = false)+offsetTime;

               

              cyc=(curframe%framesPerBeat);

              cyc2=Math.abs((framesPerBeat/2)-cyc)

              bob=ease(cyc2, 0, 29, 0, amp+offsetAmp);

               

              [posx,posy-bob]

              • 5. Re: How to make photos jump up and down to the beat of a song?
                Rick Gerard Adobe Community Professional & MVP
                1. Select your audio layer
                2. Press the L key twice to reveal the waveform and check to see if you can see the beat
                  waveform.png
                3. If you have a strong indication of the beat then open the keyframe assistant from the Animation Menu or by right clicking and select convert audio to keyframes
                  Audio to keyframes.png
                4. Select the newly created Audio Amplitude layer and press the U key to reveal the keyframes and select the tor Channels slider then open the graph editor and make sure you are editing the value graph
                5. Examine the high and low points of the graph and make note of the values
                  graph.png
                6. Add your image layer to the composition if it is not already there and press the P key to reveal the position property
                7. Move the image layer to it's starting or resting position
                8. Hold down the Alt/Option key to add an expression to the position property and enter type in these letters t = then select the Expression Pickwhip and drag to the Both Channels slider, release and add ; then return to the first line of the expression.
                  Pickwhip.png
                9. Type y = then from the Expression Language Menu just to the right of the pickwhip button select the expression method: ease(t, tmin, tmax, value1, value2)  from the Interpolation section (now you know why the first variable was "t")
                10. Change tmin to the lowest average value you noted when examining the graph for Both Channels
                11. Change tmax to the highest average value you noted when examining the graph for Both Channels
                12. Set the value 1 to zero and value2 to the maximum number of pixels you want to have the image layer move, then add a semicolon to the end of the line
                13. Finnish the expression by setting up an array that will take the current value of x and subtract new y value from the current value of y to move the layer up to the beat like this [value[0], value[1] - y]
                14. Select any other layer or property to close your expressio

                You should have no errors and the final expression should look like this:

                t =thisComp.layer("Audio Amplitude").effect("Both Channels")("Slider");

                y = ease(t, 3, 20, 0, 400);

                [value[0], value[1] - y]

                Finished Comp.png

                So there you go. The whole process should take you about 4 or 5 minutes. Make adjustments to the values in the ease method as required. If needed you can add some smoothing to the expression but this gets complicated very quickly.

                 

                If you have no idea what I am talking about in any of the steps try using the search help field at the top right corner of AE and search for things like graph editor or keyframe assistant.

                 

                An alternate method would be to set markers on the beat in Audition or by hand in AE, then use an expression that looked at even or odd marker numbers and used the same ease or even a linear method to change the value of y.

                • 6. Re: How to make photos jump up and down to the beat of a song?
                  A_omry Level 1

                  Thanks guys!

                  Will try these suggestions out and see if I get the results I'm looking for.

                  @Donald, it's actually not a bunch of heads bouncing up and down together, but rather in sequence. So head A would be bouncing up and down and then we cut to head B bouncing up and down, then head C and so on.

                  I'll post back with an update. Thanks again : )