Jump to content
ch3

Map the audio spectrum onto a geometry

Recommended Posts

hi,

 

I wanted to create something like an audio analyzer with geometry, where the low frequencies pull one side of a plane and the high the other one. I managed to put something together, but since I am new to houdini, I was wondering if there is a cleaner/better way to do this.

 

I used the pitch CHOP node to create a bunch of different channels. These are then accessed by a point SOP to deform a plane. The problem is that the resolution of the deformation is determined by the 'pitch divisions' and the amount of channels created, which creates a stepped look. I wrote a function to interpolate between the two closest channels, but this just smooths the steps, rather then adding more detail.

 

Is there a different way to get the audio spectrum and use it to offset the surface?

 

thanks

georgios

 

 

If you download the file, just plug an audio file into the 'sample' CHOP node and make sure you have the function defined.

getFreq( string path, float f, float n )
{
    chN = chopn(path);
    float newF = f* chN;
    

    if( floor(newF) == ceil(newF) )
        return chop( path+newF );
    else
    {
        f = floor(newF);
        c = ceil(newF);
        t = newF % 1;

        value = chop(path+f)*(1-t) + chop(path+c)*t;
        value = value + rand(newF*100+$T)* value *n;
        return( value );
    }
}

audioAnalyze.hipnc

Share this post


Link to post
Share on other sites

yeah, I had a go with the spectrum node, but didn't figure out how to use the data coming out of it

Share this post


Link to post
Share on other sites
On 23/02/2014 at 12:09 PM, edward said:

From https://www.derivative.ca/wiki088/index.php?title=Spectrum_CHOP, it says for the Spectrum CHOP

Quote
To determine the frequency that a given sample represents, use the formula:
Freq = 2 x (sample#) x (Sample Rate) / (Channel Length)

Where 'Sample Rate' and 'Channel Length' both refer to the Spectrum CHOP's rate and length.

Please correct me if I'm wrong but "Sample Rate" and "Channel Length" are "Samples/Sec" and "Length Samples" respectively (as seen when middle mousing the spectrum node) right?

Also, any suggestions how we would use this to map the magnitude of the frequency onto geometry? 'chopci' expression and a point attribute? (I'm a complete CHOPS noob, so I'm struggling with this a fair bit).

Share this post


Link to post
Share on other sites

This the sort of thing you're after? Just me fumbling around with chops nodes until it sorta looked interesting. :)

The zip is a hip and .wav, the sound is a filter sweep from low to high to low again.

spectrum.zip

chops_spectrum_sweep.gif.68000f49f19a22c3b66bce8da52ecd55.gif

  • Like 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×