Skip to content

Preserve detected rests in generated audio and lyric accompaniment #29

Closed

Description

@cchacs

Audited main at 69b3db6.

Both audio detection (chordr/audio_chords.py: detect_chords_from_chroma) and lyric harmonization (chordr/screen.js: _harmonizeMelody) omit silent runs/windows and emit onset-only chord events. _eventDuration then sustains each generated chord until the next onset, filling those omitted rests.

Reproduced the public lyric API with pitched tokens at start=0/duration=1 and start=10/duration=1. It generated notes at t=0 with sus=10, sustaining throughout the intervening empty windows. The audio path similarly discards each detected run's end index before generation.

Please carry run end/duration or explicit rests through these detection paths and honor them when generating notes. Keep the intentional next-onset behavior for authored chord sequences if required. Add tests for internal silence and trailing silence so accompaniment does not fill every detected gap.

Activity

  1. pullfrog commented on Oct 11, 2026

    @pullfrog
    Contributor
  2. pullfrog commented on Oct 11, 2026

    @pullfrog
    Contributor

    Opened #30 to fix #29: detected rests are now preserved instead of sustained over.

    • detect_chords_from_chroma emits each segment's own end (audio path), and _harmonizeMelody emits a per-window end capped at the melody's actual end.
    • _eventDuration honors an explicit end (clamped to the next onset and to lengthSeconds); authored chart chords without end keep the next-onset behavior.
    • Added internal- and trailing-silence tests on both paths (mutation-checked to fail without the fix).

    Suites: JS 106 pass, Python 20 pass. Docs updated and plugin.json bumped to 0.6.1.

    Task list (6/6 completed)
    • Carry run end through detect_chords_from_chroma (audio_chords.py)
    • Honor explicit event end in _eventDuration / _normaliseHarmonyEvents
    • Emit window end from _harmonizeMelody (trailing silence capped at melody end)
    • Add tests: internal + trailing silence (Python + JS)
    • Update docs (README, CHANGELOG, CLAUDE.md) and bump plugin.json
    • Run suites, self-review, push, open PR

    Pullfrog  | View workflow run | via Pullfrog | Using big-pickle (free) | 𝕏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions