Strobe grid
glint · Examples · Tutorials · Gallery
A dance-floor grid: each column is a frequency band; kicks flash tiles. Strobe is off by default (photosensitivity).
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 vec3 spectrum;
uniform vec3 spectrumIntegrated;
uniform float beat;
uniform int beatCount;
uniform sampler2D fft;
uniform float strobe;
uniform float cells;
in vec2 v_texcoord;
out vec4 fragColor;
float hash(vec2 p) { return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453); }
void main() {
vec2 uv = gl_FragCoord.xy / resolution.y;
vec2 g = uv * cells;
vec2 id = floor(g), f = fract(g);
float cols = floor(resolution.x / resolution.y * cells);
float level = texture(fft, vec2(pow((id.x + 0.5) / cols, 1.8) * 0.5, 0.25)).r;
float lit = step(id.y / cells, level * 1.1);
// Kick: a random handful of tiles light up.
lit = max(lit, step(0.85, hash(id + float(beatCount))) * beat);
vec3 hue = 0.5 + 0.5 * cos(6.28318 * (id.x / cols + time * 0.05 + vec3(0.0, 0.33, 0.67)));
float tile = smoothstep(0.0, 0.08, f.x) * smoothstep(0.0, 0.08, f.y) * smoothstep(1.0, 0.92, f.x) * smoothstep(1.0, 0.92, f.y);
vec3 col = hue * lit * tile + 0.04 * tile;
col += vec3(1.0) * strobe * step(0.5, beat) * step(0.5, fract(time * 15.0));
fragColor = vec4(col, 1.0);
}