IT lexicon › Programming › Onset detection

Onset detection

Programming På svenska → Updated: 2026-10-28

Automatically finding the moments in a recording where a new note or hit begins.

A snare hit is easy: energy shoots up and you can see it in the waveform. A violin changing notes mid-bow with no new attack is a different matter. So most methods compute a detection function in the frequency domain — typically spectral flux, the increase in energy per frequency band since the previous frame — and pick peaks from it with an adaptive threshold. Others look at phase deviation or high-frequency content. Juan Pablo Bello and colleagues wrote the much-cited tutorial on the subject in 2005; trained neural networks now beat the hand-crafted functions.

The results are everywhere in audio software: the markers a DAW drops on every drum hit before time-stretching, a sampler chopping a loop into slices, and the first stage of beat tracking and transcription.

← Back to the lexicon