ferraus midi to-json
Convert MIDI to editable JSON
Synopsis
ferraus midi to-json <input> [options] [-o <output>]
What it does
Writes the agent-facing JSON form of a MIDI file: tracks, notes with onset and duration in ticks, beats, and seconds, pitch number and name, velocity, channel (1-16), tempo map, time and key signatures, controllers, program changes, pitch bends, sysex, and every other event, so 'midi from-json' reproduces the file's events exactly. When editing, change 'beat'/'duration_beats' (they win over ticks) or remove both tick and beat to position by 'time_s'.
Examples
Write the JSON model beside the file
ferraus midi to-json song.mid -o song.json
Print the JSON model to stdout
ferraus midi to-json song.mid -o -
Minified JSON for an agent to read with fewer tokens
ferraus midi to-json part.mid --compact -o part.json
Options
| Flag | Type | Default | Meaning |
|---|---|---|---|
--compact | flag | — | Write minified JSON instead of indented |
Global options
Every command also accepts the global options (-o, --json, --dry-run, --overwrite, --progress, ...). See Global options.
Exit codes
| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | Processing failed |
| 2 | Usage or parameter error |
| 3 | Input missing or unreadable |
| 8 | Cancelled |
| 70 | Internal error (bug) |
Common mistakes
- Forgetting that outputs are never overwritten: pass
--overwriteor a new-opath when re-running.
For models
- MCP tool:
ferraus_midi_to_json - Schema:
ferraus schema midi to-json - Pipeline:
{ op: midi to-json, args: { ... } }(flag names with_instead of-) - fx stage: no
{"command": "midi to-json", "defaults": {}}