Four to the floor
glint · Examples · Tutorials · Gallery
Uses the tempo clock: four panels light in turn on each beat of the bar (bar), pulse through each beat (beatPhase) and drift over the bar (barPhase). Tap tempo in Inputs, or play music.
Audio-reactive: it moves with music from a microphone, line-in or a file.

An example in glint, a free live shader editor in the browser: the GLSL code floats over the running picture and recompiles as you type.
The code
One pass, in GLSL.
fragment shader
#version 300 es
precision highp float;
uniform float time;
uniform vec2 resolution;
uniform float bpm;
uniform float beatPhase;
uniform int bar;
uniform float barPhase;
uniform int beatIndex;
uniform vec3 spectrum;
in vec2 v_texcoord;
out vec4 fragColor;
void main() {
vec2 uv = gl_FragCoord.xy / resolution;
float panel = floor(uv.x * 4.0);
float lit = float(int(panel) == bar);
// Each beat: a sharp attack that decays through the beat.
float pulse = exp(-beatPhase * 5.0);
vec3 hue = 0.5 + 0.5 * cos(6.2831 * (panel / 4.0 + float(beatIndex / 4) * 0.13 + vec3(0.0, 0.33, 0.67)));
vec2 local = vec2(fract(uv.x * 4.0), uv.y) - 0.5;
float ring = smoothstep(0.02, 0.0, abs(length(local * vec2(1.0, resolution.y / resolution.x * 4.0)) - 0.15 - 0.2 * (1.0 - pulse)));
vec3 col = hue * (0.06 + lit * (0.35 * pulse + 0.6 * ring));
col += hue * 0.04 * (1.0 - lit);
// A bar-long sweep along the bottom.
col += vec3(1.0) * smoothstep(0.004, 0.0, abs(uv.y - 0.04)) * step(uv.x, barPhase);
float edge = min(fract(uv.x * 4.0), 1.0 - fract(uv.x * 4.0)); // gaps between the panels
col += vec3(0.2) * step(edge, 0.004);
fragColor = vec4(col, 1.0);
}