Find a file
2026-03-13 19:02:24 +01:00
legacy Add legacy code from compact_sets_sandbox 2026-03-13 18:45:13 +01:00
src Refactor into src/ module with caching and CLI improvements 2026-03-13 18:38:38 +01:00
supercollider Clean up: remove ipynb/txt, move scd to supercollider/, update gitignore 2026-03-13 19:02:24 +01:00
tests Add elegant OOP implementation with CLI 2026-03-10 16:13:41 +01:00
.gitignore Clean up: remove ipynb/txt, move scd to supercollider/, update gitignore 2026-03-13 19:02:24 +01:00
AGENTS.md Initial commit: convert notebook to Python file 2026-03-10 14:40:15 +01:00
compact_sets.py Refactor into src/ module with caching and CLI improvements 2026-03-13 18:38:38 +01:00
LICENSE Add README and GPLv3 LICENSE 2026-03-13 18:51:28 +01:00
README.md Add README and GPLv3 LICENSE 2026-03-13 18:51:28 +01:00
session-ses_328e.md Clean up unused code 2026-03-13 00:55:27 +01:00

Compact Sets

A rational theory of harmony based on Michael Winter's theory of conjunct connected sets in harmonic space, combining ideas from Tom Johnson, James Tenney, and Larry Polansky.

Installation

# Activate virtual environment
source venv/bin/activate

# Run
python compact_sets.py --dims 4 --chord-size 3

CLI Options

  • --dims 4|5|7|8 - Number of prime dimensions (default: 7)
  • --chord-size 3|4 - Size of chords (default: 3)
  • --symdiff-min, --symdiff-max - Symmetric difference range (default: 2-2)
  • --melodic-min, --melodic-max - Voice movement thresholds in cents
  • --dca - DCA multiplier (default: 2.0)
  • --seed - Random seed (default: random)
  • --cache-dir - Graph cache directory (default: ./cache)
  • --output-dir - Output directory (default: output)
  • --rebuild-cache - Force rebuild graph
  • --no-cache - Disable caching

Legacy

The legacy/ folder contains earlier versions of this code, used to create the musical works published at unboundedpress.org/works/compact_sets_1_3.

Output

Generated files go to output/:

  • output_chords.json - Chord data
  • output_chords.txt - Human-readable chords
  • output_frequencies.txt - Frequencies in Hz