Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Getting height of different bands in Audio spectrum effect.

  • Getting height of different bands in Audio spectrum effect.

    Posted by Jeff Murchison on February 7, 2009 at 11:39 pm

    I’m wondering if this is possible. I have the audio spectrum effect applied to a solid, and I’ve set it to 8 bands. So currently, it’s just 8 little lines bobbing up and down. I want to be able to replace these with solids, so I’m wondering if it’s possible to get the current height of individual bands using expressions.

    Pretty much what I’m trying to do is recreate an audio waveform with solids, and each one represents a range of frequencies;

    eg, first one would be 0-250
    second would be 251-500
    etc etc

    Filip Vandueren replied 17 years, 3 months ago 2 Members · 1 Reply
  • 1 Reply
  • Filip Vandueren

    February 8, 2009 at 7:02 am

    Hi Jeff,

    SoundKeys by trapcode makes tsuff like this easy, but it’s not really necessary.
    It takes some planning but here’s how to do it using expressions only:

    apply the Audio Spectrum to a Black solid.
    use these settings:
    – Audio Layer, of course.
    – Start Point: 1/16th of the width of the solid.
    – End Point: 15/16th of the width of the solid.
    – Freq Bands 8; obviously.
    – Inside Color: White
    – Thickness: 1/8th of the width of the solid.
    – Composite on Original: yes

    Set the Layer Quality Switch to Draft.

    You should now see White square columns instead of “Pink Rounded Pills”

    Tweak these to suit your audio and visual need:
    – I used 250 for Audio Duration
    – and usually quite a high number for maximum height: 13000

    Some white columns should fill the entire height of the screen at times.

    Now add a mosaic Effect:
    – Horizontal Blocks: 8
    – Vertical Blocks: 1
    – Sharp Colors: no

    Now you should see 8 columns of varying Greyscale according to the amplitude of that frequency.
    You can use sampleImage() on this layer to get a value that scales or moves or rotates your 8 solids.

    Actually you can use sampleImage’s radius to do the averaging for you so the mosaic-effect is optional, but it makes it more visual + you could use levels or curves on the grayscale to affect the curve of the results, or to clip values etc. just like soundkeys.

    Let us know if you need help with the sampleImage() part of it, there are some tutorials on it here at the cow. And the manual’s pretty clear.

    good luck.

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