Blender 3D Audio Visualizer Tutorial | Polygon Runway

Creative 3D objects
9 followers
#gjwarts #drawing #art #digitalart #3dmax #sketch #interior #creative3D #howtodraw #3ddraw #3Dobject
Hey everyone, welcome to my new tutorial.
Today we are going to create this cool audio visualizer animation,
and I really hope you will enjoy this one.
And if you do, don't forget to leave that like,
and if you're new around here, hit that subscribe.
Let's now jump right into Empty Blender file,
and the default cube gets to shine again because we are gonna use it,
so just delete the light here, press X and delete.
And now select the cube,
because what I like to do with these audio files,
I like to do like an indirect method,
where I animate one of the objects,
and then use its values throughout the scene.
So let's expand the timeline here a little bit,
and then let's expand one more window right there,
and let's switch this to video sequencer.
And right here we are going to need the graph editor.
You can just hover here and hit CTRL tab,
and you will switch to graph editor.
Now let's press N for the side panel in the viewport,
and in the item menu, let's insert the Z location for the cube.
So right click and insert single keyframe on frame one here,
and that's all we need there.
And now basically you just need to pick the audio file
and bake the sound wave into the graph.
So here in the 4.2, you go into channel and choose sound to samples,
and just choose your audio file here.
It can be whatever audio file you would like to have.
I unfortunately cannot pack this because it's a licensed,
but you can go ahead and search for royalty-free soundtracks or anything,
and use something like that.
So immediately you can see the sound is baked here into the graph,
and we can just play it back,
and the cube will animate based on the audio file.
But the audio file is not playing here,
so you would need to insert that into the channel right there.
So I will just drag the same track right there into the channel one,
and then move it to frame one.
So now this is synchronized,
and we can now basically just collapse this,
and move the cube out of the way.
So I will scale it down a little bit,
press G, then Y, and move it to the side here.
It will still jump up and down here.
And now if you want to have this as a looping animation, for example,
you might want to find the part you want to loop.
The thing you can do is to cut the sound file beforehand,
but it's quite destructive.
So what I like to do is to just set the first and the last frame of the animation,
depending on the loop I have.
So let me hit CTRL tab here in the graph editor,
and I located a nice loop starting at frame 1200 and ending at 1523.
If you feel like this is too fast for you,
or you don't understand some core concepts,
make sure to check out my courses.
I carefully designed them to take you from beginner skills
through low poly illustration,
all the way to full character illustration,
textured environments, and much more.
And I build the courses as creative projects,
each with its own style.
And every time there's a new technique or something needs explaining,
we stop for a while and you get an in-depth explanation.
But in the end, you still get a full project result.
So if you're interested, please check out the link in the description.
So now if I zoom this out, you can see the active timeline.
It's right there.
And that's what I'm going to use.
But you can easily just switch this, you know,
move your start and end frame to locate the part of the sound you want to be playing.
And that's much easier than to, you know, bake the sound all over again.
And the reason I have it baked on the cube is that I can now just add any object.
So first of all, let's go Edit, Preferences.
And here in New Blender, you get the add-on still.
And if you first launch it,
you should have an option to install these as extensions,
because that's like the new system.
There is now unified storage for all the add-ons,
community add-ons, default add-ons that come with Blender.
And these are called extensions.
And you can just locate them and install right here.
So right now, just locate the Extra Mesh Objects extension and click Install.
If you don't have it installed yet, you can search for extensions right here.
And then you will see it active in the add-on section right there.
And then just close the preferences.
And now you can press Shift-A, add mesh.
And from the Extra Objects, you can pick the round cube.
And right here, we are going to increase the radius and divisions to something like 10.
So we have a sphere made out of quads.
And now we'll press Ctrl-2 to add Subdivision Surface Modifier.
You can see it right here in the modifiers.
Or you can just go ahead and add it, you know,
through the menu and set the levels of viewport to 2.
And now right-click Shade Smooth.
And here, I'm just going to add Simple Displace Modifier.
So let's add modifier, the form, and displace.
And we are going to create a new texture there.
Let's go to the texture settings.
And for this one, I use the wood texture.
But I changed the bands to Band Noise.
And reduce the turbulence all the way to 0 for now.
And now the advantage of having the sound wave baked on another object,
I can just use the value of this object wherever I want.
Whether it's as a driver in these, you know, modifier settings,
or you can use it in geometry nodes or what have you.
So right here, I will use it as a driver.
So let me expand this part a little bit.
And right here, let's go back to the modifiers.
And in the Displace Modifier,
let's just right-click the string and choose Add Driver.
And we can click away.
You can see this turning violet.
And that means there's a driver there now.
So right here, you can switch this to Drivers.
And right here, you have the driver curve.
And if you select the driver and choose Drivers here,
if you don't have this option right there,
just press N to expand the side panel.
You will see the same settings as you would
when you right-click here and choose Edit Driver here in the pop-up menu.
So let me zoom in a little bit here.
Because the curve is really important.
You can see it goes from 0, 0 to 1, 1.
So that's basically like a value mapping for this.
So right now, this will be linear.
And I will get back to this later.
But let's set up the driver right there.
In the driver, if you keep the type as a scripted expression,
you have the expression right there.
And then you have these input variables.
And you can see the default is right there.
It's called Var.
And it's used in the expression.
You can call this whatever you want.
So for example, in this case, we can call this Wave.
And we can switch this to Wave.
You will see it will start working again.
So here, you create the variables.
And here in the expression, you use them.
And the wave gets populated by whatever you configure here.
So here, I want to use the cube object.
And I want to use its Z location for this variable.
So right now, if I play this back,
you will see this value is animating based on the bouncing of the cube.
So that's the gist of drivers.
And you can remove whatever you have in the expressions.
You can just directly use the Wave value.
And then you can start playing with the curve.
So right here, you can see the actual values with the dashed lines.
You can see how it bounces up and down on that expression, on that curve.
And you can change the curve right here from value from 0 to 1.
And change its behavior a little bit.
You will see it will still bounce on the curve.
But now, since I changed the curve, the extremes are a little bit more subtle, you know.
So for this case, I would keep it like this.
And then if I want to, you know, make it even more subtle,
I can, you know, subtract from that expression.
So I can use something like minus 0.8 or something.
And now you can see the range is a little bit different.
And I can do even more.
I can do like 0.9.
And then you can multiply the whole thing by, for example, 1.2.
So you can really play with the numbers here and get the desired behavior.
You know, convert the original value of the cube jumping up and down
to whatever values you want to see here in the displacement strength.
And then you can still go to the texture settings and play with the values like turbulence.
So you can make it more funky.
And then, you know, play with the size so the mapping is not so aggressive.
We can maybe increase the levels of the subdivision surface, maybe even more.
But be careful about the FPS.
It can start going down.
And one important thing to mention, I left this at 25 FPS.
If you, for example, want 30 FPS, you need to bake your sound again,
obviously, because the timing would be a little bit different.
So if you want to change FPS here, just go ahead and bake the sound again.
And it will just work out of the box.
And then, of course, adjust the frame range for the animation,
because that will be a little bit different.
So basically, that's all I used for this type of audio visual.
Now you can play with the details, like, for example, in the texture,
you might want to play with the size or the turbulence of this,
but you don't necessarily need to map this to driver.
So we can just switch this to, you know, timeline, go to start of the animation.
And for example, do, like, turbulence of one and insert keyframe here.
Then in the timeline, press Shift D to duplicate it on the other side.
And then here in the middle, we can, you know, increase this a little bit.
So it looks a little bit more interesting.
Right click and insert single keyframe.
And now the animation will kind of animate through the texture noise.
But the scale or the strength of the displacement
will be still mapped to the sound level you have right there.
And then what I did for the animation, I just created the background.
So let me just do that real quick here.
Tab into the edit mode, press S to scale it up.
Right click, choose subdivide and press Shift R several times to get more dense mesh.
Tab out, press G and Z and move it down.
And then basically just going to the modifiers,
add that subdivision surface modifier again and another displacement.
And here I used something like cloud texture with a large size.
Right click, shade smooth.
Or maybe you can go for something like a distorted noise.
That looks quite cool.
And then I used the trick for looping animation where I use the empty.
So let's press Shift A, add an empty.
Let's press Shift D and press Y to move it to the side a little bit.
And then hold Ctrl, click it in the outliner,
press Ctrl P in the viewport and choose to parent.
And now click the original one again.
And in the frame one or, you know, whatever frame your animation starts,
just right click the X rotation and insert single keyframe.
Move to the end of the animation and let's change this to 360.
Right click and insert single keyframe.
So the main empty will rotate and take this that's on the side with it.
Just make sure in the timeline with all the keyframes selected,
press T and choose linear interpolation.
So it starts at speed and doesn't accelerate.
And now we'll use this empty to map this texture.
So let's go to the modifiers panel and for the coordinates,
we'll use object and just pick this empty right here.
You can see now this is animating.
You can, of course, map this to the cube movement
through some driver expression or, you know, geometry nodes.
And now I can just select this empty right here
and scale it up and down to adjust the waves.
And now let's look from the camera.
And I think this will need to be a little bit larger here.
And yeah, basically, that's it. That's all I used.
Now for the material, let's select the object
and let's switch this to shader editor.
Press control B to limit the preview only to camera bounds.
And let's go to render settings, switch to cycles,
enable GPU and the noising right here.
And something like 128 samples should be fine.
And now let's press shift A and let's add a light,
aerial light, press G and Z, move it up a little bit.
And let's make it a little bit larger.
And let's increase to something like 500
and press Z and preview the rendered animation.
So this is what we have here.
And now I'll select the object, create a new material.
And I really like the combination of, you know,
grayscale and strong orange saturated color.
So that's what I went here for
and reduce the roughness all the way to zero.
This can be a little bit brighter here,
but I wanted to give this, you know,
a little bit of a special effect.
So let's press shift A and choose Fresnel.
And now if you have the Node Wrangler active,
so again, you can go to edit, preferences, extensions
if you don't have it and search for Wrangler,
but I already have it installed here in the add-ons.
So you can see right here.
So just get the Node Wrangler.
And now if you hold control and shift and click the Fresnel,
you will see the preview and we can reduce the IOR.
You will see, it will create these like nice edge masks,
depending on where your camera is.
So you can now press shift A, use color mix.
So let's search for color, mix color
and plug the Fresnel into factor
and then press control C hovering over the color here,
paste it right there and change this to white
and connect to color and hold control shift
and click on the principle shader back again.
And of course you can press shift A, add RAM
and make this transition on the Fresnel more sharp.
You can even invert it if you want.
So yeah, basically that's what I use there.
And then you can, of course, duplicate this light.
First of all, maybe make it a little bit stronger here
and then press shift D and move it somewhere back.
Press R then X, change the rotation
so it falls a little bit more shallow on the waves there
and increase the power to something really strong.
And then, you know, in the render settings,
you can go ahead and in the color management,
play with the contrast settings
and with the exposure right there
and you should have your animation working.
And then of course, in the output settings,
you can go ahead, switch to ffmpeg,
encoding, switch to mp4 for example
and don't forget to include the audio with some codec
if you have the track, you know, in the sequencer
and then just choose your folder here,
hit render and render animation.
So yeah, that's it from me today.
You know, just go ahead and get creative.
There are multiple ways how to use the value
in form of drivers.
You can add multiple objects.
You can map this to their rotation, to their scale,
use modifiers, map it to whatever value
you want to have animated
and I would love to see what you create.
So, you know, if you create something really interesting,
tag me on the Instagram with Polygon Runway handle
so I can have a look or, you know,
share it with us on our Discord.
You can find the links to Discord
in the YouTube channel description.
So yeah, that's the audio visual animation from me today.
I really hope you enjoyed this one
and again, if you did, please leave a like
and if you're new around here, hit that subscribe.
Thank you all for watching and have a wonderful day.
