ConstraintLab

You declare the rules. The solver finds a piece that obeys every rule you switched on - and shows its work.

1. Declare constraints

Voice-leading rules (hard constraints)

Same seed + same constraints always produce the same piece. Share links encode only the constraints and the seed.

What this is (and is not)

Constraint programming is an established research technique for music composition (used in academic systems since the 1990s). ConstraintLab is a transparent browser implementation: the rules, the search, and the rejections are all visible on this page. It runs entirely on your device - no account, no server, no network calls.

Current limits, stated plainly: root-position triads only, four voices, one 16-bar AABA form with the A phrase repeated identically, harmonic minor or major keys. The leading-tone rule applies to the soprano, within each phrase and across the B-to-A seam; parallel fifths/octaves and the upper-voice leap limit are also enforced across the phrase seams. This is a composition toy with a proof, not a replacement for a composer.

Built with AI assistance (design and code), disclosed per hackathon rules.