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

FlagTypeDefaultMeaning
--compactflag—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

CodeMeaning
0Success
1Processing failed
2Usage or parameter error
3Input missing or unreadable
8Cancelled
70Internal error (bug)

Common mistakes

  • Forgetting that outputs are never overwritten: pass --overwrite or a new -o path 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": {}}