Skip to main content
Glama

snap_midi_notes_to_scale

Snap off-key MIDI notes to a chosen scale in REAPER, moving each wrong pitch to the nearest in-scale tone to fix notes or force a part into key.

Instructions

Snap off-key MIDI notes onto a scale (fix a wrong note, force a part into a key).

Notes already in the scale are left alone; each off-scale note moves to the nearest in-scale pitch, and under nearest a tie resolves toward the middle of the selection. A note with no in-scale pitch left inside 0-127 stays put and is counted in skipped.

Args: root: Root pitch class, 0-11 (0=C, 1=C#, 2=D ... 11=B). mode: Scale name: major, minor, harmonic_minor, melodic_minor, dorian, phrygian, lydian, mixolydian, locrian, major_pentatonic, minor_pentatonic, blues, whole_tone, chromatic (aliases: ionian, aeolian, natural_minor). Or a custom list of semitone intervals from the root, each 0-11 (e.g. [0,2,4,7,9]). direction: "nearest" (closest scale tone), "up" or "down" (that way only, skipping a note rather than falling back to the other direction).

Returns: {ok, notes_changed, clamped, skipped, out_of_bounds, notes:[...]}; notes is the post-transform list, with indices re-synced after the sort.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modeNomajor
rootYes
fieldsNo
channelNo
end_beatNo
directionNonearest
pitch_lowNo
item_indexYes
pitch_highNo
start_beatNo
track_indexYes
return_notesNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.7.3

TDQS

A3.9/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does so well for the core transform: in-scale notes untouched, off-scale notes move to nearest in-scale pitch, tie-breaking toward the middle, and skipped notes staying put and being counted. It omits scope/permission details (how track_index/item_index bound the edit, whether the operation is undoable), which keeps it out of 5 territory.

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?

Front-loaded purpose statement, then behavior, then a labeled Args section, then Returns. Every sentence is load-bearing and there is no filler despite the length.

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

Completeness3/5

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

For a 12-parameter mutation tool with zero annotation coverage and no output schema, the description should explain the selection/scope parameters it depends on. It instead documents only root, mode, and direction, leaving the majority of the surface unexplained, so it is adequate for the musical semantics but incomplete for correct invocation.

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

Parameters3/5

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

Schema coverage is 0%, so the description must compensate, and it richly documents root (0-11 mapping), mode (named scales, aliases, and custom interval-list format), and direction ('nearest'/'up'/'down' with fallback semantics). But nine parameters -- including the required track_index and item_index, plus fields, channel, pitch_low/high, start_beat/end_beat, and return_notes -- are entirely undescribed in both schema and description, leaving critical invocation details to guesswork.

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 precise verb+resource+scope: snapping off-key MIDI notes onto a scale, with parenthetical use cases. It is clearly distinguishable from siblings like transpose_midi_notes, quantize_midi_notes, and humanize_midi_notes, which change timing or pitch independent of a key.

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

Usage Guidelines3/5

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

Two motivating scenarios are given ('fix a wrong note', 'force a part into a key'), which implies when to reach for it. However, it never contrasts the tool with adjacent options such as transpose_midi_notes or quantize_midi_notes, and states no prerequisites, so the agent must infer the choice.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools