feat(midi): add 20 new semantic porcelain commands (#120)
Implements a comprehensive suite of musical analysis, transformation, and multi-agent coordination commands for the MIDI plugin, each impossible in Git's binary-blob model.
New analysis commands (read-only, support --commit and --json): muse midi rhythm — syncopation, swing ratio, quantisation accuracy muse midi scale — scale/mode detection (15 scales, all roots) muse midi contour — melodic contour shape (arch/ascending/wave/…) muse midi density — notes-per-beat per bar, textural arc muse midi tension — harmonic tension curve from interval dissonance muse midi cadence — authentic/deceptive/half/plagal cadence detection muse midi motif — recurring interval-pattern (motif) detection muse midi voice-leading — parallel fifths/octaves and large-leap lint muse midi instrumentation — per-channel note range, register, velocity map muse midi tempo — BPM estimation via IOI voting muse midi compare — semantic diff across key, rhythm, density, swing
New transformation commands (write to working tree, support --dry-run): muse midi quantize — snap onsets to a rhythmic grid (8 grid values) muse midi humanize — add timing/velocity jitter for human feel muse midi invert — melodic inversion around a pivot pitch muse midi retrograde — reverse pitch order (retrograde transformation) muse midi arpeggiate — convert chord voicings to arpeggio sequences muse midi normalize — rescale velocities to a target dynamic range
New multi-agent and search commands: muse midi shard — partition composition into bar-range shards muse midi agent-map — bar-level blame across commit history muse midi find-phrase — similarity search for a phrase across history
Supporting changes: muse/plugins/midi/_analysis.py — pure typed analysis helpers (8 functions) tests/test_midi_semantic.py — 64 new tests covering all new commands muse/cli/app.py — updated docstring and registrations
Passes mypy (0 errors, 168 files), typing_audit (0 violations), and the full pytest suite (1967/1967 green).
Co-authored-by: Gabriel Cardona <gabriel@tellurstori.com>
Comments
0No comments yet. Be the first to start the discussion.