feat/time-signature-milestone-2 - #118
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Non-4/4 Milestone 2: full songs + overflow-safe generators + UI selector
Threads the Meter end-to-end through the song services and generators so non-4/4 songs generate with correctly-sized bars, and no generator spills notes past a short/odd bar.
Song services: song_builder passes time_signature to every section request and scales all bar→beat math (offsets, tease/outro, ending bar). Arrangement helpers (_song_tempo_map, _apply_section_ramp, apply_arrangement_dynamics, apply_melodic_pickups, _section_end_bars, _section_markers) take a meter and place ramps/dropouts/pickups/tempo-map/markers at meter-scaled positions. Regen/replay/undo persist time_signature in song_meta.json and thread it back.
Generators: walking bass steps one note per felt pulse (meter.pulse_positions); drum grid clips its 16-step patterns / double-kick / jazz ride / bar-2 anticipation kicks and shifts end-of-bar fills to the real bar end (fill_shift = bar_beats − 4); riff cells space/clip to bar_beats.
Frontend: a Time-signature selector (curated simple/compound/odd list) on both the loop and song forms; round-trips through replay.
Tests: new test_meter_placement.py (81 tests) across 4/4·3/4·2/4·6/8·9/8·12/8·7/8·5/8; 4/4 stays byte-identical (216 backend + 123 frontend green).
Deferred: idiomatic compound (6/8) / odd (7/8) drum feel — current non-4/4 drums are correct and non-overflowing but still groove like a clipped 4/4; best tuned with the app running for ear-validation.