Jump to content

Map the audio spectrum onto a geometry


ch3

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

Link to comment
Share on other sites

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

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.

Link to comment
Share on other sites

  • 3 years later...
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).

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...