Kick Detector and Bass Adder – User Guide

Automatically detects kick drum hits in a drum loop using multi-band spectral analysis and places a bass sample at each detected position, creating a synchronized bass layer mixed with the original audio.

Category: Analysis / Synthesis Praat Script: Kick detector and bass adder.praat
Contents:

What this does

This Praat script implements an intelligent kick drum detector that analyzes a drum loop to identify kick drum hits, then automatically places a user-provided bass sample at each detected position to create a synchronized bass layer. The detection algorithm works by extracting and analyzing three frequency bands from the drum loop: a low band (25-120 Hz) capturing the fundamental kick drum body, a low-mid band (120-250 Hz) used to reject false positives from toms and snares, and the full broadband signal. For each analysis frame, the script computes intensity values and first-order differences (spectral flux) for these bands, then applies z-score normalization to create a robust detection metric that's independent of overall loudness. The detection score combines three weighted components: low-band intensity (favoring strong bass energy), broadband positive spectral flux (capturing transient attacks), and a penalty for low-mid energy (suppressing non-kick drum sounds). Local maxima in the score function that exceed user-defined thresholds and satisfy a refractory period constraint are marked as kick positions. An adjustable time offset parameter allows fine-tuning of the detected timing to account for the acoustic onset characteristics of the specific drum loop. Once kick positions are identified and stored in a TextGrid point tier, the script creates a new sound object that mixes the original drum loop with the bass sample placed at each kick position, allowing the bass to trigger synchronously with the kick drum hits to create a cohesive rhythm section, with all results automatically played back and preserved in the Objects window.

Quick start

  1. In Praat, select exactly TWO Sound objects: your drum loop and your bass sample (order doesn't matter).
  2. Run script… → Kick detector and bass adder.praat.
  3. In the dialog, specify which sound is the drum loop and which is the bass sample.
  4. Adjust detection sensitivity using scoreThresh (lower = more sensitive, detects more kicks).
  5. Fine-tune timing with timeOffset if bass placement sounds early or late.
  6. Set refractory period to prevent double-triggering on the same kick (typically 0.09s for most tempos).
  7. Click "Detect and Add Bass".
  8. The script creates a TextGrid with kick positions and a new sound with bass added.
  9. The mixed result plays automatically for preview.

Parameters (form fields)

Name (GUI)TypeDefaultDescription
Sound Selection
drumLoopchoice1Select which of the two input sounds is the drum loop to be analyzed.
bassSamplechoice2Select which of the two input sounds is the bass sample to be placed at kick positions.
Detection Parameters
scoreThreshreal0.80Detection score threshold (0.5-1.5). Lower values detect more kicks (more sensitive); higher values are more selective. Start with 0.80 and adjust based on results.
dLowThreshreal0.60Low-band spectral flux threshold (0.3-1.0). Controls sensitivity to transient energy in the kick frequency range. Lower = more sensitive.
refractoryreal0.09Minimum time between consecutive kick detections in seconds. Prevents double-triggering on the same kick. Set based on tempo: 0.09s works for ~120-140 BPM.
Timing Adjustment
timeOffsetreal0.052Time shift in seconds applied to all detected positions. Positive values shift bass placement later; negative values shift earlier. Use to align bass with kick transients.
kickWindowBeforereal0.01Not used in bass adding mode (reserved for future extraction features).
kickWindowAfterreal0.11Not used in bass adding mode (reserved for future extraction features).
Score Weights
wLowreal1.0Weight for low-band intensity in detection score. Higher values emphasize bass frequency energy.
wFluxreal0.5Weight for broadband positive spectral flux. Higher values emphasize transient attacks.
wLowMidPenreal0.5Penalty weight for low-mid energy. Higher values more aggressively reject toms and snares.

Hidden Parameters (hardcoded)

NameDefaultDescription
lowBandMin25 HzLower frequency limit for kick drum body detection.
lowBandMax120 HzUpper frequency limit for kick drum body detection.
lowMidMin120 HzLower frequency limit for rejection band (toms/snares).
lowMidMax250 HzUpper frequency limit for rejection band.
smoothHz100 HzSmoothing bandwidth for Hann band filters.
hop_default0.01 sTarget analysis frame hop size (10ms).

Outputs

Usage Tips