Import a MIDI file
import_midiImport a Standard MIDI File (.mid) into a Lathe song as MIDI clips, placing the whole file on a selected MIDI track or creating new tracks for each part while preserving note timing.
Instructions
Puts a Standard MIDI File (.mid) from the computer into the song as MIDI clips, like dragging it onto Lathe's arrangement: a groove from a drum library, a part exported from another program. Use this instead of reading a file and writing its notes out. With track (a MIDI track), the whole file goes onto it as one clip, clearing whatever was there in those bars. Without track, each part of the file (a track of it, or a channel of a one-track file) gets a new MIDI track named after it, or one new track with one_track; new tracks have no instrument, so add one with edit_session. Clips run to the end of the bar their last note ends in. Notes keep their place in beats: the song's tempo is not changed (the reply gives the file's tempo and time signature, so you can match them with edit_session). One undo step.
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": {
"path": "<path>"
},
"name": "import_midi"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| bar | No | Where it starts (1-based bar, default 1) | |
| path | Yes | The .mid file: a full path or ~/... | |
| track | No | A MIDI track (name or id) to put it all on. Without it: new tracks | |
| one_track | No | Without track: put every part on one new track (default false) |