mcp_opendaw_scale_durations
Scale MIDI note durations in a region using modes like multiply, set, quantize, or legato to adjust articulation between staccato and legato.
Instructions
Scale the duration of all notes in a region — MIDI note length control.
Like scale_velocity but for note durations. Multiply, set, add, quantize, or snap to grid. Useful for changing articulation globally — make all notes shorter (staccato feel), longer (legato feel), or snap to a grid.
mode: How to scale durations:
"multiply" — multiply each note's duration by value (0.5 = half length, 2.0 = double). Clamped to min/max.
"add" — add value (in beats) to each duration. Clamped.
"set" — set all durations to value (in beats).
"quantize" — snap each duration to the nearest grid division. value = grid in beats (0.25 = 16th, 0.5 = 8th, 1.0 = quarter).
"legato" — extend each note to just before the next note's start. value = gap fraction (0.0 = touch next note, 0.1 = 10% gap before next).
value: The scaling parameter (meaning depends on mode). region_index: Region index (-1 = first region). min_duration / max_duration: Clamp range in beats. quantize: Grid for quantize mode ("16th", "8th", "quarter", "half") — overrides value if mode="quantize".
Returns count of notes modified, original and new duration stats.
Example:
Make everything half length (staccato feel)
scale_durations(0, 0, mode="multiply", value=0.5)
All notes to quarter note length
scale_durations(0, 3, mode="set", value=1.0)
Snap durations to 16th grid
scale_durations(0, 0, mode="quantize", quantize="16th")
Legato — extend to next note with small gap
scale_durations(0, 1, mode="legato", value=0.1)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | multiply | |
| value | No | ||
| quantize | No | none | |
| unit_index | Yes | ||
| track_index | Yes | ||
| max_duration | No | ||
| min_duration | No | ||
| region_index | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |