Skip to content

feat(sampler): Polyphonic voice allocation, live internal resampling, and multi-velocity layers #331

Description

@delaudio

Overview & Motivation

The current trk-sampler is primarily focused on monophonic sample triggers per track. Expanding the sampler engine with polyphonic voice stealing, internal live resampling, and multi-velocity keyzones makes trk capable of producing lush acoustic pianos, pads, chords, and SP-404 style sound design.

Proposed Features

  1. Polyphonic Voice Allocation (4 to 16 voices per track):
    • Configurable polyphony modes: Mono, Legato, Poly 4, Poly 8, Poly 16.
    • Intelligent voice stealing strategies: Oldest, Lowest Volume, Same Note Retrigger.
  2. Internal Live Resampling (SP-404 / Elektron Style):
    • Ability to record pattern or master audio output internally directly into an empty sample slot.
    • 1-key bounce: resample active pattern with all active DSP effects into a new WAV loop.
  3. Multi-Velocity Sample Layering:
    • Assign multiple WAV files across velocity zones (e.g. Vel 0-63 soft hit, Vel 64-127 hard hit).
    • Support for basic SFZ multi-sample mapping descriptors.

Acceptance Criteria

  • Sampler tracks can trigger and sustain multiple overlapping voices simultaneously.
  • Voice stealing gracefully avoids audio clicks using sub-millisecond fade-outs.
  • Resampling captures internal audio cleanly into an allocated sample slot.
  • Velocity layering selects appropriate sample based on note velocity.
  • Audio unit tests covering voice allocation and resampling buffer accuracy.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions