mirror of
https://github.com/kennethreitz/pytheory.git
synced 2026-06-21 15:00:57 +00:00
8faff51fc3
An adversarial audit of the theory engine surfaced 23 real bugs across 11 subsystems. This fixes all of them, with regression tests. Highlights: - charts: match chord tones by pitch class, not spelled name — ~60 flat-key voicings (Eb/Ab/Db/Gb, Fm/Cm) were broken 2-string fragments - maqam: Saba had a major 3rd where its diminished 4th (Fab, 32/25) belongs — no 4th degree at all - scales: extreme keys (Gb/F#/C#/Cb) now spell one letter per degree with correct key signatures; octave-transposed chord tones keep their spelling (Eb IV = Ab C Eb, not Ab C D#) - scales: accidental Roman numerals (bVII/bVI/bIII) are chromatic from the parallel major, not double-lowered in minor/modal keys - chords: from_symbol rejects unconsumed suffixes (C7b9, Cmajgarbage) instead of silently mis-parsing; add 7sus4/7sus2; identify 6th chords; 13th drops the avoid-note 11th; weight voicer omissions by importance - play: ensemble render uses an isolated RNG instead of reseeding the global one (fixes render_scores determinism under threads); sub_osc + detune no longer leaks the sub into the main voice - scales: Nashville 'm' forces minor; garbage Roman numerals rejected - chords/scales: negative_harmony spells with flats to match its scale - tones: from_midi round-trips through octave -1; add prefer_flats - diagrams: chord_svg no longer crashes on unidentifiable chords - cli: friendly one-line errors instead of tracebacks (PYTHEORY_DEBUG=1 to re-raise); play()/save() guide Score callers to play_score/save_midi - chords: harmony/dissonance/beat_pulse return floats, not int 0 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>