Skip to main content
Glama

Detect tempo (auto-BPM, experimental)

detect_tempo

Detects the tempo (BPM) from audio by analyzing beat onsets, outputting a BPM channel that can auto-sync global tempo and Beat CHOPs in TouchDesigner.

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
fileNoAudio file path (source='file').
nameNoName for the generated system container.detect_tempo
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
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).
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).
audio_inNoPath of an existing audio CHOP to analyze (source='existing').
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).
parent_pathNoParent COMP path the generated system container (see `name`) is created inside./project1
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).
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.
Behavior5/5

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

Beyond the annotations (which only indicate non-read-only and open-world), the description discloses concrete behaviors: it creates a Null CHOP with a 'bpm' channel, can write to global tempo when drive_tempo is on, may hang on macOS permission modal with device source, reads 0 on a paused timeline, can lock to half/double time, and requires live tuning. This is rich, honest context.

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 dense but every sentence earns its place: purpose, algorithm, output, integration, source options, and caveats are all covered. It is front-loaded with the key experimental label and core function, and the structure flows logically from what → how → when → caution.

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 the tool's complexity (10 parameters, no output schema, and nontrivial behavioral caveats), the description covers all essential angles: detection method, output channel path, global tempo integration, source selection, and failure modes. It is sufficiently complete for an agent to invoke and interpret the tool correctly.

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

Parameters3/5

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

Schema coverage is 100% and each parameter already has a detailed description (e.g., source rationale, min/max clamps, sensitivity mapping). The tool description adds overall algorithmic context but does not significantly augment individual parameter semantics beyond what the schema already states, so the baseline of 3 is appropriate.

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 opens with a specific verb+resource: 'automatic tempo (BPM) detection WITHOUT manual tapping,' and clearly distinguishes itself from sibling tools by noting it 'Complements sync_external_clock (which is tap-tempo) and detect_onsets (which flags hits but derives no tempo).' This makes both purpose and differentiation explicit.

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?

It gives clear when-to-use guidance by contrasting with tap-tempo and onset-only tools, and provides practical source-selection advice (defaults to synthetic to avoid macOS permission hang, also accepts file/existing/device). The drive_tempo option's downstream effect on Beat CHOPs is also explained, helping the agent decide when this tool fits.

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/lucasmaher-hash/touch-designer-mcp'

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