Skip to content

Variable hybrid clip length #48

Description

@britle20

Feature Spec

Related feature document: docs/features/19-variable-hybrid-clip-length.md

Goal

Allow hybrid clips to be 1, 2, or 4 bars long instead of fixed to 1 bar.

Context

Musical time is tick-based with PPQ 480. A 4/4 bar is 1920 ticks, so 2 bars is 3840 ticks and 4 bars is 7680 ticks.

Scope

Included:

  • Clip length control for 1, 2, and 4 bars.
  • Store clip length as lengthTicks.
  • Derive drum and piano roll grids from clip length.
  • Use clip length for PAT loop playback and arrangement default instance length.
  • Safely handle shortening when events would fall outside the new length.

Excluded:

  • Arbitrary clip lengths.
  • Other time signatures.
  • Per-clip tempo.
  • Time-stretching.

Constraints

  • Keep event positions in ticks.
  • Preserve existing 1-bar behavior.
  • Keep UI rendering separate from audio scheduling.

Done when

  • 1, 2, and 4 bar clips can be edited and played.
  • Events cannot silently exist outside the selected clip length.
  • Existing 1-bar clips still work.

Verification

  • npm run typecheck --if-present
  • npm run lint --if-present
  • npm run test --if-present
  • npm run build --if-present

Notes

Planning created from the agentic workflow discuss-feature process.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions