Midi Write
midi_writeExports a song or selected bars to a Standard MIDI File, with tracks, tempo, meter, markers, lanes, and program changes for DAWs, hardware sequencers, or MPE synths.
Instructions
Write the song's notes to a Standard MIDI File (type 1) that Ableton, FL Studio, Logic, Reaper, MuseScore and any hardware sequencer open: one MIDI track per ismail track that has notes (named after it), the tempo, the meter, and markers. tracks: names to include (default every track with notes, muted ones too). bars: [a, b] writes only notes that start in those bars, moved so bar a is the file's bar 1 (default the whole song, bar 1 at the start). markers: {name: bar}, e.g. {'drop': 17}, shown as locators in the DAW. Nudged notes (@offset, a track's offset_ms) land where they sound, to the nearest tick (about 0.5 ms at 120 BPM). Kits go on channel 10 with ismail's own pad pitches (the reply lists which pitch is which pad); other tracks get channels 1 to 16 in order. The file carries notes, not sounds: in the DAW, put an instrument on each track. out: the file (default /exports/.mid). A track's expression lanes (automation inst.lane.) go out as MIDI on its channel: bend as pitch bend (+-2 semitones, said in the file with RPN 0), vib as cc:1 (mod wheel, 0..50 cents), level as cc:11 (expression, -40..0 dB, 127 the fader), breath as cc:2 (0..1). lanes: overrides as data, {lane: {'midi': 'bend' | 'pressure' | 'cc:', 'range': [lo, hi]}} (the lane's values at the message's ends; a bend range is [-r, r] or r), or {lane: None} to leave one out; e.g. {'bend': {'range': 12}, 'mute': {'midi': 'cc:20', 'range': [0, 1]}}. The reply names lanes with no message and values clamped to a range. mpe: the tracks written as MPE, for an MPE synth: each note on its own member channel with the track's lanes over its own span (bend +-48, level as per-note channel pressure), after the MPE configuration (RPN 6). True or 'lower' (every melodic track in the lower zone: channel 1 the master, members 2 to 16), 'upper' (the upper zone: channel 16 the master, members 15 down to 1), a list of track names (the lower zone), or {track: 'lower' | 'upper'} (a split synth: with both zones in the file each has 7 members, 2-8 and 9-15). The other tracks get channels outside the zones: a kit keeps channel 10, and a zone shrinks (to 4 members at least) to leave each plain track a channel; the reply says how far. No poly pressure goes out: a song's lanes are per track, with no per-note pressure to carry (mpe= gives each note its own channel pressure instead). programs: a GM program change per track, 1 to 128 as a GM list numbers them (1 piano, 33 acoustic bass, 81 square lead), so a GM synth or a DAW's GM player picks the sound: {'bass': 33}, or a program per bar where the sound changes, {'lead': {1: 81, 17: 82}}. With bars=, the program in force at the first bar goes at the file's start. A track has no program of its own in ismail (its sound is its instrument), so a track left out has none. Reach for it when the person wants to export or write the song or a part as MIDI for their DAW, a hardware sequencer or an MPE synth, its lanes as pitch bend and controllers, its program changes.
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": {
"project": "<project>"
},
"name": "midi_write"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mpe | No | ||
| out | No | ||
| bars | No | ||
| lanes | No | ||
| tracks | No | ||
| markers | No | ||
| project | Yes | ||
| programs | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |