Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions A slider for the balance of a Graphic Equaliser

  • A slider for the balance of a Graphic Equaliser

    Posted by Alex Dinnin on April 12, 2012 at 11:29 am

    Hey All.. Thanks for reading..

    I have downloaded Harry Franks 3D Audio Spectrum.

    It basically applies Soundkeys to a load of solids to make them look like a graphics equaliser.

    I need to create a slider.. that when it has a value of 0 all the solids are scaling up and down as normal.

    however.. when the slider is at -100 the solids on the left increase in scale and the solids on the right decrease in scale.. never going below 0.. but pretty close..

    and like wise when the slider is at +100 the solids on the right increase and the left decrease..

    Any help would be greatly appreciated..

    I’ve cobbled something together below.. but it’s not quite right

    a= thisComp.layer(“Sound Keys 7 – 9”).effect(“Sound Keys”)(“Output 3”)+1;
    eq= a+thisComp.layer(“Controls”).effect(“Slider Control”)(“Slider”);
    if (eq>=100) eq= !value + 10;
    if (eq<=0) eq= !value + 5; [100, eq] regards Alex

    Dan Ebberts replied 14 years, 3 months ago 2 Members · 3 Replies
  • 3 Replies
  • Dan Ebberts

    April 12, 2012 at 3:16 pm

    I would think the expression will need to know how many bars there are total and where this bar is in the spectrum. You can probably calculate that based on layer indexes. I haven’t tested this at all, but a simple linear relationship (where having the slider at -100 doubles the left-most bar and sends the right-most bar to zero) would look like this:

    tot = 25; // total number of bars
    me = index – 1; // which bar I am
    s = thisComp.layer(“Controls”).effect(“Slider Control”)(“Slider”);
    m = linear(s,-100,100,-1,1); // slope
    b = linear(s,-100,100,2,0); // offset
    x = (me/tot)*2;
    y = m*x + b; // formula for straight line
    [value[0],value[1]*y]

    Dan

  • Alex Dinnin

    April 12, 2012 at 3:20 pm

    Hi Dan,

    Thanks for the reply..

    This kinda works… but we are not taking the animation already there from sound keys into account..

    thisComp.layer(“Sound Keys 7 – 9”).effect(“Sound Keys”)(“Output 2”)+1

    thanks again
    Alex

  • Dan Ebberts

    April 12, 2012 at 3:27 pm

    Good point. Variable y will have a value between 0 and 2, depending on the slider and where that bar is in the spectrum. You could multiply your Sound Keys value by that.

    dan

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