Write MIDI notes
write_notesWrites MIDI notes into a Lathe track across chosen bars from pattern notation or a JSON note list, with replace/add modes and repeat, as one undoable edit.
Instructions
Writes notes into a MIDI track, as one undo step in Lathe. Give pattern (Lathe's note notation; notation_guide has the full reference) or notes (a JSON list). A pattern is lines; each loops to fill from_bar to to_bar. Drum grid: a lane then one character per step (16ths by default; . rest, x hit, X accent, o ghost, 1-9 velocity levels), e.g. "kick x... ..x. x... ....". Token line: notes split each bar evenly (| between bars; ~ rest, _ hold, [a b] share a step, [a,b] chord), each with optional :velocity, +8ms/-5ms or +20% timing, =beats length, e.g. "bass: c2:110 ~ [c2 c2:70-6ms] ~ | f1=2 _ ~ g1+4ms". "swing 58%" and "humanize 6ms 8vel seed 3" lines set the feel for the lines after. The notes go in a clip covering from_bar to to_bar: with mode "replace" (the default) whatever was in those bars on that track goes first; with "add" they join the notes already there. Every note must start inside the bars. repeat plays the notes again that many times back to back (a one-bar beat with repeat 4 fills four bars). Lathe's Drums play the usual drum notes: 36 kick, 37 rim, 38 snare, 39 clap, 42 closed hat, 46 open hat, 41/45/48 low/mid/high tom, 49 crash, 51 ride, 56 cowbell.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"track": "<track>",
"from_bar": "<from_bar>",
"to_bar": "<to_bar>"
},
"name": "write_notes"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | "replace" (default) or "add" | |
| notes | No | The notes as a list, instead of pattern (at most 4000 with the repeats) | |
| track | Yes | MIDI track name or id | |
| repeat | No | Play the notes this many times in a row, each copy (to_bar - from_bar) bars later, and make the clip that much longer (default 1) | |
| to_bar | Yes | Where it ends: from_bar 1, to_bar 2 is one bar | |
| pattern | No | The notes in Lathe's note notation (instead of notes) | |
| from_bar | Yes | Where the clip starts (1-based bar) |