mcp_opendaw_apply_rhythm_pattern
Apply a rhythmic pattern to reposition existing note onsets onto a target grid, with adjustable velocity and duration modes.
Instructions
Apply a rhythmic pattern to existing notes — reposition onsets to match a target grid.
Takes a rhythm pattern (either a rhythm_string like "x.x.x..x" or an onset_grid like "1,0,1,0,1,0,0,1") and repositions existing notes onto the onset positions. This is the inverse of extract_rhythm — it lets you stamp a groove onto any note content.
How it works:
Reads existing notes and their pitches/velocities/durations
Computes the target onset positions from the pattern (cycling if pattern is shorter than the region)
Distributes notes across onset positions:
If fewer onsets than notes: extra notes are placed at the nearest onset
If more onsets than notes: notes are assigned round-robin to onsets
Optionally adjusts velocity (accent onsets) and duration (staccato/legato)
velocity_mode:
"preserve": keep original velocities
"accent": strong beats (0,4,8,12 in 16th) get +20% velocity, weak get -10%
"flat": all notes get 0.8 velocity
"pattern": use onset_velocities from extract_rhythm if provided in onset_grid
duration_mode:
"preserve": keep original durations
"staccato": each note lasts 50% of the grid step
"legato": each note lasts until the next onset
unit_index: AU index. track_index: Note track index. region_index: Region index (-1 = first region). rhythm_string: Compact pattern "x.x.x..x" (x=onset, .=rest). Used if onset_grid is empty. onset_grid: Comma-separated "1,0,1,0,1,0,0,1" or "1;0.5;0;0.8" (value=velocity). Takes priority over rhythm_string. grid: Grid resolution (16th/8th/32nd/quarter). velocity_mode: How to handle velocities (preserve/accent/flat/pattern). duration_mode: How to handle durations (preserve/staccato/legato).
Returns modification summary with repositioned note count.
Example:
Extract groove from drums, apply to bass
rhythm = extract_rhythm(0, 0, grid="16th")
... parse rhythm_string from result ...
apply_rhythm_pattern(0, 1, rhythm_string="x...x...x...x...", grid="16th")
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| grid | No | 16th | |
| onset_grid | No | ||
| unit_index | Yes | ||
| track_index | Yes | ||
| region_index | No | ||
| duration_mode | No | preserve | |
| rhythm_string | No | ||
| velocity_mode | No | preserve |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |