still_here

Still Here

Decisions were made, my main laptop is now running Windows 11 (fuck me), but I am now an owner of both Ableton with Max and also just Max / MSP / Jiter. The call to start making music again was just too strong. I have yet to even scratch the surface of either, but what I have done is built a really neat audio visualizer. Opinions will vary, but I like it, and I learned a ton.

This all started because Max comes with this product called Jitter, which is a tool that helps you build audio / video shaders and all kinds of esoteric bullshit. Having just fucking spent stupid amounts of time learning glsl, which is the language that allows you to draw graphics using the GPU instead of the CPU (because it is roughly a fuckton^11 times faster to draw things using the graphics processing unit compared to using the CPU), I admit that I looked at this Jitter thing as more of a challenge then a tool.

“Surely, I can build something better. Faster even. And it’ll look like that old Autechre video! Yea! This shit is easy!”

Hah. It took me two weeks to build this monstrosity. It reads an audio source, splits it into 3 “bands” depending on their frequency, each band’s loudness gets tracked over time, and those three numbers drive a 3D shape that deforms the sphere. The outline below the video is traces the path from audio in to video + audio out.

I’m working under the assumption that this site will never garner enough traffic that I have to worry about dmca shit, but just to be safe, I’ve kept them short. I will post the repo and binaries in the coming weeks.

direct download health

direct download bikes in the river

Audio thread (miniaudio device callback)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
samples โ†’ [input gain] โ†’ mono mix
                            โ†“
              โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
              โ†“             โ†“             โ†“
         BASS biquad   MID biquad   HIGH biquad
          60โ€“200 Hz   400โ€“2000 Hz  4 kโ€“12 k Hz
              โ†“             โ†“             โ†“
          envelope      envelope      envelope
          follower      follower      follower
              โ†“             โ†“             โ†“
        SDL_AtomicInt SDL_AtomicInt SDL_AtomicInt
                            โ†“
                   last_callback_ticks

lock-free read

Main thread

1
2
3
4
5
6
7
8
9
audio_envelopes_get()
         โ†“
    smoothing (8 ms exponential)
         โ†“
    noise gate (per-band threshold)
         โ†“
    AGC normalize (running peak, 8 s release)   OR   CLI fixed gain
         โ†“
    drive_norm[bass/mid/high] โ†’ UBO

UBO upload, once per frame

Vertex shader (per icosphere vertex)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
yaw-rotate vertex
         โ†“
sample fbm with drive-modulated wander offset
         โ†“
per-band cubic compander:  bยทbยท|b| + mยทmยท|m| + hยทhยท|h|
         โ†“
tanh saturate ยท push gain
         โ†“
asymmetric cap: 2.5ร— outward / 0.9ร— inward
         โ†“
baseline dent:  disp -= drive_total ยท 0.15
         โ†“
emit displaced world position + per-vertex color = mix(BASE, RED, spike)

Fragment shader

1
2
3
4
5
geometric normal from dFdx/dFdy of v_world_pos (flat shading)
         โ†“
two-sided Lambert (abs(dot(n, L)))
         โ†“
depth tint: blend toward bg color (atmospheric perspective on light bg)

If anyone has any questions, wants to send hate mail, or give me money then my email address is under links.

If you too want to do something stupid like this, start here with The Art of VA Filter Design

Built with Hugo
Theme Stack designed by Jimmy