Repository navigation
Preserve detected rests in generated audio and lyric accompaniment (#29) - #30
Conversation
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (3 files)
Previous Review Summary (commit 8506ea4)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit 8506ea4)Status: No Issues Found | Recommendation: Merge Files Reviewed (7 files)
Reviewed by free · Input: 36.5K · Output: 1.9K · Cached: 115.4K |
cchacs
left a comment
There was a problem hiding this comment.
Needs fixing: a 20 ms chord becomes 100 ms, extending into the rest. Reproduced from the actual function.
|
Fixed the reviewer's repro: Change in Verified: Task list (6/6 completed)
|
The previous finding is fixed: explicit 20 ms chords retain their duration, with a regression test added. No new blocking findings. Verified locally: 107 JavaScript tests and 20 Python tests passed.

Closes #29.
Both chord sources dropped the end of each detected segment and emitted onset-only events, so
_eventDurationsustained every generated chord until the next onset and filled the rests in between. This carries each segment's own end through detection and honors it during generation.Changes
chordr/audio_chords.py—detect_chords_from_chromanow returns{"t", "name", "end"}per segment.endis the run's own end (the next frame's onset, or one frame past the last onset for a run reaching the end of the analysis), so internal and trailing silence in the input survives.chordr/screen.js_normaliseHarmonyEventscarries an optionalendthrough to generation._eventDurationhonors an explicitendinstead of always holding to the next onset, clamped to the next onset and tolengthSeconds._harmonizeMelodyemitsendper window (min(winEnd, lastEnd)), so a silent window is a rest and the final window stops where the melody ends.endkeep the existing next-onset behavior.Tests
events[0].endat the silence, not the next onset) and trailing silence is preserved.endstops a chord before the next onset; not extended bylengthSeconds; capped bylengthSecondsand the next onset; the audio path honors detected run ends; harmonization does not sustain across silent windows and stops at melody end.Mutation-checked each new test against the old behavior to confirm it fails without the fix.
node --test tests/*.test.js→ 106 pass;python3 -m unittest discover -s tests -p 'test_*.py'→ 20 pass.Docs (
README,CHANGELOG,CLAUDE.md) updated andplugin.jsonbumped to0.6.1.big-pickle(free) | 𝕏