write_clip
Create a MIDI clip in a Session slot or edit an existing clip and write its notes. Replace or add notes in one undo step, with rejected notes and reasons returned.
Instructions
Create a MIDI clip in a Session slot, or change one (also a timeline clip, clip t0/a1), and write its notes.
An empty slot gets a new clip. mode=replace (default) leaves exactly the given notes in the clip; mode=add keeps the existing ones. All of it is one undo step. Notes that fail a check come back in "rejected" with the reason; the rest are written. Works on MIDI tracks only; read_set shows the tracks and scenes. Notes may carry probability, velocity_deviation and release_velocity.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "write_clip"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| clip | No | A clip by address instead of track and slot: t0/s2 (Session slot 2 of t0) or t0/a1 (the second timeline clip of t0, see arrangement list). | |
| mode | No | replace: the clip ends up with exactly these notes (old ones removed). add: keep the old notes and add these. | replace |
| name | No | Optional new clip name; empty keeps the current name. | |
| slot | No | Clip slot: the scene row, from 0. Example: 0 for the first scene. | |
| notes | No | Notes to write. Example: [{"pitch": "C3", "start": 0, "length": 1, "velocity": 100}, {"pitch": "E3", "start": 1, "length": 1, "velocity": 90}] | |
| track | No | Track address of a Session clip, e.g. t0 (with slot). | |
| length_beats | No | Clip length in beats (16 = four 4/4 bars). 0 or empty: a new clip gets whole bars that fit the notes, an existing clip keeps its length. |