[Houdini Tutorial] 0029 Spectrum Visualizer (Slow version)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] hello in this video I would like to visualize the audio spectrum that I tried recently using Houdini it might not be really a Houdini job to do that kind of thing but it sounds pretty interesting doing it so I would like to show how I did it okay so first of all let's make a geometry as always going here and I would like to make a sphere as a base object to make make it as a visualizer to visualize a spectrum audio spectrum now let's show the edges with the polygon and maybe I could increase the frequency so that I have enough triangles to use this as an ax spectrum bars I would like to extrude each triangles to the normal direction and if I look at it i right now have 500 primitives that might be enough to test out so let's do with this one okay so first of all right here I'm gonna use a audio file so not this one I need to create a chopped Network so let's go inside the chopped and first thing I have to do is to import the audio file now I have downloaded this music from the L sounds website which provides royalty-free music this one gel house loop it could be any music files with the web format so I'm gonna download this I'm gonna use this as an example in order to visualize a spectrum so in a file component let's load the file jailhouse loop dot wave and then let's visualize this waveform that looked like this now right now this is just a waveform of this sound but what I would like to use this time for visualizing as a spectrum so let's bring up spectrum connect it and let's visualize it it's horizontal adapt and vertical adapt and I am seeing something here okay let's make this to zero and one yeah and I am having something here okay so this is the spectrum of this Odile and as you can see I have I'm having right now a two channels channel 0 and channel 1 must be left sound and the right sound in order to visualize I would like to make it as a 1 channel so I'm gonna delete one of the channel so right here I'm gonna choose channel 0 to delete now I have only channel 1 which could be a right side channel okay let's zoom up a little okay so it's the spectrum being mapped between 0 to 1 so it's like 24 frames as you can see the only way that you can see is in between 1 to something like 1.5 so rest of the channels I mean samples I don't really need those I just need those wave and there's one more problem as I move the frame the spectrum is moving along with the frame which I don't really want because I want to use those constant frames areas in order to apply to the channel I applied to the attributes now on the geometry so first thing let's use the shift to not move this audio file even if I move the frames okay so connect the spectrum to the shift and let's choose an absolute zero zero which will make the position of the spectrum to be stated on the zero position always okay that's good and now let's trim this out to just use around here and don't export the channel around here so I'm gonna use like trim component and this is the end but I can control the sliders to move this end value to the left side and somewhere around 0.95 or 0.98 yeah point I ate sounds good okay - 0.98 now now I I have trimmed the spectrum let's look at the information and right now I have like 882 samples but I only have like 500 primitives so I would like to resample this spectrum to fit around a little bit more than like 500 for this one okay so I can use the resample and let's see so I could go like 25,000 I guess 25,000 and that's around yes 500 oh that's was exact okay and would like to export it so I clicked here and for now I think that's all I need to do in the chopped Network knife I've lightest like this now I might need to see the here the real audio as well so let's click the speaker icon here scrub file select the same audio okay and let's try playing now I also need to click the real time icon here okay then let's play [Music] okay I do notice a little bit of lag between the audio and the waves so I might need to shift the spectrum a little bit to match the match with the audio [Music] [Music] spectrum seems a little bit slow so let's give a shift and place it around here and let's say the start becomes a minus one let's play maybe not maybe plus-one [Music] [Music] Plus - no - two I guess [Music] more [Music] okay I tested some values here and seems like minus three looks like a good number so I'll go with this shift number okay so I think I'm ready to export this wait a minute so I have trim in this okay I have to make this zero [Music] okay I think it's good well I could always go back to do some coordinates but right now it seems good so I'm gonna go with this value on a resample which has 500 samples I mean 501 but it's okay now the things that I want to do is to bring those channel value to each point or each primitives of this spheres so that I can use that value to extrude each triangles now so first of all what I'm gonna do is to guess I would since the I think the chopped channels can be only transferred to the point attributes so I gotta have to get the point out of these primitives the easiest thing I could think of is to use pack to pack each primitive first to get the center point of that primitive and in order to use the pack I think I need to name this first frame it to wrangle I'm gonna use primitive wrangle to name each sphere triangles with unique name I'm just gonna use a prin them because I think that's enough oops frame numb something is wrong okay I think I need to convert this into string right now let's look at the geometry spreadsheet and on the primitive yes I do have a name here and I'm gonna connect that to the puck and use the name attributes to pack each triangles now I'll be able to get the points on each triangles middle many centers it's good now this is where I'm gonna transfer the attributes the chopped channels to attributes point attributes to here I mean here now I'm gonna use a node called channel and connect that to the packed one and the chopped that I'm gonna refer to is a reason 'pl and the channel scope the name of the channel was Qian 1m okay so I'm gonna write Chan 1m and attribute scope I'm gonna name a distance and since I don't have a distance attributes in the point so I'm gonna create first the attribute called distance for the point okay float now if I look at the geometry spreadsheet I have now successfully transferred the dist which is a spectrum value from the audio if my blade is this one distance will change and that's good now at this point I don't really need to have the geometry to be packed since I wanna next thing I want to do is to extrude them so I'm gonna unpack and while doing the unpacking I want to transfer the attributes as well so that I can keep the distance attributes for each point yeah and probably before doing the unpacking I would like to transfer this this in a distance this attribute to the primitive since I'm gonna extrude each primitive by the same number so I'm gonna use attribute promote remote and from point to primitive I'm gonna transfer promote the distance attribute and if I look at the primitive yes I have this distance and if I look at impact one I still get this distance okay and it's good now here comes the programming part in order to extrude these triangles in a normal direction with the distance value all right there I think there could be a two ways to use do this one is to use the for each loop together with the extrude node but since that's it true that's iterating one by one in triangles one by one and that is a bit too slow since I think it's single threaded operations so what I'm gonna do is to use the Wrangell to create the extruded column for each triangles now I'm gonna use the primitive Rangel and okay so for each primitives I would like to get three points so gonna name that pts and that that comes from the primitives or prim points at random okay and for I'm gonna look through all the points and get that point okay and what I would like to do is to move that those point to the normal direction of that primitive face with the amount of distance which is stored in the attributes for the primitive so yeah I'm gonna make a new pts as an RA to store the moved point first of all it's gonna be empty and let's get the distance value from the dist attribute and also let's get the normal vector from the normal of the surface I mean the primitive mesh and let's get the point position for each point which is point 0 p @ PT ok now the new position which can be calculated from this position adding the normal times the distance will be the new position will be position plus normal times times distance okay and finally use that to add a new point you pass okay now I seem to have those points right now this is only a point right now I have to make some primitive out of this obviously now before doing that let's add those new points inside a new pts and first thing I would like to make is the top part top triangle so I'll name this top and call the add trim and there'll be polygon so I named it poly and the next parameters that I have to put for this function is the three points in order to make a triangle so that's stored inside a new pts so new pts 0 new pts 1 new pts - ok now I have those triangles now I want some side faces as well in order to make it as an extruded column so for that I have three faces size for each column so I'm gonna use the full loop and length of U ETS or pts whichever you want which will always be 3 because everything is triangulated and in side equal add cream and cereal poly and this time it's square so it there's gonna be four points now the first point movie you need pts 0i and second one pts i plus one but sometimes it if the I will be if I becomes 2 I plus 1 will be 3 which you cannot get from pts because pts only have 3 values so I have to get the remainders using the modular like this okay and you pts the same thing here and you pts I all right now I have those sighs now one thing I would like to correct or change a bit is that right now you see that though those long : sometimes there's too much long columns here being too exaggerated compared to the other one so I guess I would like to set the maximum distance for the extrusion and somehow smoothing out the overall extrusions so for that I can go to around here after getting the channel value here let's look at the distance yeah here I could do some kind of remapping and to this distance value so let's do that before doing that let's go back to the chop channel to see what the wave looks like and let's see the maximum value what could be the maximum value here now maximum could be around twenty or thirty most of the time it doesn't go above twenty so first of all I could fix the maximum to be twenty so whenever the value goes up above twenty just trim it to twenty Valley the valley twenty that I want to do now that I want to do that and for the other value like really low told columns about I'll use I might wanna remap it we're using some kind of ramp function so that everything goes a bit average or of a smooth Mountain not just not like this spiky mountains so let's do that so I what I wanted to make the maximum to twenty so what I can do is to go after the channel and use the point R angle I'm laying this remapping and first of all the distance I'm gonna make the distance to be okay let's get the distance with the value of oldest and first thing I would do is to set the minimum or a maximum know minimum minimum to 20 or distance so if the distance goes beyond 20 I will cut it clamped to 20 now and next thing I would do is to use the ramp to remap those curves so I'm gonna use day I'm gonna first get the ramp attribute ramp parameters ramp float I'm gonna name this round ramp any apply and okay in order to use the ramp I need to fit remap this value distance to 0 1 so I'm gonna do like this it's this 0 to 20 since I know that maximum is 20 to 0 1 okay now I'm gonna use a ramp CH ramp to the name of RAAM the value dist okay and finally this equal distance times 20 or I would like to make the maximum extrusion to be somewhere around 3 so I'm gonna set it to 3 okay now right now the curve is straight up but if I change to something like this year this one is busier and add another point and bring it right to the left I mean to the left now everything the mountains got a bit more smoother than last time less spiky than the straight one everything got more expressions more detailed expressions and looks good I think if I play it is yeah this is good it's good now this is about everything I wanted to do the last thing I would do is to maybe color those value call and color color those columns depending on the value of the height the extrusions so let's make the color value inside a primitive Wrangell and then just extrude and let's see the geometry spreadsheet there is a okay I think so there is a distance value in the primitive and nothing at the point I guess I could just use the distance primitive value to color now some of the distance value have zero and that is because I have added a new primitive inside a primitive Wrangell so I needed to add the distance attribute to that newly created at primitive as well so I'm gonna set em to rave she will name will be missed and the value to the top and the value could be since that the top I mean I could just use the same distance value from the current primitive okay now same for this one set frame drift zero just beside if this okay let's look at the geometry spreadsheet and there's still some 0 but less much less sometimes I guess those zero are the one that's not extruded so I guess it's fine now let's try to color this color and use the ramp from attribute just and I have to change this to primitive and yes it's working yes I think it's working now if I play this let's change this color of it yeah that's all about it that I wanted to do yes is it okay thank you
Info
Channel: Junichiro Horikawa
Views: 15,748
Rating: 4.9689121 out of 5
Keywords: houdini, tutorial, recipe, parametric, procedural, algorithmic, algorithmic design, design, 3d, howto, algorithm, vfx, mathematics, audio, spectrum, visualization, equalizer, chop
Id: Iv_tlbzYgN4
Channel Id: undefined
Length: 34min 4sec (2044 seconds)
Published: Mon Jun 04 2018
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.