Verify pickup measure support, document MIDI import gap - #34
Merged
Merged
Conversation
Traced every path a manually-entered short first measure touches: adding a measure (MeasureNavigationViewModel.ApplyAddMeasure) never checks the previous one is "full", and both playback scheduling (ScoreMidiSchedule.GetMeasureDurationUnits) and MIDI export derive a measure's length purely from its own notes' actual durations, with no fixed-beat-count assumption anywhere. So a deliberately short first measure already plays/exports/renders correctly today -- no code change needed for the editor itself. Added a regression test proving the second measure starts right after the short one instead of being padded out, so this stays true going forward. While verifying this, found a real, separate gap: MidiImportService feeds imported notes through MeasureNormalizationService.NormalizeMeasures, which flattens the whole file into one stream and rechunks it into fixed-size measures from scratch, silently absorbing any real anacrusis in the source file. Documented in ROADMAP.md as its own scoped follow-up rather than fixed here, since reliably detecting an intended pickup from raw MIDI (versus a recording that just started off-beat) is real design work. Verified via the same sandbox pipeline as every prior change this session: dotnet build succeeds against the real project/package graph, dotnet format --verify-no-changes passes. dotnet test itself cannot execute in this sandbox; real confirmation of the new test comes from GitHub Actions CI. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Pguj4XSScE141p1ScWoqEr
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.
Summary
Continuing the Indonesian notasi angka gap list (
ROADMAP.md), the last of the "cheap to check"items (phase 10, pickup measure/birama gantung).
manually-entered short first measure touches: adding a measure
(
MeasureNavigationViewModel.ApplyAddMeasure) never checks that the previous one is "full", andboth playback scheduling (
ScoreMidiSchedule.GetMeasureDurationUnits) and MIDI export derive ameasure's length purely from its own notes' actual durations -- no fixed-beat-count assumption
anywhere in either path. So a deliberately short first measure already plays, exports, and
renders correctly today. Added a regression test
(
Build_PickupMeasure_SecondMeasureStartsRightAfterShortFirstMeasure) proving the secondmeasure starts right after the short one instead of being padded out, so this stays true going
forward.
measure.
MidiImportServicefeeds its raw note stream throughMeasureNormalizationService.NormalizeMeasures, which flattens the entire imported file intoone continuous stream and rechunks it into fixed-size measures from scratch -- silently
absorbing any real anacrusis in the source MIDI file. Documented in
ROADMAP.mdas its ownscoped follow-up rather than fixed here, since reliably detecting an intended pickup from raw
MIDI (versus a recording that just started off-beat) is real design work, not a quick fix.
Test plan
Verified via the same sandbox pipeline as every prior change this session:
dotnet buildsucceeds against the real project/package graph (0 errors/warnings).dotnet format --verify-no-changespasses.Not verified in this sandbox:
dotnet testitself cannot execute here (no WindowsDesktopruntime pack); real confirmation of the new test comes from GitHub Actions CI.
🤖 Generated with Claude Code
https://claude.ai/code/session_01Pguj4XSScE141p1ScWoqEr
Generated by Claude Code