In this recipe, we’ll create a classic 3D “Equalizer” visualization. You’ll learn how to take a sound wave, break it into frequencies, and use those numbers to drive the height of thousands of 3D boxes.
Key Concept: Instancing
Instancing is a way to render hundreds or thousands of copies of a single shape (like a box) very efficiently. Instead of creating 100 separate nodes, we create one box and tell TouchDesigner: “Put a copy of this box at every point in this list of numbers.”
1. The Audio Analysis
First, we need to turn sound into data.
- Audio In: Create an Audio File In CHOP. It comes with a default song.
- Break it down: Connect it to an Audio Spectrum CHOP.
- What it does: It performs an “FFT” (Fast Fourier Transform). It turns the sound wave into a graph where the left side is the Bass and the right side is the Treble.
- Smooth it out: Connect the spectrum to a Resample CHOP. Set the “Method” to
New Rate, New Intervaland “End” to40.- Why? This reduces the hundreds of frequency bars down to just 40, which is easier to see.
- Finalize: Connect to a Null CHOP and name it
OUT_AUDIO.
2. The 3D Scene
We need a “World” for our geometry to live in.
- The Shape: Create a Box SOP.
- The Container: Connect the Box SOP to a Geometry COMP.
- The View: Add a Camera COMP, a Light COMP, and a Render TOP.
- Now you should see a single box in your
render1viewer.
- Now you should see a single box in your
3. The Instancing Magic
Now we tell the Geometry COMP to multiply that box.
- Select the Geometry COMP. Go to the Instance tab in the parameters.
- Turn Instancing →
On. - Define the Data: Drag your
OUT_AUDIONull CHOP into the Instance CHOP/DAT field.- Wait! The box disappeared or looks weird. This is because we haven’t told TD where to put them yet.
4. Layout (The Grid)
We want the boxes to sit in a row, but our audio data only has “Height” (Y) values. We need “Position” (X) values.
- Generate X positions: Branch off from your
OUT_AUDIOnode and add a Pattern CHOP.- Set Type to
Ramp. - Set Number of Samples to
40(to match our audio). - Set Amplitude to
20and Offset to-10. This spreads the values from -10 to +10.
- Set Type to
- Merge them: Use a Merge CHOP to combine the original audio channel (
chan1) and your new pattern channel (ramp1). - Update the Geo: Connect this Merge CHOP to your
OUT_AUDIONull. - Map the Channels:
- On the Geometry COMP Instance page, find Translate X. Select
ramp1from the dropdown. - Find Scale Y (to make them grow tall). Select
chan1from the dropdown.
- On the Geometry COMP Instance page, find Translate X. Select
Visualizing the Result
Look at your Render TOP. You should now see a row of 40 bars jumping up and down with the music!
Troubleshooting
- “The bars are too small/too big” — Use a Math CHOP before the Null to multiply the audio values.
- “The bars are jittery” — Add a Lag CHOP or Filter CHOP before the Null to smooth the movement.
- “I only see one bar” — Check that your Pattern CHOP has the same “Number of Samples” as your audio spectrum.
Next Steps
- Add Color: Use the audio data to drive the
Instance Colorparameters. - Change the Shape: Replace the Box SOP with a Sphere SOP or Tube SOP.
- 3D Grid: Use a Noise TOP to generate a 2D grid of boxes instead of a 1D row.
Parameter Tuning & Behavior
| Parameter | Behavior |
|---|---|
| Resample (Samples) | Higher = more 3D bars (finer frequency detail); Lower = fewer, thicker bars. |
| Pattern Amplitude | Higher = bars spread further apart across the screen; Lower = bars cluster together. |
| Math (Multiply) | Higher = bars grow taller/more reactive to sound; Lower = subtler, shorter movement. |
| Lag/Filter | Higher = smoother, “liquid” motion; Lower = raw, “jittery” real-time data response. |
Network Architecture
To visualize how the data flows, here is a map of the final network:
[ AUDIO PROCESSING ] [ 3D SCENE ]
Audio File In CHOP Box SOP
│ │
▼ ▼
Audio Spectrum CHOP (FFT) Geometry COMP (Instancing On)
│ │
▼ ┌────────┘
Resample CHOP (40 pts) ──┤ Map chan1 to Scale Y
│ └─ Map ramp1 to Translate X
▼
Pattern CHOP (Ramp) ──▶ Merge CHOP ──▶ Null (OUT_AUDIO)Data Flow Explanation
- Analysis: The
Audio Spectrum CHOPperforms an FFT, converting time-based sound into frequency-based height. - Sampling: We use the
Resample CHOPto reduce the high frequency detail into a specific number (40). This matches our visual goal. - Layout: The
Pattern CHOPcreates the “grid” (X positions). Without it, all 40 boxes would sit at the same X position (0). - Instancing: The
Geometry COMPtakes our 40 numbers and spawns 40 copies of theBox SOP. TheY Scaleof each box is driven by its corresponding audio frequency.
(y) Return to Recipes & Projects | (y) Return to TouchDesigner | (y) Return to Home