|
Spectrum analyzer in action. |
Build a live-response spectrum analyzer / audio level meter in 3ds max
This tutorial is built on the ‘3D Studio Max Audio Level Indicator’ tutorial and intends to show how live audio levels can control motion or trigger visual effects.
From this base you’ll develop an understanding of how external events can affect elements within Max, including movement, shape and surface properties. The possibilities for such applications are boundless and very useful, particularly with regard to music videos where I specialize.
Aside from 3DS Max, all applications mentioned here are available free. Units used in this tut are centimeters.
If you want to make a simple audio level meter, skip ahead to section B.
|
Some equalizer (EQ) modules in various PC apps. |
A: Preparing the audio file.
First up, we must split the audio into treble, mid-range and bass versions. You can use any sound or video editing application to make the adjustments. Some media players (e.g. Winamp) have the facility to rewrite a file to disk with EQ processing, but if you’re stuck at this point, simply record the audio playback from your hi-fi or another computer.
The ‘line in’ section of Audiograbber will perform this task happily.
The audio will be fed to Max in 3 files:
- Treble (‘high pass’)
- Normal
- Bass (‘low pass’)
|
Arranging Winamp to rewrite a sound file. |
|
Audiograbber can record the sound on Line In. |
The sound files will control the meters and we'll dub the original track over the final animation to complete the picture. Links to my demo of this are at the end.
So to derive the files, it’s pretty self-explanatory - process the sound by dialing down the bass and raising the treble for the top file, and vice-versa for the bass file. Label the files and you’re ready to go.
Technically, this is a 3-band graphic EQ, but we’ll fluff that out a bit so you can get a 5-band or 7-band spectrum analyzer to look believable.
B: Build the meter
Let’s build the meter we want to control…
- Set the number of frames in max to the length of your audio file (audio file length in seconds x frame rate)
- Create a plane 50cm tall, 10cm wide
- In material editor, select a sample slot and assign a gradient ramp to the diffuse map. Assign to the plane and make viewable in viewport.
|
Steps 1-3 |
- In the modifier, select UVW map. Expand to show gizmo.
|
Step 4 |
- Right-click on the plane, select rotate and orient the gradient vertically.
|
Step 5 |
- Right-click again, select scale and fit the gradient to the plane.
|
Step 6 |
|
Step 6 |
C: Assign sound levels to controls
The music will make the top of the meter less opaque (more solid) with higher sound levels. To do this, we’ll create an opacity map that the sound will control.
- Back in material editor, go to parent and copy the gradient ramp from diffuse to opacity (drag the map)
|
Step 7 |
- Back in diffuse, select the gradient and assign the colours you want the bar to display. The meter is now complete.
|
Step 8 |
- Back on opacity map, this is the gradient we want to control with the sound. Reverse the gradient so that white is at the bottom and black at the top.
|
Step 9 |
- Make the gradient ramp quite tight and towards the bottom. To make it easier, make the map viewable in the viewport.
- From the menu, choose Graph Editors -> Track View Dope Sheet
|
Steps 10, 11 |
In the dope sheet interface you're presented with a control graph. Down the left we see a hierarchical view of the scene, and as you expand the 'folders' you'll see the elements you can apply control to. On the right, curves can be used to describe the influence over the course of the timeline.
What we're doing is replacing a curve for an element with a very bumpy curve, which is made by the audio file.
In the Dope Sheet dialog...
|
Step 12 |
|
Step 13 |
- Now we look for the object / material we want to control. Since we’re controlling the opacity map on our plane, navigate in the Dope Sheet to ‘Medit Materials’ ‘Object’, ‘Plane001’ , ‘Material#0’ and then ‘Maps’ then ‘Opacity’
|
Step 14 |
- ‘Opacity Map#14 (Gradient Ramp)’ expands to show 4 flags, which correspond to the 4 keys on the gradient ramp (i.e. bottom, gradient start, gradient end and end). When you open a flag, you’ll see the numeric position of the key - clicking on the key in the gradient ramp also shows this data, so you can easily work out which key corresponds to which part of the gradient ramp.
- Under Flags 3 and 4 you’ll see an entry labeled ‘Position’. Once you’ve worked out which flag position matches which key, click on ‘position’ and from the dope sheet menu select ‘controller’ and then ‘assign’. What this means is that particular key on the gradient ramp is now going to have a controller assigned to it, which will control it’s location on the ramp.
|
Step 15 |
- From the pop-up menu select ‘AudioFloat’
|
Step 16 |
- In the Audio Controller properties box that pops up, select ‘choose sound’ and select your sound. At the bottom of that same dialog, set the controller range to be from 5 to 100. Close dialog.
|
Step 17 |
- Repeat the same procedure for the next flag’s position (select position , controller…) only this time make the controller range 10 to 100.
|
Step 18a |
|
Step 18b |
- If you now go down to the play button and play the animation, you’ll see the audio file moving the gradient ramp in your materials panel. It’s easy to get the controllers matched to the wrong key, so if your gradient ramp suddenly inverts or does odd things when you play the animation, simply swap the two around.
|
Step 19 |
- Go ahead and render a section to see the range of the meter. If you need to extend the travel of the indicators, set the controller range higher (Step 19) - for example, from 10 to 500 instead of 10 to 100. Increasing the audio levels in the sound file will do the same thing. Remember to do the same for both the high and low positions of the gradient ramp keys. Drag the slider along the timeline to see the effect of the range adjustments in the gradient ramp in the materials dialog.
|
Extend range for a more sensitive meter |
D: Split the meter up into sections
The sound now controls the gradient ramps on the plane, the level meter will work fine in this form. However, now is a good time to carve the plane up into smaller sections, to make it look like a vertical progressive LED stack or something similar.
- Select the plane and in the modifier stack. Add ‘Shell’ and give it some thickness as you like.
|
Step 20 |
- Right-click the plane/shell and select ‘Editable poly’
|
Step 21 |
- Back in the modifier stack, select by edge and drag thru the middle of the meter to select the left and right vertical edges.
|
Step 22 |
- Further down the modifier panel, select ‘connect’ and enter, say, a value of 10 in the mini dialog, to break the bar up into 10 sections.
|
Step 23a |
|
Step 23b |
- You’ll see the bar split into the sections. Now if you select ‘chamfer’, you can bevel the edges of the blocks back to create the vertical block series. Open them up as you like.
|
Step 24 |
- Playing the animation will show the result, just render to see the completed meter! Add a glow using a material # and lens effects in the environment dialog - use the base color and you have a super glowing LED audio meter!
If you wanted an audio meter, you’re done. To make the spectrum analyzer, we just have to clone and adjust the meter we just built.
E: Clone the meter to get you spectrum analyzer bands
All you now need to do is assign the ‘bass’ and ‘treble’ audio files to clones of the meter and presto - a full-on spectrum analyzer. Adjust your controller ranges to make 2 meters use the same sound but have slightly different levels, and the 3-band becomes 5-band straight away. More fiddling with the ranges means you can extract a 7-band spectrum from the 3 sound files you prepared earlier.
In post, simply dub the original tune over the animation to get a perfect result.
|
Iron Man shows here how the audio can control other aspects. |
F: Video demos and tutorials
For a demo of the analyzer, see my 2014 showreel on
YOUTUBE or
VIMEO.
In that demo you’ll see iron man standing in front of the spectrum analyzer, with his armor either jumping around, changing size, changing color and/or opacity all in time to the same music. This is what happens when you drop in a random model and then start stuffing about with all the controls you find in the dope sheet.
More than just pretty lights - pretty soon you’ll have your entire scene all rocking in some bizarre manner to the music. And that is why this technique is extremely effective with music videos.
For the audio level meter video tutorial by P.Slavi:
Audio_Level_3D_Meter_Tutorial_in_3D_Studio_Max_using_Audio_file_HD720Use the same technique to get a speaker to pump to the music:
Speaker Pump Tutorial in 3D Studio Max using Audio file …
No comments:
Post a Comment