Skip to main content
Glama

Detect pitch (experimental)

detect_pitch

Track the dominant pitch of live audio or files, outputting frequency, MIDI note, and confidence to drive visuals.

Instructions

EXPERIMENTAL monophonic pitch tracker. Estimates the dominant musical pitch of live audio and exposes pitch_hz (frequency in Hz), note (MIDI note number), and confidence (peak magnitude) on a Null CHOP — bind a colour/parameter to op('…/pitch/pitch')['pitch_hz'] to drive visuals from a melody. Built entirely from stock CHOPs (the Pitch CHOP isn't createable in this build): an Audio Spectrum CHOP in 1-sample-per-Hz mode, trimmed to a [min_hz, max_hz] search band, then an Analyze CHOP argmax (highestpeakindex) whose index IS the frequency. A Threshold knob mutes the pitch when nothing is clearly playing and a Sensitivity knob scales the magnitude. Source can be the live device (mic/line — may prompt for macOS permission), an audio file, a synthetic sine oscillator (for testing), or an existing CHOP. Caveats: ~1 Hz resolution, no harmonic/octave correction, monophonic only — approximate and best tuned live.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
max_hzNoTop of the frequency search range (Hz). The search ignores everything above this. 2000 Hz comfortably covers the fundamental of most melodic instruments and voice; raise it for piccolo/whistle, lower it to reject high harmonics.
min_hzNoBottom of the frequency search range (Hz). The dominant-bin search ignores everything below this, so sub-bass rumble / DC offset can't masquerade as the pitch. 80 Hz ≈ low male voice / bass guitar E.
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 (a SINE wave at a fixed frequency → a clean single peak, the ideal device-free test for pitch tracking). 'existing_chop' = reuse a CHOP you already have.device
parent_pathNoParent COMP path the self-contained 'pitch' container is created inside./project1
audio_file_pathNoAudio file path (source='file').
expose_controlsNoExpose live 'Sensitivity' (magnitude gain) and 'Threshold' (minimum peak magnitude below which the pitch is treated as silence) 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?

The description discloses significant behavioral details beyond the annotations: it is implemented with stock CHOPs because the Pitch CHOP isn't createable, it may trigger a macOS permission prompt, it creates a Null CHOP, and it has Threshold/Sensitivity knobs. It also clearly lists caveats (~1 Hz resolution, no harmonic correction, monophonic only). This far exceeds what the sparse annotations (readOnly:false, openWorld:true, destructive:false) provide.

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 front-loaded with a clear purpose statement and then provides implementation details, usage, and caveats in a logical flow. It is slightly long but every sentence contributes information (how it works, how to use, source options, limitations). It earns a 4 rather than 5 because the internal CHOP chain explanation could be trimmed for ultimate conciseness, though it is valuable.

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?

With no output schema, the description fully explains what the tool produces (pitch_hz, note, confidence) and how to access it via a Null CHOP path. It covers all source types, parameter effects, limitations, and a concrete example of driving visuals. This is a complete and self-sufficient description for an agent to select and invoke the tool 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?

The input schema covers all 7 parameters with detailed descriptions (100% coverage), so the baseline is 3. The tool description adds extra value by explaining the min_hz/max_hz search band in context and describing the behavior of Threshold and Sensitivity knobs (which are exposed via expose_controls), giving operational meaning to the parameters.

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 'EXPERIMENTAL monophonic pitch tracker' and states it 'Estimates the dominant musical pitch of live audio', clearly identifying the action (detect/estimate) and resource (pitch). It distinguishes itself from siblings like detect_tempo or detect_onsets by specifying it outputs pitch_hz, note, and confidence on a Null CHOP.

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

Usage Guidelines4/5

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

The description provides clear usage context: bind a color/parameter to the CHOP channel to drive visuals, source options (device, file, oscillator, existing CHOP), and a 'monophonic only' caveat implying when not to use it. It does not explicitly name alternative tools but gives practical guidance and limitations. A minor gap is the lack of explicit 'use this when...' versus 'use other tools when...'.

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