mcp_opendaw_merge_consecutive_notes
Merge consecutive notes of same pitch into single sustained notes to clean up repeated hits, convert staccato patterns, or simplify busy passages.
Instructions
Merge consecutive notes of the same pitch into single sustained notes.
Scans notes sorted by position. When two notes have the same pitch and the gap between them is within max_gap_beats, they are merged into one note spanning from the first note's start to the last note's end. Useful for cleaning up repeated hits, converting staccato patterns to sustained notes, or simplifying busy passages.
Args: unit_index: Audio unit index track_index: Note track index region_index: Region index (-1 = first region) same_pitch_only: If True, only merge notes with identical pitch. If False, merge any consecutive notes regardless of pitch (uses first note's pitch for the merged result). max_gap_beats: Maximum gap between note end and next note start to qualify for merging (0.0 = touching/overlapping only, 0.25 = up to a 16th note gap, 1.0 = up to 1 beat gap). velocity_mode: Velocity for merged note — "first" = use first note's velocity, "last" = use last note's velocity, "max" = use highest velocity, "avg" = use average velocity across merged notes.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| unit_index | Yes | ||
| track_index | Yes | ||
| region_index | No | ||
| max_gap_beats | No | ||
| velocity_mode | No | first | |
| same_pitch_only | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |