CAST · FIVES · 5-second mic loop · in the browser

Fives.

Press record. Five seconds of microphone get captured. The page loops it forever. Pitch up, pitch down, reverse it, layer two takes against each other. The OP-1 record-and-loop trick, no hardware required.

How it works

Recording uses MediaRecorder at the browser's chosen audio codec (typically Opus inside WebM). When the 5 seconds end, the page passes the Blob to AudioContext.decodeAudioData, which returns an AudioBuffer. Looping playback is one AudioBufferSourceNode with loop = true, per slot, routed through a per-slot gain.

Pitch is playbackRate on the source node (0.5 = octave down, 2.0 = octave up). It changes pitch and speed together, like a tape deck — no granular pitch-shifting.

Reverse swaps for a second AudioBuffer built by reading the original buffer's float32 samples backwards. Toggling reverse re-starts the loop with the new buffer.

Two slots (A and B) so you can layer two takes against each other — clap on A, hum on B, both loop forever. Different pitches on each create polyrhythmic illusion since the loops drift.

Audio never leaves the page. The MediaRecorder Blob is held only in memory, not uploaded. Closing the tab destroys everything.

Pair with /cast-mirror (pitch tracking), /cast-loop (synth-only loops), /cast-pulse (synth drums).