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
| Flag | Type | Default | Meaning |
|---|---|---|---|
--ppq | integer | — | 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
| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | Processing failed |
| 2 | Usage or parameter error |
| 3 | Input missing or unreadable |
| 4 | Unsupported format or codec |
| 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_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": {}}