Commit graph

9 commits

Author SHA1 Message Date
Michael Winter 69f08814a9 Store edge properties at build time: cent_diffs, voice_crossing, is_directly_tunable
- Add _is_directly_tunable method to check if changing pitches are adjacent to staying pitch
- Modify _find_valid_edges to compute and return edge properties
- Store all properties in graph edges at build time
- Simplify _calculate_edge_weights to read from edge data
- Rename voice_crossing config to voice_crossing_allowed (False = reject crossing)
2026-03-12 20:06:14 +01:00
Michael Winter b7b95bb849 Remove movement_size weight as redundant with melodic threshold 2026-03-12 19:41:48 +01:00
Michael Winter e13e9ba3bc Add voice crossing check - reject edges where voices cross
- Movement map must be identity (0->0, 1->1, 2->2) to pass
- If any voice moves to a different position, weight = 0
2026-03-12 19:19:47 +01:00
Michael Winter d4cdd86e85 Add voice-leading preservation with index-to-index movement mapping
- Change movement map from {pitch: {destination, cents}} to {src_idx: dest_idx}
- Track voice mapping cumulatively in pathfinder
- Reorder output pitches according to voice mapping
- Update weight calculation to compute cent_diffs from index mapping
- Melodic threshold now correctly filters edges based on actual movements
2026-03-12 19:14:33 +01:00
Michael Winter 2b422d55fe Fix output to preserve internal tuple order
- Remove sorted_by_frequency from write functions
- Output now uses internal chord._pitches order instead of sorted
2026-03-12 18:18:40 +01:00
Michael Winter ccf90d19e1 Fix movement tracking and add melodic threshold weights
- Add movement tracking to edges: {source: {destination, cent_difference}}
- Fix movement map to handle multiple changing pitches with permutations
- Remove melodic threshold from graph building (apply in weight calculation)
- Add melodic_threshold_min/max to weight config
- Add CLI args --melodic-min and --melodic-max
2026-03-12 17:44:54 +01:00
Michael Winter aeb1fd9982 Fix path finding to use cumulative transpositions
- Track cumulative transposition across steps so output = destination + (T1 + T2 + ... + TN)
- Fix symdiff calculation to use expanded (transposed) pitches instead of collapsed
- Update CLI from --change to --symdiff-min/symdiff-max
2026-03-12 16:59:44 +01:00
Michael Winter f2bcd37287 Add elegant OOP implementation with CLI
- New compact_sets.py with Pitch, Chord, HarmonicSpace classes
- Voice leading graph with change parameter (instead of symdiff)
- CLI: --change, --dims, --chord-size, --max-path, --seed
- Tests for core functionality
- .gitignore for Python/pytest
2026-03-10 16:13:41 +01:00
Michael Winter 875ffb30f5 Initial commit: convert notebook to Python file 2026-03-10 14:40:15 +01:00