Skip to main content
Glama

Create energy structure

create_energy_structure

Build an adaptive song structure detector that tracks energy levels and outputs states for breakdown, build, and drop sections using customizable thresholds.

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)./
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'.
windowSecNoLength of the rolling energy buffer (sec) used to compute adaptive mean/std.
buildThresholdNok_build: state becomes BUILD when energy > mu + k_build*sigma.
dropThresholdNok_drop: state becomes DROP when energy > mu + k_drop*sigma (must be > buildThreshold).
Behavior5/5

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

The description extensively discloses behaviors beyond the annotations: it creates a Script CHOP with rolling buffer, adaptive threshold, hysteresis, exposes custom parameters, may trigger macOS permission dialog, and describes output channels. Given annotations only provide readOnlyHint and destructiveHint, the description fully compensates.

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 relatively long but well-structured, starting with the main purpose and then detailing algorithm, parameters, and side effects. Every sentence adds necessary information, though minor redundant phrasing could be trimmed.

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 (6 parameters, no output schema), the description covers all essential aspects: algorithm, parameter meanings, output channels, side effects, and usage options. It is thoroughly complete for an agent to understand and invoke 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 coverage is 100%, so baseline is 3. The description adds significant meaning: explains that buildThreshold and dropThreshold are k-multipliers not absolute amplitudes, details hysteresis counts, and clarifies default audio source behavior. This adds value beyond the schema.

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 specifies the tool creates a 'song-structure (build / drop / breakdown) edge detector COMP with adaptive thresholds'. It uses specific verbs and resources, distinguishing it from sibling tools like create_audio_reactive or create_beat_grid_sequencer by focusing on energy-based structure detection.

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 explains when to use this tool (for creating a structure-detection COMP) and provides context on audio source options (existing CHOP or new Audio Device In). However, it does not explicitly state when not to use it or name alternatives, though the unique functionality implicitly guides usage.

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