Audio driven particle birth

   2658   5   1
User Avatar
Member
5 posts
Joined: July 2016
Offline
Hi!

How do I get the birth rate of particles to be derived by the amplitude or frequency of audio?


Thank you
User Avatar
Member
2538 posts
Joined: June 2008
Offline
You can fetch data from a CHOP network using the chop function.
chop("../music/AMPLITUDE_OUT/kick")

I put together a short video on how to leverage the amplitude from a sound wave to drive position along path but you may be able to modify it to drive particle birth rate.
https://vimeo.com/117402380 [vimeo.com]
Using Houdini Indie 20.0
Windows 11 64GB Ryzen 16 core.
nVidia 3050RTX 8BG RAM.
User Avatar
Staff
5161 posts
Joined: July 2005
Offline
There are a couple of CHOPs that process audio that can produce a channel for you: Pitch (freq) and Envelope (amp). You can then export these to the birth rate.
User Avatar
Member
5 posts
Joined: July 2016
Offline
I am unclear as to how to export the CHOP network data to particle birth rate or where to put the channel. Would that be in the ‘AutoDopNetwork > POP Source > sphere_source’ ?


Thanks for the responses!

Attachments:
Capture2.PNG (65.2 KB)

User Avatar
Member
2538 posts
Joined: June 2008
Offline
That is what the path inside the chop() function is for. The path specifies where the data is coming from (i.e. your chop network output). Where you paste the line of code indicates where the data is going to. Try pasting your chop() function in the Const. Birth Rate field.

To determine the path for your case, you have to have a CHOP network in your scene. When you start typing the word chop( and you get to the typing of the quote character ", Houdini will prompt you with a list of possible sources to form the bread-crumb trail to your data. Each time you type a new slash character / you will get a new list possible paths you can take at that time.

NOTE: The channel name will not automatically appear in a list, you have to know it and type it manually to complete the path. In my example path, the channel name happened to be kick. Houdini defaults to a name called chan0 for mono sources and a pair chan0, chan1 for a stereo image. So you can use the left channel of a song to control one parameter and the right channel to control another.

Typically audio will import in the range of -1 to 1. So I follow up a file import with a limit and envelope. This will change your audio amplitude range into the value of 0-1. Then you can just use a fit01 along with the chop() to remap the audio value into a usable range for whatever target field you like. (i.e. 0-360, 0-1000, etc…)

A thousand particles are emitted when the beat is loud, less as the amplitude drops off over time.
fit01(chop("../../chopnet1/file1/chan0"),0,1000)
Edited by Enivob - July 5, 2016 15:04:48

Attachments:
ap_CHOP_particle_birth.hiplc (252.8 KB)
Untitled-1.jpg (227.8 KB)

Using Houdini Indie 20.0
Windows 11 64GB Ryzen 16 core.
nVidia 3050RTX 8BG RAM.
User Avatar
Member
5 posts
Joined: July 2016
Offline
It works! I had written the CHOP function in the Const. Birth Rate field but was missing the chan1

I appreciate the explanation, very helpful! Thank you!
  • Quick Links