A tintinnabulator based on Professor Milton Mermikides' work. On Youtube Professor Milton presents a wonderful introduction to Arvo Part's tintinnabuli, and I thought it'd be fun to vibe-code a tintinnabulator.
For those interested in such things: Vibe coding the basic functionality took about 10 minutes using github copilot, adding things like T-voice volume and other bits-and-bobs i thought would be nice took about 30 minutes, and it took about 1.5 hours coding the examples! Evidently, AI is not as good at music as it is at coding.
For a new project from scratch, the equivalent setup is:
uv init
uv add numpy pygame
In this repository, dependencies are already declared in pyproject.toml. Use:
uv sync
uv run tintinnabulator
Run tests and a syntax pass:
uv run pytest
uv run python -m compileall src tests
- Clickable multi-octave piano keyboard.
- M-voice (user melody) with piano-like synthesized tone.
- T-voice generated deterministically from tonic triad and tintinnabuli position.
- Major/minor mode triads.
- Position modes:
- None
- 2nd Position Superior
- 1st Position Superior
- 1st Position Inferior
- 2nd Position Inferior
- Duration buttons plus Free milliseconds field and slider.
- Dark UI with visual highlights for melody note, T-note, and triad tones.
- src/tintinnabulator/music.py: note mapping, triad generation, duration logic, T-voice rules.
- src/tintinnabulator/audio_engine.py: additive synthesis and polyphonic playback.
- src/tintinnabulator/gui.py: tkinter interface and piano interaction.
- src/tintinnabulator/cli.py: command-line entry point.
For each clicked melody note (M-voice), triad candidates are generated from the selected key/mode across MIDI 21-108. The T-voice note is selected by rule:
- 1st Position Superior: nearest triad note >= melody.
- 2nd Position Superior: second nearest triad note >= melody.
- 1st Position Inferior: nearest triad note <= melody.
- 2nd Position Inferior: second nearest triad note <= melody.
- None: no T-voice.
When the requested superior/inferior candidate would fall outside available range, nearest valid in-range triad note is used.
-
M-voice piano-like tone:
- harmonic partial stack,
- slight detuning,
- short attack and shorter decay,
- subtle transient for percussive character.
-
T-voice bell-like tone:
- inharmonic partials,
- softer/slower attack,
- longer decay tail,
- mild shimmer modulation.
No external audio samples are required.