midi
Compose music by describing notes, chords, dynamics, and tempo, then render to standard MIDI files. Converts musical intent into playable MIDI output.
Instructions
Execute midi operations. Each op string follows: VERB TARGET [key:value ...] Call midi_help for the full reference card.
MUSIC: note TRACK PITCH at:POS dur:DUR [vel:V] [ch:N] chord TRACK SYMBOL at:POS dur:DUR [vel:V] [ch:N] track add|remove NAME [instrument:INST] [program:N] [ch:N] [bank:MSB[.LSB]] cc TRACK CC_NAME VALUE at:POS [ch:N] bend TRACK VALUE at:POS [ch:N] tracker TRACK import at:POS [res:RES] ... tracker end
STATE: mute TRACK solo TRACK program TRACK INSTRUMENT|program:N [at:POS] [bank:MSB[.LSB]]
META: tempo BPM [at:POS] time-sig N/D [at:POS] key-sig KEY-MODE [at:POS] marker TEXT at:POS title TEXT
EDITING: remove SELECTORS move SELECTORS to:POS copy SELECTORS to:POS transpose SELECTORS SEMITONES velocity SELECTORS DELTA quantize SELECTORS grid:DUR modify SELECTORS [pitch:P] [vel:V] [dur:D] [at:POS] [ch:N] repeat SELECTORS [to:POS] count:N crescendo SELECTORS from:VEL to:VEL decrescendo SELECTORS from:VEL to:VEL
SELECTORS: @track:NAME @channel:N @range:M.B-M.B @pitch:PITCH @velocity:N-M @all @recent @recent:N @not:TYPE:VALUE Combine to intersect: @track:Piano @range:1.1-4.4
POSITION: M.B (1.1 = start) M.B.T (tick offset) tick:N +DUR -DUR end
DURATION: whole, half, quarter, eighth, sixteenth, 32nd 1n, 2n, 4n, 8n, 16n, 32n dotted-quarter, triplet-eighth, ticks:N
PITCH: C4, D#5, Bb3 (note+accidental+octave) midi:60 (raw MIDI number)
CHORDS: Cmaj, Am, Dm7, G7, Bdim, Faug, Csus4, Asus2 Cmaj7, Am7, Dm7b5, G9, Cm6, Cadd9, Dm/F (slash)
VELOCITY: 0-127 (numeric) ppp, pp, p, mp, mf, f, ff, fff (dynamic names)
CC NAMES: volume, pan, modulation, expression, sustain, reverb, chorus, brightness, portamento, breath
GM INSTRUMENTS (EXAMPLES): acoustic-grand-piano, electric-piano-1, vibraphone acoustic-guitar-nylon, electric-bass-finger, violin trumpet, alto-sax, flute, string-ensemble-1 program:N (raw 0-127) bank:MSB[.LSB]
RESPONSE PREFIXES:
note/chord added ~ event modified
track modified - event removed ! meta event @ bulk operation
CONVENTIONS:
Positions are 1-based: measure 1, beat 1 = 1.1
Channels are 1-indexed user-facing (ch:1 through ch:16)
Channel 10 is drums (GM standard)
Track names are unique identifiers
Batch multiple ops in one call for efficiency
Call midi_help after context truncation for full reference
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ops | Yes |