A Python3 port of the music composition code from my 1989 master's thesis, 'Integration and Hybridization in Neural Network Modelling'.
Go to file
welsberr 07e6993c5d OpenAI Codex port of code and text of 1989 thesis. 2026-03-18 12:10:23 -04:00
THES OpenAI Codex port of code and text of 1989 thesis. 2026-03-18 12:10:23 -04:00
composer_ans OpenAI Codex port of code and text of 1989 thesis. 2026-03-18 12:10:23 -04:00
latex OpenAI Codex port of code and text of 1989 thesis. 2026-03-18 12:10:23 -04:00
tests OpenAI Codex port of code and text of 1989 thesis. 2026-03-18 12:10:23 -04:00
tools OpenAI Codex port of code and text of 1989 thesis. 2026-03-18 12:10:23 -04:00
.gitignore Initial commit 2026-03-18 11:19:38 -04:00
LICENSE Initial commit 2026-03-18 11:19:38 -04:00
MIGRATION_PLAN.md OpenAI Codex port of code and text of 1989 thesis. 2026-03-18 12:10:23 -04:00
README.md OpenAI Codex port of code and text of 1989 thesis. 2026-03-18 12:10:23 -04:00
pyproject.toml OpenAI Codex port of code and text of 1989 thesis. 2026-03-18 12:10:23 -04:00

README.md

TriuneCadence

TriuneCadence is a Python implementation of a modular neural music-composition system inspired by Wesley R. Elsberry's 1989 master's thesis on constrained melodic composition.

It combines three different network families in one pipeline:

  • a Hopfield-Tank note generator
  • a back-propagation critic (Salieri)
  • an ART1 novelty/category module (Beethoven)

The repository includes:

  • a modern Python codebase with generic network modules and thesis-specific adapters
  • legacy thesis source, text, and data files in THES/
  • timing, entropy, and predictability analysis for generated note sequences
  • JSON serialization for learned model state and run reports

Why This Repo Exists

The original system was implemented in Turbo Pascal on late-1980s hardware under severe memory constraints. That led to pointer-heavy data structures and implementation complexity that obscured what was, architecturally, a strong multi-network design.

This repository keeps the core ideas accessible:

  • generic reusable implementations of the underlying network families
  • a thesis-faithful composition pipeline built on top of those generic modules
  • a practical environment for experimentation, analysis, and historical comparison

Quick Start

Run a short composition from the thesis data:

python -m composer_ans --thes-root THES --notes 16

Or, if installed as a package:

triune-cadence --thes-root THES --notes 16

Save model state and a run report:

triune-cadence \
  --thes-root THES \
  --notes 32 \
  --save-salieri salieri.json \
  --save-beethoven beethoven.json \
  --save-report run.json

Sweepable Parameters

The CLI currently exposes a few parameters that are useful for experiments:

  • --object-threshold
  • --max-attempts-per-note
  • --art-vigilance
  • --art-vigilance-decay

Saved run reports include those parameters along with:

  • note sequence
  • per-note generation time
  • total runtime
  • unigram entropy
  • first-order conditional entropy
  • normalized entropy
  • predictability
  • redundancy

Project Layout

Core Python modules live in composer_ans/:

Legacy materials are in THES/.

Historical Context

The thesis reports that the integrated system generated 152 notes in about three hours on a 16 MHz 80386-class machine, and in about fifteen hours on an 8088-based machine with an 8087 coprocessor. This Python version can report per-note generation time directly so present-day runs can be compared against those historical figures.

Development

Run the test suite with:

pytest -q

The original migration planning artifact is preserved in MIGRATION_PLAN.md.