Commit graph

16 commits

Author SHA1 Message Date
Michael Winter 306de8b5c2 Add --transcribe option to CLI for generating LilyPond transcriptions 2026-03-23 19:46:00 +01:00
Michael Winter d0bd15574d Fix asymmetric connectivity in voice leading graph
- Compute both c1→c2 and c2→c1 edges independently using _find_valid_edges()
- Fix _is_directly_tunable to properly reorder c2_transposed using movement map
- Clean up unused valid_pairings code in _build_movement_maps
- Add edge_data field to PathStep for debugging
2026-03-23 18:46:14 +01:00
Michael Winter ea3acf9efe Replace --osc-enable with --osc-play
- Add --osc-play with optional file argument
- If no file provided, defaults to output/output_chords.json
- Fix python-osc API (addr -> address)
- Keep --fundamental, --osc-ip, --osc-port
2026-03-17 17:10:37 +01:00
Michael Winter 1ccab2088f Add OSC sender for real-time playback
- Create src/osc_sender.py with OSCSender class
- Add CLI args: --osc-enable, --osc-ip, --osc-port, --fundamental
- Load chords from output_chords.json
- Interactive keyboard control (< > keys)
- Display chord number, frequencies, HS arrays
- Support configurable fundamental frequency
2026-03-17 16:47:30 +01:00
Michael Winter e4b6d2cfdc Rename 'target range' to 'target register' throughout
- CLI: --target-range -> --target-register
- CLI: --weight-target-range -> --weight-target-register
- Config keys: target_range -> target_register
- Update README, tests, and all internal references
2026-03-17 14:11:21 +01:00
Michael Winter 24709c3eda Update README with complete CLI docs and rename args
- Rename --voice-crossing to --allow-voice-crossing
- Change --direct-tuning to --disable-direct-tuning (defaults to require)
- Add explicit documentation for every CLI parameter
- Add detailed explanations for each factor
- Add more examples
2026-03-17 09:11:25 +01:00
Michael Winter 400f970858 Rename graph.py to pathfinder.py
- Rename graph.py to pathfinder.py for clearer naming
- Update all imports
- Test CLI and tests pass
2026-03-16 16:13:19 +01:00
Michael Winter b349ee89bc Extract DIMS to separate dims.py module
- Create src/dims.py with DIMS_4, DIMS_5, DIMS_7, DIMS_8 constants
- Update pitch.py to import from dims
- Update harmonic_space.py to import from dims
- Update io.py to import from dims
- Fix circular import issue
2026-03-16 15:50:02 +01:00
Michael Winter 66669de00f Add Path and Candidate classes for path state tracking
- Add src/path.py with Path and PathStep classes
- Path stores initial_chord, steps, weights_config
- PathStep stores graph_node, output_chord, transposition, movements, scores, candidates
- Refactor find_stochastic_path to use candidates approach
- Separate _build_candidates (raw scores) from _compute_weights
- Simplify return type to Path only (graph_chords available via property)
- Update io.py to use new Path API
2026-03-16 00:39:32 +01:00
Michael Winter 218d7a55ff Refactor DCA factor: rename to DCA Voice Movement and DCA Hamiltonian
- Rename _factor_dca to _factor_dca_voice_movement (tracks voice pitch changes)
- Rename _factor_hamiltonian to _factor_dca_hamiltonian (tracks node visit counts)
- Update CLI: --weight-dca -> --weight-dca-voice-movement
- Update CLI: --weight-hamiltonian -> --weight-dca-hamiltonian
- Remove hamiltonian coverage from analysis (no longer tracking)
2026-03-15 12:20:12 +01:00
Michael Winter 559c868313 Fix Hamiltonian analysis and add DCA stay count metrics
- Save graph_path to output for accurate Hamiltonian tracking
- DCA analysis now shows avg/max voice stay counts
- Fix: use actual graph node hashes instead of rehashing transposed chords
2026-03-15 11:13:24 +01:00
Michael Winter 34a6ebfabd Add per-factor analysis metrics
- Melodic: violations, max violation, avg movement
- Contrary motion: steps with contrary, percentage
- DCA: avg voices changing, all voices change count/percent
- Hamiltonian: unique nodes, coverage percentage
- Target range: start/end cents, achieved percentage
- CLI: --stats now shows all metrics automatically
2026-03-15 10:48:06 +01:00
Michael Winter 16ecb192d1 Add analysis tool for chord sequences
- Add src/analyze.py: standalone analysis script
- Add --stats CLI flag to show stats after generation
- Analyze: melodic violations, target range %, voice changes
2026-03-15 10:42:22 +01:00
Michael Winter 737f1e4886 Refactor edge weights with DCA and CLI improvements
- Implement DCA (Dissonant Counterpoint Algorithm) to favor voice changes
- Track actual pitch changes in voice_stay_count (not graph indices)
- Add CLI weight arguments: --weight-melodic, --weight-contrary-motion,
  --weight-hamiltonian, --weight-dca, --weight-target-range
- DCA probability = (sum of stay_counts for changing voices) / (sum of all)
- Test with --weight-dca 100 shows frequent voice changes
2026-03-14 02:44:30 +01:00
Michael Winter 61149597c9 Add target range weight for rising register
- Add --target-range CLI option (in octaves)
- Implement target_range weight in PathFinder
- Add test for target range weight
- Add --max-path to README
2026-03-13 22:04:48 +01:00
Michael Winter 0698d01d85 Refactor into src/ module with caching and CLI improvements
- Split monolithic compact_sets.py into modular src/ directory
- Add graph caching (pickle + JSON) with --cache-dir option
- Add --output-dir, --rebuild-cache, --no-cache CLI options
- Default seed is now None (random) instead of 42
- Add .gitignore entries for cache/ and output/
2026-03-13 18:38:38 +01:00