Skip to content

mfdaves/frodo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

frodo

Music JSON -> MIDI (Standard MIDI File) compiler in Rust. The goal is to let LLMs describe music at a musical level (beats, patterns, instruments) and hide MIDI delta-time details.

Build

cargo build

CLI

Create a starter song JSON:

cargo run -- new --out song.json

Compile JSON -> MIDI:

cargo run -- json2midi --input song.json --output out.mid

Listen:

timidity out.mid

Library

Primary API is in src/song.rs and exported via src/lib.rs:

  • compile_song_json(json: &str) -> Result<Smf, SongCompileError>
  • Smf::to_bytes() -> Vec<u8>

Examples

  • examples/techno_v2.json
  • examples/neon_relay_v2.json
  • examples/rock_tv_jingle_raw.json
  • examples/song_v1.json

JSON Notes (v2)

v2 supports clips, step-sequencer lanes, per-lane groove, and CC/pitch-bend automation (points + ramps).

The v2 loader normalizes some common LLM outputs:

  • time_signature may be "4/4" (string) or an object.
  • steps.lanes may be an array (preferred) or an object map ({\"kick\": {...}}).
  • Notes may use start_beat/duration_beats (aliases for start/duration).
  • Chords may use pitches: [...] (expanded into multiple notes).

About

A MIDI 1.0 encoder

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages