ferraus midi from-json

Write a MIDI file from JSON

Synopsis

ferraus midi from-json <input> [options] [-o <output>]

What it does

Builds a Standard MIDI File from the JSON model. Minimal JSON works: {"tempo_map":[{"beat":0,"bpm":100}],"tracks":[{"notes":[{"beat":0,"duration_beats":1,"name":"C4","velocity":100}]}]}. Positions: beat wins over tick; time_s is used when neither is present.

Examples

Round-trip an edited JSON model back to MIDI

ferraus midi from-json song.json -o song.mid

Write at 960 ticks per quarter note

ferraus midi from-json idea.json -o idea.mid --ppq 960

Write a JSON part made by an agent at 480 ticks per quarter note

ferraus midi from-json notes.json -o notes.mid --ppq 480

Options

FlagTypeDefaultMeaning
--ppqinteger—Ticks per quarter note of the written file; ticks are rescaled (default: the JSON's ppq, else 960) Range: 24..32767.

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
4Unsupported format or codec
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_from_json
  • Schema: ferraus schema midi from-json
  • Pipeline: { op: midi from-json, args: { ... } } (flag names with _ instead of -)
  • fx stage: no
{"command": "midi from-json", "defaults": {}}