mcp_opendaw_detect_bpm
Analyze a WAV file to detect its tempo (BPM) using onset detection and autocorrelation, enabling beat alignment in music production.
Instructions
Detect BPM (tempo) of an exported WAV file using onset detection + autocorrelation.
Pure Python implementation (no external dependencies):
Parse WAV → mono mixdown
Energy envelope (1024-sample windows)
Onset detection (energy spikes above local average)
Autocorrelation of onset train → dominant periodicity → BPM
Essential for Suno integration: Suno generates at its own BPM, but the openDAW project needs matching tempo. Detect → set_bpm for correct beat alignment when placing stems.
filename: Name of the WAV file in the exports directory (without path), or absolute path to any WAV file.
Returns: bpm (60-200), confidence (0-1), onset_count, duration_seconds.
Examples:
After importing a Suno track
result = detect_bpm("suno_track.wav")
→ {bpm: 128.0, confidence: 0.85, onset_count: 240, ...}
Then set project BPM
set_bpm(128)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filename | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |