Enter a melody line and get a complete four-voice harmonization automatically.
Compose a harmony one chord at a time while the engine shows only valid, rule-following options.
Study classical voice-leading rules by seeing which chord choices the engine rejects and why.
Play back a generated four-part arrangement using the built-in audio synthesizer.
| huaishu61/sposobin | 920linjerry-stack/capital-studio | adya84/ha-world-cup-2026 | |
|---|---|---|---|
| Stars | 16 | 16 | 16 |
| Language | Python | Python | Python |
| Setup difficulty | easy | easy | easy |
| Complexity | 3/5 | 3/5 | 2/5 |
| Audience | researcher | researcher | general |
Figures from each repo's GitHub metadata at analysis time.
No external dependencies beyond Python 3.8+, clone and run main.py directly.
This project is a music theory engine for classical four-part harmony, the style of writing taught in conservatories where four voices (soprano, alto, tenor, bass) move together according to strict rules. The README describes it as a rule-based system built in Python that turns those academic rules into a computational model, then uses graph search and dynamic programming to find the best sequence of chords for a given melody. The name Sposobin refers to a well-known Russian music theory textbook widely used in Chinese music education. The engine encodes the principles from that book as mathematical constraints, then searches for chord progressions that satisfy all of them simultaneously. Rules cover things like forbidden parallel motion between voices, restrictions on large melodic leaps, how seventh chords must resolve, and special handling of augmented sixth chords and Neapolitan chords. Each potential chord progression is scored with penalty points for rule violations, and the algorithm finds the path with the lowest total penalty. The tool has two main modes. In soprano harmonization mode, you enter a melody line and the engine automatically fills in the three lower voices, producing a complete four-voice arrangement. In interactive composition mode, you add notes one chord at a time and the engine shows you only the options that remain harmonically valid, pruning dead-end paths as you go. Both modes display the result as rendered sheet music on screen and can play back audio using a built-in synthesizer. The interface is a desktop application built with Tkinter, which is part of Python's standard library. The README says the project has no external dependencies beyond Python 3.8 or newer, though it notes that audio playback works best on Windows. You clone the repository and run main.py directly. The code is organized into separate files for the search engine, rule evaluation, chord definitions, tonality math, score rendering, and audio output. The project is released under the MIT license.
Sposobin is a Python engine that automatically writes classical four-part (soprano, alto, tenor, bass) harmony from a melody, using rule-based scoring and dynamic programming.
Mainly Python. The stack also includes Python, Tkinter.
MIT license: free to use, modify, and distribute, including commercially, as long as the copyright notice is kept.
Setup difficulty is rated easy, with roughly 5min to a first successful run.
Mainly researcher.
This repo across BitVibe Labs
Verify against the repo before relying on details.