Skip to main content
Glama

Detect tempo (auto-BPM, experimental)

detect_tempo

Detects the tempo (BPM) of live audio or a file without manual tapping and optionally drives the global project tempo.

Instructions

EXPERIMENTAL automatic tempo (BPM) detection WITHOUT manual tapping. Detects beat onsets in live audio (kick band → RMS energy → moving-baseline threshold, reusing detect_onsets' primitive), measures the time between beats, and reduces the recent inter-onset intervals to a stable tempo (median → BPM = 60/interval) exposed as a bpm channel on a Null CHOP — bind a parameter to op('…/detect_tempo/bpm')['bpm']. Complements sync_external_clock (which is tap-tempo) and detect_onsets (which flags hits but derives no tempo). With drive_tempo on, it writes the detected BPM to the global tempo (op('/').time.tempo) so every Beat CHOP — create_tempo_sync, create_autopilot — follows the music automatically. Source defaults to a synthetic gated tone (device capture can hang TD on a macOS permission modal); also accepts a file, an existing CHOP, or the live device. Caveats: time-dependent (reads 0 on a paused timeline), can lock to half/double time, and must be tuned live per source (Threshold + Smoothing knobs).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sourceNoAudio source. Defaults to 'synthetic' (an internal gated tone at a known rate) because live device capture can hang TouchDesigner on a one-time macOS microphone-permission modal — same default rationale as extract_audio_features / detect_pitch. 'device' = live microphone/line in (creating it may pop that permission dialog — click Allow). 'file' = an audio file. 'existing' = reuse a CHOP you already have.synthetic
fileNoAudio file path (source='file').
audio_inNoPath of an existing audio CHOP to analyze (source='existing').
sensitivityNoOnset-detection sensitivity 0..1. Higher = lower threshold = more beats registered (and a faster, twitchier lock); lower = only strong transients count. It maps to the excess-over-baseline threshold the kick band must clear (band-RMS magnitudes are tiny, so the usable window is small — tune live per source).
min_bpmNoLower clamp on the reported tempo. Also rejects implausibly long gaps between beats (an interval longer than 60/min_bpm seconds is ignored, so a missed beat can't halve the tempo).
max_bpmNoUpper clamp on the reported tempo. Also rejects too-short intervals (a double-trigger shorter than 60/max_bpm seconds is ignored, so a stray transient can't double the tempo).
drive_tempoNoWhen true, the engine also writes the detected BPM to the project's global tempo (op('/').time.tempo), so every Beat CHOP downstream — create_tempo_sync, create_autopilot — follows the detected beat automatically (same write as sync_external_clock).
expose_controlsNoExpose live 'Threshold' (onset sensitivity — lower fires on more beats) and 'Smoothing' (how many recent intervals the median locks over — higher = steadier, slower to react) knobs.
nameNoName for the generated system container.detect_tempo
parent_pathNoParent COMP path the generated system container (see `name`) is created inside./project1
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description details the algorithm (onset detection, median filtering), output (bpm channel on Null CHOP), and side effects (optionally writes to global tempo with drive_tempo). Annotations indicate readOnlyHint=false and destructiveHint=false, which align with the description's explanation of non-destructive mutation. The description adds significant behavioral context beyond annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured: first sentence states purpose, then algorithm, then comparison with siblings, then caveats. It is comprehensive yet concise, with no redundant sentences. Every sentence contributes value.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given 10 parameters, 100% schema coverage, and no output schema, the description fully covers the tool's behavior, including output format, side effects, and limitations. It provides enough information for an agent to use the tool correctly without needing external documentation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema descriptions cover all 10 parameters (100% coverage), so the baseline is 3. The description adds extra meaning by explaining the algorithm (e.g., how sensitivity maps to threshold) and how parameters like min_bpm/max_bpm reject implausible intervals. This elevates understanding beyond the schema alone.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states that the tool detects tempo (BPM) automatically from audio, contrasting with manual tapping (sync_external_clock) and onset detection (detect_onsets). It specifies the verb 'detect' and the resource 'tempo', making the purpose unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit guidance: it is for automatic tempo detection without manual tapping, complements sync_external_clock and detect_onsets, and includes caveats about time-dependence, half/double time locking, and the need for live tuning. This helps the agent decide when to use this tool versus alternatives.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Pantani/tdmcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server