Librosa’s beat tracker measures onset strength, estimates tempo, then chooses beat positions that fit both the detected attacks and the tempo grid. It is not listening for a kick drum by name. It is looking for changes in spectral energy that behave like plausible beats.
Q-Audio says rhythmic sidechain ducking in Magik Mastering uses Librosa beat tracking, which matters because a detected beat is only timing information. Librosa can return beat events as frames, samples, timestamps, or dense boolean positions. The gain-reduction curve still has to be built around those positions by the mastering system.
The timing starts upstream with an onset-strength envelope. By default, Librosa builds one from a log-power Mel spectrogram and measures positive spectral changes across frequency bands, so a snare, clap, percussion stack, or bright transient can contribute even when the kick is modest. For dance music, that flexibility is useful and slightly dangerous.
Librosa’s default onset-strength calculation also averages information across frequency bins. A hard clap near the top of the spectrum and a kick down low can both register as meaningful changes, depending on the mix. Beat tracking sees rhythmic evidence, not instrument identity, which matters when you expect sidechain movement to follow “the kick.”
Clean dance arrangements give the tracker an easier job. Repeated transients create a stable onset pattern, while sustained pads and washed-out breakdowns offer less obvious rhythmic evidence. Librosa documents the extreme case plainly. With no measurable onset strength, it estimates 0 BPM and returns no beats.
Leading and trailing beat detections are also trimmed by default when their onsets are weak. A soft fade-in or percussion-free opening can therefore produce a shorter usable beat sequence than the song’s nominal bar grid suggests.
Ducking makes the mistake audible fast. A half-time reading can trigger fewer gain moves than intended, while a double-time reading can crowd extra moves between the beats you expected to carry the groove. The timing may remain perfectly regular and still feel wrong against the bass, kick, or vocal tail.
You will often hear the error before a meter gives you anything useful. Sparse intros, halftime sections, syncopated percussion, and breakdowns are the places worth treating with suspicion. The tracker can be internally consistent while choosing a pulse level that is musically unhelpful for the ducking pattern.
Two processors can read the same beat grid and sound nothing alike. One can carve a short pocket around every beat, while another can create a long swell that lasts most of the quarter note. A third can ignore certain detections or change depth according to the surrounding material.
Beat positions are frame-based by default rather than inherently sample-accurate. Converting them to time depends on the sample rate and hop length, so analysis resolution follows the frame spacing chosen by the implementation. A mastering app can compensate or smooth later, but the tracker hands downstream code estimated event positions rather than a finished modulation signal.
Current Librosa can also work with time-varying tempo estimates instead of forcing one BPM across an entire signal. Its default behavior still estimates a single tempo, which suits material that stays roughly steady but is less appropriate for large tempo ramps. A rendered DJ transition or intentionally accelerating section needs different handling from a fixed-tempo club master.
Once those positions are wrong, a downstream compressor cannot infer the producer’s intended quarter-note grid from the gain command alone. It can execute every attack and release exactly as designed while firing on the wrong metrical level. The audible problem can sound like bad compression even though the earlier timing analysis caused it.
Q-Audio says rhythmic sidechain ducking in Magik Mastering uses Librosa beat tracking, which matters because a detected beat is only timing information. Librosa can return beat events as frames, samples, timestamps, or dense boolean positions. The gain-reduction curve still has to be built around those positions by the mastering system.
The timing starts upstream with an onset-strength envelope. By default, Librosa builds one from a log-power Mel spectrogram and measures positive spectral changes across frequency bands, so a snare, clap, percussion stack, or bright transient can contribute even when the kick is modest. For dance music, that flexibility is useful and slightly dangerous.
Beat tracking starts with attacks, not kick labels
The underlying method comes from dynamic-programming beat tracking research that balances strong onsets against regular beat spacing. It does not simply grab every transient. A busy hat pattern can fire constantly while the tracker still prefers events that sit convincingly on the estimated pulse.Librosa’s default onset-strength calculation also averages information across frequency bins. A hard clap near the top of the spectrum and a kick down low can both register as meaningful changes, depending on the mix. Beat tracking sees rhythmic evidence, not instrument identity, which matters when you expect sidechain movement to follow “the kick.”
Clean dance arrangements give the tracker an easier job. Repeated transients create a stable onset pattern, while sustained pads and washed-out breakdowns offer less obvious rhythmic evidence. Librosa documents the extreme case plainly. With no measurable onset strength, it estimates 0 BPM and returns no beats.
Leading and trailing beat detections are also trimmed by default when their onsets are weak. A soft fade-in or percussion-free opening can therefore produce a shorter usable beat sequence than the song’s nominal bar grid suggests.
A clean beat grid can still choose the wrong pulse
Regularity creates its own trap because tempo estimation can find strong periodic candidates at integer multiples of the underlying period. The original beat-tracking work also found that human listeners could settle on slower or faster metrical levels for the same passage. Half-time and double-time readings are not bizarre software hallucinations. They are baked into how musical pulse can be organized.Ducking makes the mistake audible fast. A half-time reading can trigger fewer gain moves than intended, while a double-time reading can crowd extra moves between the beats you expected to carry the groove. The timing may remain perfectly regular and still feel wrong against the bass, kick, or vocal tail.
You will often hear the error before a meter gives you anything useful. Sparse intros, halftime sections, syncopated percussion, and breakdowns are the places worth treating with suspicion. The tracker can be internally consistent while choosing a pulse level that is musically unhelpful for the ducking pattern.
The beat grid still needs a gain envelope
Beat tracking does not specify how deep the duck should be, how quickly gain should fall, or how long recovery should take. It returns beat locations and an estimated tempo. Attack shape, release behavior, depth, smoothing, and any frequency-selective treatment belong to whatever processing stage consumes those beat positions.Two processors can read the same beat grid and sound nothing alike. One can carve a short pocket around every beat, while another can create a long swell that lasts most of the quarter note. A third can ignore certain detections or change depth according to the surrounding material.
Beat positions are frame-based by default rather than inherently sample-accurate. Converting them to time depends on the sample rate and hop length, so analysis resolution follows the frame spacing chosen by the implementation. A mastering app can compensate or smooth later, but the tracker hands downstream code estimated event positions rather than a finished modulation signal.
Current Librosa can also work with time-varying tempo estimates instead of forcing one BPM across an entire signal. Its default behavior still estimates a single tempo, which suits material that stays roughly steady but is less appropriate for large tempo ramps. A rendered DJ transition or intentionally accelerating section needs different handling from a fixed-tempo club master.
Once those positions are wrong, a downstream compressor cannot infer the producer’s intended quarter-note grid from the gain command alone. It can execute every attack and release exactly as designed while firing on the wrong metrical level. The audible problem can sound like bad compression even though the earlier timing analysis caused it.