Skip to main content
Glama

Create energy structure

create_energy_structure

Detect build, drop, and breakdown segments in audio via adaptive energy thresholds, outputting state and edge pulse signals for song structure in TouchDesigner.

Instructions

[experimental] Build a song-structure (build / drop / breakdown) edge detector COMP with adaptive thresholds. Listens to an existing audio CHOP (audioSource) or a freshly created Audio Device In, follows a long-window envelope, and runs a Script CHOP that maintains a rolling buffer (last windowSec seconds) to derive an adaptive mean (mu) and std (sigma). Emits a 5-channel Null CHOP out with: energy (smoothed RMS 0..1), state (0=breakdown, 1=build, 2=drop), and three 1-sample edge pulses build_edge / drop_edge / breakdown_edge. buildThreshold and dropThreshold are k-multipliers of sigma above mu (NOT absolute amplitudes), so the detector self-calibrates to the current mix loudness. Hysteresis (4 cooks above to step up, 30 below to fall back) stops chattering at thresholds. windowSec/Buildthreshold/Dropthreshold are exposed as custom params on the parent COMP so artists can tweak live. Default audio source builds an Audio Device In CHOP (may pop the macOS mic-permission dialog once — click Allow); pass audioSource to skip the device.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesParent COMP name to create under parent.
parentNoParent path (default project root)./
windowSecNoLength of the rolling energy buffer (sec) used to compute adaptive mean/std.
audioSourceNoOptional existing CHOP path producing audio (e.g. an Audio Device In or Audio File In). If omitted, an Audio Device In is created inside the COMP as 'audioin'.
dropThresholdNok_drop: state becomes DROP when energy > mu + k_drop*sigma (must be > buildThreshold).
buildThresholdNok_build: state becomes BUILD when energy > mu + k_build*sigma.
Behavior5/5

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

Goes far beyond the annotations (readOnlyHint=false, destructiveHint=false, openWorldHint=true). Reveals that the tool is experimental, uses adaptive thresholds, maintains a rolling buffer, emits a 5-channel Null CHOP, has built-in hysteresis, and may trigger a macOS mic-permission dialog. This is rich behavioral disclosure that helps an agent anticipate side effects and output structure.

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?

Although long, every sentence earns its place with technical specifics: threshold formulas, hysteresis values, output channel layout, and side effects. It is front-loaded with the purpose, then builds with operational detail. No fluff or redundancy.

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?

For a complex tool with no output schema, the description completely covers what the tool creates, its internal algorithm, output channels, parameter behavior, default audio source handling, and a known side effect. It is sufficiently complete for an agent to invoke it correctly and interpret the result.

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

Parameters5/5

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

The schema already covers 100% of parameters, but the description adds crucial meaning beyond the schema: thresholds are k-multipliers of sigma above mu (NOT absolute amplitudes), windowSec defines the rolling buffer length, and audioSource is optional. This clarifies parameter relationships and the self-calibrating behavior, making the parameters more understandable than raw schema descriptions 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 states a specific action and resource: 'Build a song-structure (build / drop / breakdown) edge detector COMP with adaptive thresholds.' This clearly distinguishes it from sibling tools like create_envelope_follower or detect_onsets by specifying a unique COMP type and output behavior.

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?

Provides concrete usage context: it can listen to an existing audio CHOP via audioSource or create an Audio Device In, explicitly telling users to pass an existing source to skip device creation. It mentions the mic-permission dialog and how to avoid it. While it doesn't explicitly name alternative tools, the instruction is clear enough for selecting and using this tool.

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