Skip to main content
Glama

mcp_opendaw_constrain_note_range

Constrain MIDI notes to a specified pitch range with clamp or octave wrap modes, fixing out-of-range notes after generation or transposition.

Instructions

Constrain notes to a pitch range — clamp or octave-wrap out-of-range notes.

After AI generation, transcription, or aggressive transposition, notes can land outside the playable range of an instrument. This tool brings them back inside.

Two modes:

  • "clamp" — notes below min_pitch are set to min_pitch, notes above max_pitch are set to max_pitch. Preserves the note but loses pitch information. Use when exact range matters (e.g. MIDI 0-127 safety).

  • "octave_wrap" — notes are shifted by octaves (±12 semitones) until they fall within [min_pitch, max_pitch]. Preserves pitch class and musical relationship. Use for instrument range constraints (violin, guitar, vocal, flute). If a note can't fit even after wrapping (range < 12 semitones), it's clamped.

Common instrument ranges (MIDI note numbers):

  • Guitar (standard tuning): E2(40) to E6(88)

  • Bass guitar: E1(28) to G4(67)

  • Violin: G3(55) to A7(105)

  • Cello: C2(36) to C6(84)

  • Flute: C4(60) to D7(98)

  • Vocal soprano: C4(60) to A5(81)

  • Vocal bass: E2(40) to E4(64)

unit_index: AU index (-1 = all AUs). track_index: Note track index (-1 = all note tracks on the AU). region_index: Region index (-1 = all regions on the track). min_pitch: Minimum allowed MIDI pitch (0-127, default 0 = no lower bound). max_pitch: Maximum allowed MIDI pitch (0-127, default 127 = no upper bound). mode: "clamp" (hard limit) or "octave_wrap" (shift by octaves to fit).

Returns per-track notes adjusted, clamped count, wrapped count.

Example:

Constrain to guitar range with octave wrapping

constrain_note_range(unit_index=0, track_index=2, min_pitch=40, max_pitch=88, mode="octave_wrap")

Safety clamp to MIDI range

constrain_note_range(mode="clamp", min_pitch=0, max_pitch=127)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modeNoclamp
max_pitchNo
min_pitchNo
unit_indexNo
track_indexNo
region_indexNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

No annotations provided, but the description fully explains both modes, including the fallback to clamp when range < 12 semitones. It also describes the return value. Missing details on whether modifications are in-place or return new data, but acceptable.

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?

Description is relatively long but well-organized with clear sections (modes, instrument ranges, parameter list, example). Front-loaded with core action. Slightly verbose but justified by detail.

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?

Covers all relevant aspects: modes, edge cases, parameter explanations, example, and return value. No output schema provided, but description compensates. Complete for a 6-parameter tool.

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?

Schema description coverage is 0%, but the description adds complete meaning for all 6 parameters, including defaults, ranges, and an example call. This compensates fully.

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 states it constrains notes to a pitch range using 'clamp' or 'octave_wrap'. It distinguishes from sibling tools like transposition or note manipulation by focusing on range correction.

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?

Explicitly specifies when to use: after AI generation, transcription, or aggressive transposition. Provides common instrument ranges and mode selection guidance (clamp for MIDI safety, octave_wrap for instrument constraints).

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/AMEOBIUS-team/opendaw-mcp'

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