Code / Active

Temperamento

A programming language in which the same program can be written as text or as a musical score, with its behaviour preserved when the score is transposed.

2026–

Temperamento lets a musical score serve as executable source code. A program can be written as text, translated into a two-stave score in MusicXML (a format for exchanging musical notation), and translated back without changing its behaviour. The score encodes instructions through relationships between chords and notes, so transposing it preserves the program.

The implementation supports a defined subset of musical notation and checks the score’s structure, timing and encoded instructions. A paper describing its canonical translation and transposition invariance was accepted for IEEE URUCON 2026.

Text, score and execution in Temperamento

The current release is an alpha (v0.5.0-alpha.1), not a general-purpose music programming environment. The repository contains three complete text/score examples, including executable text, MusicXML and the recovered canonical program.

python -m pip install -e .
temperamento run examples/directions/toscript-plus-to-score/toscript-plus-to-score.tom --output text

See the current source and notation rules before writing scores: Temperamento implements a restricted, explicitly defined subset of MusicXML.