// the find
kennethreitz/pytheory
Music Theory for Humans.
PyTheory is a Python music theory library that expanded into a full composition toolkit — intervals, scales, chord analysis, fretboard diagrams, drum sequencing, and a soft-synth engine with effects and MIDI export. It's for developers who want to sketch musical ideas in code and hand off to a DAW, not for production audio work.
The core theory API is genuinely clean — `Key("C", "major").progression("I", "V", "vi", "IV")` reads like pseudocode and does exactly what you expect, and `Scale.recommend()` from an arbitrary pitch set is a useful trick. Multi-system support is rare and looks properly implemented — Western, Hindustani, Maqam, Gamelan, and Japanese scales in one library, not bolted on. The Score/Part composition model is well-designed: sections, parameter automation, and per-part synth settings form a sensible DSL that stays readable at scale. The CLI earns its keep — quick theory lookups and a strobe tuner without writing a script are genuinely useful.
Kenneth Reitz ships polished v1s and moves on — Pipenv, Tablib, and others follow this pattern. The 82 forks against 1623 stars is a low engagement ratio that suggests mostly curiosity, not adoption; if he loses interest the project stalls. The README scope is enormous and reads partly aspirational — 56 synth waveforms and 100 drum patterns is a lot of surface area to maintain at quality, and Python soft-synths frequently sound thin in practice. Python is genuinely the wrong tool for real-time audio: `pytheory live` with MIDI input will fight the GIL constantly on any non-trivial setup, and the README markets it harder than 'sketch tool' warrants. The sympy dependency pulls a heavy symbolic math engine for what is essentially modular arithmetic — it bloats install size and slows import time for no real benefit over a few lookup tables.