Jump to content

Chops questions


Recommended Posts

Hi. I'm fairly new to houdini chops and was wondering if someone could answer a few questions for me as I'm struggling at the moment. I'm trying to develop a system where a user can specify an audio file (.wav) and then it will be parsed in Chops and be used to drive some animation. I've managed to get it to work for one sound file but now I'm trying to get it to work for other sound files aswell using the same system. I've worked out what I need to do is scale the other sound files to be the same size as the original sound file (so there min and max values are the same as the first sound files) and then it should work. What I need to know is:

a ) Is it possible to find out the max and min values that a sound file ranges from with chops?

b ) Is there a way to make the limit chop scale my file input instead of clamping it which just cuts off the files peaks? (I would like to be able to specify a max and min value and have chops scale my file input to fit between these values.)

c ) Is it possible to find out how long a sound file is and set the scenes end frame to coincide with the end of the sound file?

Thanks in advance

Tony

Edited by tony
Link to comment
Share on other sites

a ) Is it possible to find out the max and min values that a sound file ranges from with chops?

Append a Channel CHOP to the CHOP that you want to measure the min and max values.

Create two new channels called min and mix.

For the min expression use: icmin(0, 0)

For the max expression use: icmax(0, 0)

Now you have two channels that represent the min and max values. You can reference these directly with other CHOPs or use the chop() expression.

b ) Is there a way to make the limit chop scale my file input instead of clamping it which just cuts off the files peaks? (I would like to be able to specify a max and min value and have chops scale my file input to fit between these values.)

Use a Math CHOP. If you know the starting min and max and the final min and max values, it is a simple matter to use the Math CHOP's Range Folder parms to scale your channels.

c ) Is it possible to find out how long a sound file is and set the scenes end frame to coincide with the end of the sound file?

Usually if you wire things up correctly and not force feed a fixed end length, the length of the first File CHOP will set the length of all subsequent channels.

If you need to know the length of a channel, you can use chop expressions similar to your first question. Try in a Channel CHOP wired to your chop node: icl(0) / icr(0)

where icr() returns the sample rate of the input indexed channel and icl() returns the length of the channel in samples.

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...