- make_tune: validate_spec() reports every spec problem in one run (missing keys, unknown style, bad qualities, bpm<=0, out-of-range loop/fills, melody longer than chart, unsafe name) — no raw KeyErrors - make_tune: key_sig_for handles accidentals in minor and major keys, any case (Bb minor, F# minor, bb major); real spellings kept (C# major) - make_tune: n64 pad uses QUALITIES table (dim/aug/sus now correct) - make_tune: WARNING on stderr for fields a style can't use (counter for non-DOS, fills_at for n64) instead of silent drops - make_tune: name sanitised ([A-Za-z0-9][A-Za-z0-9._-]*), no traversal - make_tune: render errors actionable (timidity presence check, stderr surfaced, sys.executable instead of bare python3) - songkit: parse_score lints the FINAL bar too (was unchecked); this caught a real 5-beat bar in 01_service_station_2am COUNTER_A (fixed) - build_all.sh: dependency + soundfont checks, removes stale midi/wav outputs with no current source, fails if nothing was produced - smoke_test: runs every spec, checks loop marker tick positions, feeds malformed bars to the linter, covers validation + key sigs - AGENTS.md: documents 0-based bars and exclusive end_bar, validation behaviour; SKILL.md added so the repo loads as an agent skill
1.4 KiB
1.4 KiB
name, description, version
| name | description | version |
|---|---|---|
| midi-playlist-repo | Compose retro game MIDI in /root/midi-playlist via JSON specs. Use when writing, fixing, or rendering chiptune/DOS/N64-style tunes. | 1.0.0 |
midi-playlist: retro MIDI from JSON specs
Repo: /root/midi-playlist (stdlib-only Python; lib/midikit.py, lib/songkit.py).
The workflow
- Copy
tunes/specs/04_tea_break_at_the_terminal.json, changename,style,bpm,key,chords,melody,loop. python3 tools/make_tune.py tunes/specs/<name>.json --render- Never declare success without a passing run: the command re-parses the MIDI, renders WAV via timidity, and checks clipping / dead air / duration.
- Whole-repo check:
python3 tests/smoke_test.pythen./tools/build_all.sh.
Conventions an agent must not guess
- Bars are 0-based;
loop.end_baris EXCLUSIVE. melody_start_bar + number of '|' bars <= len(chords).- If the melody uses
|, every bar (including the last) must total 4/4 — the linter names the offending bar. - Styles:
dos_adventure(OPL-ish, supportscounter+fills_at),n64_ambient(pads/flute, no drums),chiptune_racing(stabs, nocounter). - Validation reports every spec problem at once; style-incompatible fields warn on stderr instead of being dropped silently.
Full details, score grammar and rendering options: AGENTS.md in the repo.