Skip to content

Preserve sustain / loop-until-release loop mode across formats#155

Open
douglas-carmichael wants to merge 2 commits into
git-moss:mainfrom
douglas-carmichael:add-loop-until-release
Open

Preserve sustain / loop-until-release loop mode across formats#155
douglas-carmichael wants to merge 2 commits into
git-moss:mainfrom
douglas-carmichael:add-loop-until-release

Conversation

@douglas-carmichael

Copy link
Copy Markdown
Contributor

Summary

Adds a "loop until release" (sustain loop) flag to the shared sample-loop model so the distinction between a continuous loop and a sustain loop (loops while the key is held, then plays the remainder of the sample on release) is preserved across the formats that encode it, instead of always converting to a continuous loop.

ISampleLoop gains isLoopUntilRelease () / setLoopUntilRelease (boolean), defaulting to false (continuous). Continuous is what every creator wrote before, so the default keeps all existing conversions byte-identical - only sources that actually carry a sustain loop change.

Formats

Format Read Write On-disk representation
SoundFont 2 yes yes sample mode 1 (continuous) / 3 (sustain)
SFZ yes yes loop_continuous / loop_sustain
Renoise yes yes LoopRelease
NI Kontakt yes - until_release / until_end (the writer is template-based, so read only)
Elektron Tonverk preset + Elektron Multi yes yes keep-looping-on-release

Testing

Round-trips verified per zone: a continuous multi-sample stays continuous and a sustain variant survives as a sustain loop through SoundFont 2, SFZ, Renoise (XRNI) and Tonverk -> Tonverk. SF2 sampleModes confirmed as 1 vs 3 by inspecting the igen chunk.


Stacked on #153 (Elektron Tonverk preset), because it wires the Tonverk reader/writer whose files are added there. Until #153 merges, this PR's diff includes that commit; the loop-specific change is the single commit 3ba9e82. Once #153 is merged this branch will be rebased onto main so the diff reduces to only the loop change.

…iting

Reads all three generator machines (One-Shot, Multi, Drum) into the multi-sample model, including the amplitude envelope, the multi-mode filter and its envelope, sample loops, gain and panning. Writes a Multi or Drum machine preset (selectable, with an auto-from-source mode) using a neutral factory parameter template; samples are stored next to the preset and referenced relatively.

The existing ElektronMulti* classes (which handle the Tonverk .elmulti/.eldrum mapping files) are renamed to TonverkMulti* so the Elektron format family is named by device. The user-facing format name and CLI prefix are unchanged.
Add a 'loop until release' flag to the sample loop model (ISampleLoop)
that distinguishes a sustain loop - the loop runs while the key is held
and then plays the remainder of the sample on release - from a continuous
loop. The flag defaults to continuous, which matches the previous output
of every creator, so existing conversions are unchanged.

Read and write the distinction wherever the file format encodes it:
- SoundFont 2: sample mode 1 (continuous) vs 3 (sustain)
- SFZ: loop_continuous vs loop_sustain
- Renoise: LoopRelease
- NI Kontakt: until_release (read side)
- Elektron Tonverk preset and Elektron Multi: keep-looping-on-release
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant