Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions counting bars and notes with expressions from a known bpm

  • counting bars and notes with expressions from a known bpm

    Posted by Sam Pauwels on January 19, 2020 at 2:10 pm

    Hi there,

    I’m looking for an expression that counts up on every beat or bar or note from a known bpm. So I can just put in the bpm, and my text layer spits out 1,2,3,4,… on every sort of measure I would like.
    Exactly like in this video: https://www.youtube.com/watch?v=24Xbl4oUB5U

    thank you and cheerz
    sam

    Sam Pauwels

    Some contents or functionalities here are not available due to your cookie preferences!

    This happens because the functionality/content marked as “Google Youtube” uses cookies that you choosed to keep disabled. In order to view this content or use this functionality, please enable cookies: click here to open your cookie preferences.

    Alex Printz replied 6 years, 3 months ago 3 Members · 2 Replies
  • 2 Replies
  • Tomas Bumbulevičius

    January 20, 2020 at 8:12 am

    Hey Sam, what might be the possibilities, that this execution uses external data, with all notions of params?

    Find out more:
    After Effects Tutorials: motion design, expressions, scripting.
    Boxer – Dynamic Text Boxes Template with a Live Preview

  • Alex Printz

    January 20, 2020 at 2:41 pm

    place this onto a null property that you want to animate (I usually use it to generate a Tone); you will need two sliders, one for the beats per minute, and one for the number of beats in a measure.

    Note that if your framerate doesn’t work well with the BPM you’ve chosen, it might get messy and/or bleed between frames.

    There are 3 outputs possible; Z (off), Y (minor beat), and X (major beat); set them to whatever you want and/or manipulate the code.

    s = effect("BPM Slider")(1);
    m = effect("Number of beats per measure")(1);

    X = value;
    Y = value/5;
    Z = 0;

    b = 60/s; //convert to seconds
    d = thisComp.frameDuration;
    t = time-inPoint; //current time

    e = (d+(s/2000)); //slop for error

    function p(x){ //previous frame value
    return thisProperty.valueAtTime(Math.ceil(time-framesToTime(x))) };

    if( (t/b) %1 <e && p(1) != 0) //if current frame for beat
    ((t/(b*m)) %1 <e && p(1/s) != 0) ? X : Y; //if major or minor beat
    else Z; //else off

    Alex Printz
    Mograph Designer

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy