1 · a clip
Pre-rendered, looping every 4 seconds. Turning the slider changes nothing, and neither does changing the music. This is a file.
You already know the maths of sound. Now we turn it into light.
Below are two generators and a crossfader between them. Start the sound from the bar at the bottom, then drag the fader. Both are drawn in real time and both are listening: the rings to the bass, the grid to the treble.
Leave the fader in the middle. You are seeing both images at once, exactly like a DJ mixer. The rest of this page is about how that middle is built.
A VJ builds the image live while the music is playing. Both halves of that sentence matter: live, and builds. A video editor works outside of time and can rewind. A motion designer hands over a finished file. A VJ produces a single unrepeatable stream and has to land it on a timeline that the sound in the room is setting.
A common confusion: real-time and reactive get treated as the same thing. They are not. The three boxes below run the same generator; the only difference is what drives it.
Pre-rendered, looping every 4 seconds. Turning the slider changes nothing, and neither does changing the music. This is a file.
Computed in real time, so the slider bites immediately. But it cannot hear. Every change has to come through your hand.
Same image, but some of its parameters are driven by the sound. You are still on the slider — you are just not working alone any more.
The third box is not better than the second. It just delegates part of the work. What you delegate and what you keep in your hand is the question this whole page ends on.
On the sound side you had one array: samples laid out in time. 44,100 numbers a second, each one the position of the speaker cone at that instant. An image is the same trade made on a different axis. Instead of a row of numbers along time, a sheet of numbers across space. And video is that sheet, re-read sixty times a second.
So sound is 1D, an image is 2D, and what you send to a projector is 3D: x, y, t. This whole module exists to make one sentence concrete: every effect from here on is arithmetic on those numbers. The crossfader in module 01 was not a fancy transition; it ran mix(a, b, t) once per pixel. At 1280×720 that is 921,600 multiply-adds per frame.
Take the fader down to 16: you can count the numbers one by one, and all of them are there. Push it up and the kind of number does not change, only the count. High resolution does not make the image “smoother” — it just shrinks the piece of the world each number describes.
| output | pixels | frame | at 60 fps |
|---|---|---|---|
| LED wall 384 × 192 | 73,728 | 288 KB | 17 MB/s |
| 1280 × 720 | 921,600 | 3.5 MB | 211 MB/s |
| 1920 × 1080 | 2,073,600 | 7.9 MB | 475 MB/s |
| 3840 × 2160 | 8,294,400 | 31.6 MB | 1.85 GB/s |
You have seen this before. In sound, bit depth decided how finely the cone's position could be written down, and the error came out as noise. Here the axis is different and the operation is identical: the value is rounded to the nearest available step, and the error comes out as a visible edge in the middle of a smooth gradient. It is called banding. Dither trades that edge for noise — exactly as in audio, because it is exactly the same operation.
The red channel. Left grey on purpose: this is not a colour, it is a number from 0 to 255.
The green channel. The eye is most sensitive to green, so this is the channel that dominates any brightness calculation.
The blue channel. Nearly empty wherever the image is red — the three numbers are independent of each other.
The fourth number. But it is not a colour, it is a weight: how much this pixel is there. It means nothing on its own — only inside a mix.
The same frame laid over the checkerboard using alpha: out = a·src + (1−a)·back. In module 06 every blend mode turns out to be a variation of that one line.
Three grey images and a mask. What reaches the screen is just an agreement on top of them: send the first number to the red lamp, the second to green, the third to blue. Code that swaps the order — BGR against RGB — does not corrupt the image, it breaks the agreement; that is why your reds come out blue.
Module 03 built the grid: x and y. The third axis is t, and the same thing happens there — we sample something continuous at fixed intervals. In sound we called it the sample rate; here it is called the frame rate. Both ask the same question: how many times a second am I looking, and what happens between the times I look?
One difference: sound has a reconstruction filter on the way out, and an image has your eye. Half of this module is about the limits of the machine — budget, vsync, aliasing — and half about the limits of the eye. The second half is the only place in this whole page where you can physically hurt someone in the room.
Two separate things happen as you bring the fader down from 60. One is expected: the motion gets choppy. The other shows up in the strip — the generated frame stops changing while the display keeps showing the same picture again and again. On a 60 Hz output, 30 fps is clean (every frame lasts exactly 2 display frames), but 45 fps is not: frames get held 2, 1, 2, 1, and that unevenness reads as judder. Cinema spreads 24 fps over 60 Hz as 3:2 — that familiar stutter is exactly this.
Every frame is taken from an infinitely short instant. The object is sharp, but it teleports between frames. This is what a GPU does by default.
The same frame rate, one difference: the frame is collected over a duration. The object smears, and the motion reads as smoother with no extra frames.
The cinema standard is 24 fps with a 180° shutter — an exposure of half the frame interval, 20.8 ms at 24 fps. The reason 24 fps works is not the number 24, it is that blur. Produce the same 24 frames with no shutter and the result does not look cinematic, it looks stroboscopic.
Raise the speed slowly. At some point the wheel looks frozen, and then it turns backwards. Nothing slowed down — the event rate of the spokes passed half the frame rate, and everything above that folded back inside the interval. Watch how much earlier the threshold arrives when you add spokes: each spoke is one more event that has to be counted every second.
The box is small, the contrast is low and the ceiling is 3 Hz — because this page is a lesson, not a venue. The scale below shows why the line sits exactly there. If your system's “reduce motion” setting is on, this box does not flash at all.
In module 03 we saw that a pixel holds three numbers, and that there is an agreement on top of them: the first number goes to the red lamp, the second to green, the third to blue. This module is the fine print of that agreement — because it has three traps in it: how the lamps add, how much each one counts as brightness, and the fact that the number itself is not proportional to light.
One thing to separate up front: a projector or an LED wall adds light. Paint works by absorbing part of the light that falls on it — subtraction. The “yellow + blue = green” you learned at school is a rule about paint and it does not hold here. Here, red + green = yellow — additive mixing.
Press “brown”. It looks like nothing happens, because there is no brown lamp: brown is dimmed orange, and it only reads as brown when there is something brighter next to it. Grey is not a colour either, just the three lamps equal and low. The venue version of this: sending a “dark” colour to an LED wall alone in a dark room is not a thing — with no reference, there is no dark.
The middle strip undulates and the bottom one is flat. That gap is exactly the curvature of the eye: for the same number, green carries ten times the luma of blue. Pure blue is 0.07, pure green 0.72. This is why saturated blue text on black is unreadable both on a monitor and on a wall, and why converting an image to grey by averaging three channels is wrong — the blues come out too light and the greens too dark.
The 0.5 stored in a pixel is not half the light the screen emits, it is about a fifth of it. That is not a bug, it is the gamma curve, and it is deliberate: the eye is far more sensitive at the dark end, so the limited 8-bit steps are spread along a curve that makes them look evenly spaced. The trouble starts when you forget the curve and mix the numbers: crossfading red to green runs through a muddy dark band in the middle, because both lamps drop to half while the total light falls to 21%.
mix() looks harmless. Blending two layers, blurring, downsampling or summing all want the same order: decode to linear → do the operation → encode back to sRGB. When you skip it, the loss shows up exactly where transitions live — midpoints go dark, blurs look dirty, highlights lose their punch. Note: we use the 2.4 sRGB curve here; some engines use a 2.2 approximation. The difference is small, but stay consistent.
The eye does not measure absolute brightness, it measures difference. The same grey looks dark on a light surround and light on a dark one; join them and it turns out to be one flat bar. This is not a glitch, it is the eye's actual job: the same mechanism that lets you see one apple as red in sunlight and under a lamp.
#00FF88 is one green on an LED panel and another on a laser projector, and there is no colour management anywhere in the chain. If a colour matters — a brand colour, a skin tone — check it in the room, not on your screen.Up to here we looked at the numbers of one image. Now a second image arrives, and only one question remains: which operation reduces the two numbers at the same position to one? Every blend mode is an answer to that question, and each is a single line. “Screen” is not a mysterious effect, it means 1−(1−A)(1−B).
In the lab below, A is the bottom layer (the “bed”) and B is the top one (like a clip, on a black background). Walk through the modes and keep an eye on the formula — after a while you can predict what will happen without looking at the image. That is the actual point.
Flip the order and walk through the modes again. For add, multiply, screen and difference the result stays the same — like addition and multiplication, they do not care about order. For normal and overlay it changes, because there A and B have different roles: one is the ground, the other goes on top. That is what decides when the position of a layer in your stack actually matters.
The numbers are mixed directly. This is the default in most VJ software, so this is also what looks “normal”.
The gamma curve is undone, the mix happens, then it is encoded back. This is where light actually adds up.
The difference is clearest on add and screen, and then at half opacity: the left transitions are darker and dirtier, the right ones lighter and cleaner. Neither is wrong — the left adds numbers and the right adds light. But one represents physics and the other habit, and knowing which one you are standing on is what explains why a shader looks different in another piece of software.
The top layer covers everything below it, including its own black background. Drop a clip with no alpha on like this and the layer underneath may as well not exist.
Black = 0, and adding zero does nothing. So the black background disappears by itself. Transparency without carrying an alpha channel.
Alpha is generated from brightness: below the threshold transparent, above it opaque. Unlike add, it lays the top layer over without shifting its colour.
| mode | neutral B | which means |
|---|---|---|
| add · screen · difference | black (0) | black disappears |
| multiply | white (1) | white disappears, black eats everything |
| overlay | 50% grey | mid grey disappears, the rest adds contrast |
| normal | none | transparency only comes from alpha or a key |
So far we took each image as given. But who draws a frame? If you wrote this on a CPU you would set up two nested loops and walk the pixels one by one. A GPU does not do that: it runs the same function for every pixel, separately and in parallel. That function is called a fragment shader, and it answers exactly one question: “I am the pixel at this position — what colour am I?”
That has one big consequence: a pixel knows nothing about its neighbours. It does not know which pixel was drawn before it, or what else is on the screen. All it has is its own position and the handful of numbers you hand it. What makes shaders feel hard is not the maths, it is that constraint — and once it clicks, everything else follows from it.
·
The first box contains no image at all: we just wrote each pixel's x and y into red and green. Every shader starts there. The rest is bending that position — take its distance, rotate it, fold it, push it with a number. By the fifth line what you have is a VJ generator, and there is not a single “effect” inside it.
q = rot(time) * q does not rotate the circle, it rotates the world the circle sits in. Once that sentence lands, writing shaders gets much easier.
Because a pixel cannot ask its neighbour for a colour, the only way to blur is for it to recompute its own surroundings. Take the grid from 1 to 7 and the image softens, but the number of calls goes from 1 to 49 — doubling a radius quadruples an area. Most of what feels “heavy” in real-time visuals is hiding in that table: blur, glow, bloom, shadows, light scattering. All of them mean calling the same function over and over.
The only new idea here: the loop is handed the previous frame itself. Read it back from a slightly zoomed and rotated position instead of where it was, and it leaves a trail; because every frame lands on top of the last one, tunnels, spirals and that familiar melting texture appear on their own. No code draws any of them — there is one feedback loop.
Up to here the image always lived on a rectangular screen. It does not in a room: a building façade, a column, three separate drapes, a curved LED, or simply a piece of gauze hung crooked. Mapping is the name for closing that gap — and it is not a new technique, it is the same trick as module 07: bending the coordinate. The only difference is that what you are bending now has a real surface standing in the room.
There are three jobs, always in the same order: land the image on the surface's corners, cut the light that spills past it, and reconcile the content's proportions with the surface's. The three panels below are exactly those three jobs.
Pull a corner: the image does not just move, it gains perspective. What you are doing is asking every output pixel “where in the source do you land?”, and the answer comes from a 3×3 matrix — a homography. When you cannot put the projector square to the surface — and you cannot, there is a crowd or a column in the way — this is exactly the correction you make. Turn the test pattern on and try again: in the room you send a grid before you send content, because whether a grid is straight reads from ten metres away.
A mask says where the image ends. Light spilling a few centimetres past a surface shows up in a dark room as a patch on the wall behind or on someone's face, and it breaks the whole illusion. A soft edge does two things: mechanically it is hard to land a mask exactly on an edge, and a few pixels of transition hide that error; and when two projectors overlap side by side, the same transition is what makes the seam invisible (edge blending).
This is the most frequent and most annoying problem in mapping: everything you own is 16:9 and the wall is 3:1. You have four options and all four cost you something. Fit leaves gaps at the edges — and in a dark room a gap means half the surface sitting dead. Fill crops: whatever is in the centre survives, everything at the edge is gone. Stretch breaks the proportions; a circle becomes an ellipse and any face gives it away instantly. Tile repeats, loses nothing, but the seams show if the content does not tile.
sq() from module 07 was already building coordinates from the resolution. If you work from a clip library the only cure is authoring at the target ratio; the thing you plan to “sort out later” always ends up as stretch in the room.
Up to here there was always a parameter: a crossfader, persistence, a radius, opacity. The real question now is what drives it. There are four answers, and all four produce the same kind of number — but they feel completely different in a room. Your hand carries intent, a clock carries order, the sound carries connection, randomness carries surprise. When a set will not settle, the reason is usually not the parameter but that one thing is driving all of them.
You. It carries intent, does not repeat, and gets tired. In a set this is the most valuable driver and also the scarcest.
A sine. Perfect, endless, and for exactly that reason it goes invisible after a while: the eye learns the pattern and stops looking.
Hooking into the music in the room. It gives you musicality for free, but left alone the image becomes an illustration of the track.
A value that picks a new target at random and glides toward it. It does not jump, it wanders — the cheapest way to buy a feeling of aliveness.
There are four lines in the plot and none of them looks like another. The LFO's is predictable, the sound's is jagged, the random walk's is smooth but aimless, and yours is flat — because you are not turning a knob every second. A good set mixes them: a slow LFO holds the ground, the sound catches the accents, and you make the big decisions. Hang everything on the sound and the image becomes subtitles for the track; hang everything on LFOs and it becomes a screensaver.
Throw the target and watch the three followers. The spring overshoots and comes back — physical, alive, and if you use it everywhere everything bounces. Lag never overshoots, it just eases in; this is the behaviour you will use most in VJ work. The real lesson is the third one: drop the frame rate to 15 and watch the pink line.
Lerp(a, b, 0.12) closes 12% of the distance every frame. Which makes it depend on how many frames pass: 60 times a second at 60 fps, 15 times at 15 fps, and the same code feels four times slower. It is a quiet bug anywhere the frame rate moves — the animation that is right on your machine and wrong on the one at the venue. The fix is to account for time: cur + (target − cur) × (1 − exp(−dt / tau)), where tau is a constant in seconds and the behaviour is identical at any frame rate. Every smoothing on this page uses it.
Connecting a signal to a parameter is not plugging in a cable; there is a curve in between and it sets the character. x² ignores small sounds and only answers hard hits — that is what you want when locking to the kick. √x is the opposite: it magnifies every small movement into an image that never stops twitching. Threshold turns an analogue signal into a digital decision: on or off. And invert is the one everyone forgets — something shrinking on the bass is often stronger than something growing.
In module 09 we looked at what drives a parameter. In the room, the strongest of those is already waiting: the grid the music brings. The beat, the bar, and where you are inside the bar. An image that sits on that grid feels right without doing anything clever; one that does not stays foreign to the room however beautiful it is.
But sync is not a switch, it is a decision. Locking everything to the grid is the most common mistake: the image starts behaving like a metronome, and when the music breathes there is nothing left to breathe with it.
It pulses at its own rate. It has no relationship to the music; sometimes it coincides, then it drifts. That drift is not a fault, it is an option.
It resets on every beat. The same visual; the only difference is where the phase comes from — and the effect in the room is entirely different.
The box on the right reads Audio.sig.phase: a number from 0 to 1 saying where you are inside a beat. All of sync comes out of that one number. Divide the beat count by 4 and you have the bar; divide the bar by 4 and you have the four-bar phrase — nearly all electronic music climbs that ladder, and when your visual structure uses the same ladder the two work together without you doing anything.
With quantize off the cut happens the instant you press — and a human hand never lands exactly on a beat, you are always tens of milliseconds early or late. The distance between pink (when you pressed) and green (when the cut happened) is that. Set it to 1 bar and your hand goes free: you press whenever, the cut lands on the next bar line. This is the single biggest relief in live work — you do not have to catch the right moment, you only have to state your intention.
They are not the same thing. The grid is computed from tempo: it keeps counting even when the music stops, because it is a prediction. An onset comes from a sudden rise in the spectrum: it fires when something actually happens — an accent off the grid, a vocal, a crash. In the plot the two mostly line up — but the moments where they do not are the moments the music is interesting.
The first half of this page was measurable: how many bytes a pixel is, how many milliseconds a frame is, which formula a blend is. From here it is not. From this module on the questions are not technical but about how you work — and they have no right answers, only consequences.
The first question: when do you decide things about an image? In the clip approach most decisions are made at home; at the venue you have a library of finished things and the job is calling them at the right moment. In the generative approach most decisions are made in the moment; you have nothing finished, you have a parameter space and you move around inside it. Both are legitimate; each risks something different.
Clip mode gives the pad only four corners: wherever you press it snaps to the nearest one and the transition is a cut. In generative mode every point in between is also an image and transitions are continuous. The same four materials, a completely different feel in the hand.
Play in both modes for a couple of minutes and notice what you lose. Clip gives you certainty: all four looks are exactly as you wanted, none of them will surprise you, and you have exactly four things. Generative gives you range: infinite points in between, none of them quite “designed”, and some of them frankly ugly. Most experienced VJs do both — they build a generative system, then mark the good points inside it and hit those marks in the set. Which is to say, they make themselves clips inside a parameter space.
The arithmetic is annoying but unavoidable. In a one-hour set with 45-second looks you have 80 slots; with six looks each one comes back thirteen times and the room sees the same thing every four and a half minutes. Nobody notices the first three repeats, they notice the fourth, and by the sixth they stop looking. This is the numeric answer to “do I have enough material” — and for nearly everyone the answer is no.
| clip library | generative system | |
|---|---|---|
| decisions | at home, with time | in the set, under pressure |
| the risk | repetition, running out | landing somewhere bad |
| rehearsal | preparing content | learning the space |
| when they ask for a change | render a new clip | turn a knob |
| when it crashes | the files are still there | the state is gone |