LinkSeg-web · music structure in the browser

Drop in a song and LinkSeg labels its functional sections — intro, verse, chorus, bridge, instrumental, outro — entirely in your browser via onnxruntime-web (WebGPU, WASM fallback). No audio leaves your machine.

Drop an audio file here or click to choose (mp3 / wav / flac / m4a / ogg)

Sample: Good Kid — “From The Start” (used under Good Kid’s creator policy)

How it works

LinkSeg treats a song as a graph over its beats, predicts pairwise links + boundary and class activations with a graph-attention network, then peak-picks boundaries and majority-votes a functional label per segment. This demo runs the full pipeline client-side: a JS mel front-end (STFT stays out of the ONNX graph) feeds the ported dense-tensor model through onnxruntime-web; boundaries are decoded in JS.

The model needs beat times. This demo estimates them with a lightweight in-JS tempo tracker — LinkSeg is robust to the beat source — and flags them as estimated. In production you pass a real beat tracker's output straight into model.analyze({ audio, beats }). The granularity slider sets the peak-picking neighborhood (max_past / max_future): a smaller window lets more local peaks survive (finer segmentation), a larger one suppresses neighboring peaks (coarser). It re-decodes from the cached activations, so it re-segments instantly without re-running the model.