whatisgithub

What is sposobin?

huaishu61/sposobin — explained in plain English

Analysis updated 2026-05-18

16PythonAudience · researcherComplexity · 3/5LicenseSetup · easy

In one sentence

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.

Mindmap

mindmap
  root((Sposobin))
    What it does
      Four-part harmonization
      Rule-based scoring
      Dynamic programming search
      Sheet music rendering
    Tech stack
      Python
      Tkinter
    Use cases
      Auto-harmonize a melody
      Interactive composition
      Music theory study
      Audio playback
    Audience
      Music students
      Researchers
      Composers
    Rules enforced
      Parallel motion limits
      Seventh chord resolution
      Augmented sixth chords
      Neapolitan chords

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Enter a melody line and get a complete four-voice harmonization automatically.

USE CASE 2

Compose a harmony one chord at a time while the engine shows only valid, rule-following options.

USE CASE 3

Study classical voice-leading rules by seeing which chord choices the engine rejects and why.

USE CASE 4

Play back a generated four-part arrangement using the built-in audio synthesizer.

What is it built with?

PythonTkinter

How does it compare?

huaishu61/sposobin920linjerry-stack/capital-studioadya84/ha-world-cup-2026
Stars161616
LanguagePythonPythonPython
Setup difficultyeasyeasyeasy
Complexity3/53/52/5
Audienceresearcherresearchergeneral

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 5min

No external dependencies beyond Python 3.8+, clone and run main.py directly.

MIT license: free to use, modify, and distribute, including commercially, as long as the copyright notice is kept.

So what is it?

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.

Copy-paste prompts

Prompt 1
Explain how Sposobin's dynamic programming and DAG search choose the best four-part harmonization for a melody.
Prompt 2
Show me how to clone Sposobin and run main.py to try the soprano harmonization mode.
Prompt 3
What voice-leading rules does Sposobin enforce, like parallel fifths or seventh chord resolution?
Prompt 4
How does the interactive composition mode in Sposobin prune invalid harmonic paths as I add notes?

Frequently asked questions

What is sposobin?

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.

What language is sposobin written in?

Mainly Python. The stack also includes Python, Tkinter.

What license does sposobin use?

MIT license: free to use, modify, and distribute, including commercially, as long as the copyright notice is kept.

How hard is sposobin to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is sposobin for?

Mainly researcher.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.