Skip to main content
Glama

Detect onsets

detect_onsets

Detect drum hits in live audio and output per-band pulse signals (kick, snare, hi-hat) for triggering visuals or cues. Follows actual audio, not a fixed clock, with adjustable sensitivity.

Instructions

Build a transient/onset detector that flags kick/snare/hi-hat hits in live audio and exposes a per-band pulse channel (a 0→1 spike on each hit) on a Null CHOP. Unlike create_tempo_sync (a fixed internal clock), this follows the ACTUAL audio: bind a parameter to op('…/onsets/onsets')['kick'] to flash or cut exactly on the kick drum. Each band is built from primitives (band filter → RMS energy → moving-baseline compare → threshold), so a Threshold knob tunes hit sensitivity and a Sensitivity knob scales the output. Source can be the live device (mic/line — may prompt for macOS permission), an audio file, a synthetic oscillator (for testing), or an existing CHOP. With emit_events on, it also broadcasts an onset event over the bridge WebSocket on each hit. The audio-following complement to create_tempo_sync.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
hat_hzNoHigh-pass cutoff (Hz) isolating the hi-hat/cymbal band.
sourceNoAudio source. 'device' = live microphone/line in (the real-world default; creating it may pop a one-time macOS microphone-permission dialog — click Allow). 'file' = an audio file. 'oscillator' = a synthetic tone, handy for testing without any device permission. 'existing_chop' = reuse a CHOP you already have.device
kick_hzNoLow-pass cutoff (Hz) isolating the kick/bass-drum band.
snare_hzNoBand-pass centre (Hz) isolating the snare/body band.
thresholdNoHow far an instant's band energy must rise above its own moving baseline (in RMS units) to count as a hit. Band-RMS magnitudes are small (a steady tone reads ~0.002 live), so the default is 0.01 — the old 0.15 was unreachable and never fired. Lower = more sensitive; raise it if a loud track double-triggers. Tune live per source (needs real percussive audio to dial in).
emit_eventsNoAlso broadcast an `onset` event over the bridge WebSocket on every detected hit (with the band name), so `tdmcp-agent watch` and the AI can react to drum hits live.
parent_pathNoParent COMP path the self-contained 'onsets' container is created inside./project1
audio_file_pathNoAudio file path (source='file').
expose_controlsNoExpose live 'Sensitivity' (output gain) and 'Threshold' (hit sensitivity) knobs.
existing_chop_pathNoPath of an existing audio CHOP to analyze (source='existing_chop').
Behavior5/5

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

Annotations only state readOnlyHint=false, openWorldHint=true, destructiveHint=false. The description adds substantial behavioral detail beyond that: it walks through the signal chain (band filter -> RMS -> baseline compare -> threshold), explains the macOS permission prompt, describes the output pulse channel, and mentions the optional WebSocket event broadcast. This gives the agent a clear mental model of what the tool does at runtime.

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

Conciseness4/5

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

The description is dense but well-structured, covering purpose, differentiation, internals, sources, events, and relationship to a sibling. It is somewhat long and repeats the 'Unlike create_tempo_sync' idea twice (once at the start and once at the end), which is slightly redundant. Still, every paragraph contributes meaningful information.

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

Completeness4/5

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

For a complex creation tool with 10 parameters and no output schema, the description covers the essential aspects: what is built, how it behaves, what sources are supported, and a notable side effect (macOS permission prompt). It could have mentioned how the generated container integrates with the existing network or how to access the per-band channels, but the provided details are sufficient for an agent to invoke it correctly.

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 description coverage is 100%, so baseline is 3. The description adds value by explaining how the Threshold and Sensitivity knobs relate to the detection chain, and it mentions the source options (live device, file, oscillator, existing CHOP) in context. This goes beyond per-parameter schema descriptions, though not every parameter is elaborated in the description itself.

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 and resource: 'Build a transient/onset detector that flags kick/snare/hi-hat hits in live audio and exposes a per-band pulse channel... on a Null CHOP.' It explicitly distinguishes itself from the sibling create_tempo_sync by stating it follows actual audio rather than a fixed internal clock, making the purpose unmistakable.

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 explicitly contrasts with create_tempo_sync ('Unlike create_tempo_sync') and even calls itself 'the audio-following complement to create_tempo_sync.' It provides concrete use cases (e.g., bind a parameter to flash or cut on kick), making it clear when to choose this tool over the tempo-sync alternative.

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