Preserve sustain / loop-until-release loop mode across formats#155
Open
douglas-carmichael wants to merge 2 commits into
Open
Preserve sustain / loop-until-release loop mode across formats#155douglas-carmichael wants to merge 2 commits into
douglas-carmichael wants to merge 2 commits into
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
ISampleLoopgainsisLoopUntilRelease ()/setLoopUntilRelease (boolean), defaulting tofalse(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
loop_continuous/loop_sustainLoopReleaseuntil_release/until_end(the writer is template-based, so read only)keep-looping-on-releaseTesting
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
sampleModesconfirmed as 1 vs 3 by inspecting theigenchunk.