Skip to content

Groove Synthesis 3rd Wave: read and write unified programs and multi-sample slots - #478

Merged
git-moss merged 7 commits into
git-moss:mainfrom
douglas-carmichael:add-third-wave-format
Sep 24, 2026
Merged

git-moss merged 7 commits into
git-moss:mainfrom
douglas-carmichael:add-third-wave-format

Conversation

@douglas-carmichael

@douglas-carmichael douglas-carmichael commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Adds the Groove Synthesis 3rd Wave as a source and a destination format.

The oscillators of the 3rd Wave play wavetables, analog waveforms and sample slots of up to eight mono samples. On its USB drive the device stores a slot as a multi-sample file (.bin, Import multisample) and a program together with the slots it plays as a unified program file (.pgdata, Import unified program data file), which is also the form in which Groove Synthesis distributes its sample library. Neither file format is documented; the layouts are described in documentation/design/THIRD_WAVE_FORMAT.md.

Reading. A unified program file becomes one multi-sample which plays like the program: every oscillator of a part which plays a sample slot becomes a group with the level (oscillator level x part volume), panning and tuning of its part, on the keys of the keyboard sections which the part plays and shifted by the transposition of its keyboard. A stereo program - two parts panned to both sides -, a split program and a program which layers several sounds therefore each arrive as one instrument. A slot of which the program does not play all samples is read on its own as well. A multi-sample file (versions 1, 4 and 5) becomes a multi-sample with the samples of its slot. Every sample becomes a zone with its key range, assigned note, fine tuning, volume, play range and loop with its cross-fade. Envelopes, filters, modulation and effects of a program are not converted. The format is listed, and selected when a file is picked, by the ending .pgdata; .bin, which many devices use (e.g. PADCONF.BIN of the Roland SP-404MK2), is read from a folder and from a picked file while the format is selected, and a file without the signature of the 3rd Wave is skipped.

Writing. By default a unified program file is written, so one import gives a playable program with all of its samples (Bulk unified program data import loads a whole folder). The program is the init program of the device - shipped as a resource in the device's own .pro text format; bank 5 of the 8M factory banks holds 49 copies of it - in which each part plays one sample slot:

  • Samples which play at the same time - the two channels of a stereo sample, or a second sound on the same keys - get parts of their own, panned like their samples.
  • A part gets the tuning which most of its samples share on its oscillator and the level of its loudest sample on the oscillator level and the part volume, so gains up to +10.6 dB leave the audio unchanged.
  • More than 8 samples are split into several slots, whose parts split the keyboard.
  • A program has 4 parts and cannot switch between velocity layers or round robins: the loudest velocity layer and the first round are written, and it is reported what is left out.
  • Samples which a source doubles are written once with the sum of their volumes. If a program still needs more than 4 parts, the layers which come last are left out, and the two sides of a stereo sample keep the same keys.

Alternatively (option Output, -p ThirdWaveOutputFormat=bin), one multi-sample file is written per slot, with all layers. For both, the samples are written as 16 bit mono at 10 to 48 kHz, with their key range limited to the two octaves around the assigned note which the device plays. All samples of a program need to fit into the 3.3 MB sample memory (35 seconds at 48 kHz), which is checked.

In the core, AbstractCreator#recalculateSamplePositions(IMultisampleSource, int, int) converts only the samples whose sample rate lies outside of a range, together with their loops, for destinations which play a limited range of sample rates.

Validation

  • The 45 programs of the manufacturer's sample library, the 19 unified programs of bank 5 of the factory banks and the six multi-sample files of the OS 1.8 sample presets are read exactly to their end. The version 4 multi-sample file S002_C15.bin is written back byte-identical.
  • All 64 programs, read as instruments, written as unified program files and read back, play the same samples with the same pitch, level, panning and loop on every key. The exceptions are the keys 116-120 of Randroid+Waves Mars, whose sample reaches further than the two octaves of the device, and 3 keys of CircuiT gL1tcH Drums, whose oscillator plays a fixed pitch.
  • The 18 programs of the library which layer or split parts keep what every key plays when written as DecentSampler or SFZ presets and read back, except one part of Hanger Drums and FM, whose tuning of +36.93 semitones the SFZ reader limits to 36.
  • 29 TAL-Sampler presets with up to three layers play the same on every key within the two octaves of the device.
  • 32 TAL-Sampler presets with up to four layers whose samples are encrypted (read with TAL Sampler: encrypted samples (*.talwav) are decrypted #460): 30 play the same on every key; one is larger than the sample memory, and one stacks 5 sounds, of which the 4 main ones are kept with both of its sides.
  • The written programs differ from the init program only in the oscillator references, levels and tuning, the part volume and panning and the keyboard split.

Open points, listed in the design document: which of two sample rates stored with a sample the device uses (they differ in 13 of 378 stock samples), the time law of the envelopes (needed to convert envelopes and filters), and to which keyboard section a split note belongs.

Not yet tested on hardware: the written files have not been loaded on a 3rd Wave.

The feature sheet has the rows for the format.

The oscillators of the 3rd Wave play sample slots (S00, S01, ...), which
hold up to 8 mono samples, each with its key range around an assigned
note, fine tuning, volume, play range and loop. The device stores a slot
as a multi-sample file (*.bin) and a program together with the slots and
wavetables it uses as a unified program file (*.pgdata).

Reading takes the multi-sample files (versions 1, 4 and 5) and the sample
slots of unified program files. Each slot becomes a multi-sample; key
range, assigned note, fine tuning, volume, play range and the loop with
its cross-fade are read, 'looping on when note on' as a loop which ends
at the release of the note. The settings of the program are not
converted.

Writing creates multi-sample files for 'Import multisample' and 'Bulk
multisample import'. Samples which do not fit into one slot - more than
8, layered samples like velocity layers or round robins, or more than the
sample memory - are written as further, numbered slots. The samples
become 16 bit mono with 10 to 48 kHz; a looped sample outside of that
range is converted together with its loop, for which
AbstractCreator#recalculateSamplePositions got a variant which takes a
range of sample rates. Coarse tuning moves the assigned note, the key
range is limited to two octaves around it and the gain is applied to the
audio, up to its peak level, since the format has no volume.

Tested with the files of the manufacturer: the 45 programs of the sample
library and the 19 unified programs of the factory banks are read to
their exact end (88 slots, 378 samples), as are the six multi-sample
files of the OS 1.8 sample presets; the version 4 file among them is
written back byte-identical. Written as multi-sample files, all 270
samples of the sample library keep audio, play range, loop, key range
and tuning, except for 31 equal-power cross-fades (written as equal
volume), five 12 bit settings and one key range beyond two octaves. The
written files are not yet verified on hardware.
A multi-sample file needs to be imported into a sample slot and a
program has to be set up to play it. A unified program file carries a
program together with the samples it plays and loads with a single
import, the way the sample library of the manufacturer is distributed.
It is now the default output; the multi-sample files remain available
with the new 'Output' option (-p ThirdWaveOutputFormat=bin).

The program is the init program of the instrument, stored as a resource
in the program file format of the instrument. Part N plays sample slot
N with its first oscillator at full level, its other oscillators are
silent. A multi-sample with more than 8 samples is split into up to 4
slots and the parts split the keyboard between them. Velocity layers and
round robins cannot be played by a program, only the first layer is
written. The samples store their gain as their volume (up to +6 dB)
instead of applying it to the audio. A program whose samples do not fit
into the sample memory of the device is not written.

Written as programs, the 65 slots of the sample library of the
manufacturer keep the audio, volume, play range, loop, key range and
tuning of all 270 samples, except for one key range beyond two octaves;
read back, the written programs differ from the init program only in
their oscillators and the split of the keyboard. The written files are
not yet verified on hardware.
… to parts

A unified program file is now read as one multi-sample which plays like
the program: each oscillator of a part which plays a sample slot becomes
a group with the level (oscillator level x part volume), panning and
tuning (coarse and fine tuning of the oscillator plus the fine tuning of
the part) of its part, on the keys of the keyboard sections which the
part plays, shifted by the transposition of its keyboard. Stereo
programs (two parts panned to both sides), split programs and layered
programs therefore arrive as one instrument instead of one multi-sample
per slot. An oscillator which does not follow the keyboard plays its
samples at a fixed pitch. A slot of which the program does not play all
samples is read on its own as well; a program whose parameters have an
unknown layout is read as its slots.

When a program is written, samples which play at the same time get
parts of their own: the two channels of a stereo sample, panned to both
sides, or a second sound on the same keys. A part gets the tuning which
most of its samples share on its oscillator and the level of its
loudest sample on the oscillator level and the part volume, so gains up
to +10.6 dB leave the audio unchanged. Samples are grouped by their
tuning as well if their assigned notes cannot take the difference. Parts
whose slots hold the same samples share one slot, and a layer whose
slots split the keyboard at other notes than the main layer plays all
sections which its samples reach. Velocity layers and round robins are
still reduced to the loudest layer and the first round.

All 64 stock programs, read as instruments, written as programs and read
back, play the same on every key except for the two-octave key range of
one stock sample and one oscillator with a fixed pitch; the 18 layered
programs of the sample library also keep what every key plays through
SFZ and DecentSampler.
… program

One part of 'Hanger Drums and FM' is tuned by +36.93 semi-tones, which the SFZ reader limits to 36 when the written preset is read back.
douglas-carmichael and others added 3 commits September 24, 2026 13:12
…hen parts run out

Samples which play the same audio in the same way on the same keys,
e.g. a layer which a preset doubles, are written as one sample with the
sum of their volumes: they sound the same and need one part instead of
two.

If the samples of a program still need more than its 4 parts, the parts
are given layer by layer - the first voice of each panning, then the
second one of each. In a layer, voices which are panned to both sides by
the same amount, e.g. the two channels of a stereo sample, come first
and get their slots together from the lowest one on, so both sides keep
the same keys. Before, the voices got parts in the order of their
panning, so the right channel of a stereo layer was the first to be left
out. A TAL-Sampler preset with a doubled layer on each side and two
centred sounds needed 7 parts and kept only the left side; it now needs
5 and keeps the left and the right layer and both centred sounds.
…ram files

The multi-sample files end with .bin, which many devices use, e.g. the
pad configuration of the Roland SP-404MK2 (PADCONF.BIN): picking such a
file selected the 3rd Wave as the source format. The format list and the
selection of the format by the ending of a picked file now use .pgdata,
the unified program files in which Groove Synthesis distributes its
sample library. The .bin files are read as before, from a folder and as
a picked file while the 3rd Wave is selected.
@git-moss
git-moss merged commit 4991a21 into git-moss:main Sep 24, 2026
git-moss added a commit that referenced this pull request Sep 25, 2026
…sample slots (#478)

* Groove Synthesis 3rd Wave: read and write the sample slots

The oscillators of the 3rd Wave play sample slots (S00, S01, ...), which
hold up to 8 mono samples, each with its key range around an assigned
note, fine tuning, volume, play range and loop. The device stores a slot
as a multi-sample file (*.bin) and a program together with the slots and
wavetables it uses as a unified program file (*.pgdata).

Reading takes the multi-sample files (versions 1, 4 and 5) and the sample
slots of unified program files. Each slot becomes a multi-sample; key
range, assigned note, fine tuning, volume, play range and the loop with
its cross-fade are read, 'looping on when note on' as a loop which ends
at the release of the note. The settings of the program are not
converted.

Writing creates multi-sample files for 'Import multisample' and 'Bulk
multisample import'. Samples which do not fit into one slot - more than
8, layered samples like velocity layers or round robins, or more than the
sample memory - are written as further, numbered slots. The samples
become 16 bit mono with 10 to 48 kHz; a looped sample outside of that
range is converted together with its loop, for which
AbstractCreator#recalculateSamplePositions got a variant which takes a
range of sample rates. Coarse tuning moves the assigned note, the key
range is limited to two octaves around it and the gain is applied to the
audio, up to its peak level, since the format has no volume.

Tested with the files of the manufacturer: the 45 programs of the sample
library and the 19 unified programs of the factory banks are read to
their exact end (88 slots, 378 samples), as are the six multi-sample
files of the OS 1.8 sample presets; the version 4 file among them is
written back byte-identical. Written as multi-sample files, all 270
samples of the sample library keep audio, play range, loop, key range
and tuning, except for 31 equal-power cross-fades (written as equal
volume), five 12 bit settings and one key range beyond two octaves. The
written files are not yet verified on hardware.

* Groove Synthesis 3rd Wave: write unified program files

A multi-sample file needs to be imported into a sample slot and a
program has to be set up to play it. A unified program file carries a
program together with the samples it plays and loads with a single
import, the way the sample library of the manufacturer is distributed.
It is now the default output; the multi-sample files remain available
with the new 'Output' option (-p ThirdWaveOutputFormat=bin).

The program is the init program of the instrument, stored as a resource
in the program file format of the instrument. Part N plays sample slot
N with its first oscillator at full level, its other oscillators are
silent. A multi-sample with more than 8 samples is split into up to 4
slots and the parts split the keyboard between them. Velocity layers and
round robins cannot be played by a program, only the first layer is
written. The samples store their gain as their volume (up to +6 dB)
instead of applying it to the audio. A program whose samples do not fit
into the sample memory of the device is not written.

Written as programs, the 65 slots of the sample library of the
manufacturer keep the audio, volume, play range, loop, key range and
tuning of all 270 samples, except for one key range beyond two octaves;
read back, the written programs differ from the init program only in
their oscillators and the split of the keyboard. The written files are
not yet verified on hardware.

* Groove Synthesis 3rd Wave: read programs as instruments, write layers to parts

A unified program file is now read as one multi-sample which plays like
the program: each oscillator of a part which plays a sample slot becomes
a group with the level (oscillator level x part volume), panning and
tuning (coarse and fine tuning of the oscillator plus the fine tuning of
the part) of its part, on the keys of the keyboard sections which the
part plays, shifted by the transposition of its keyboard. Stereo
programs (two parts panned to both sides), split programs and layered
programs therefore arrive as one instrument instead of one multi-sample
per slot. An oscillator which does not follow the keyboard plays its
samples at a fixed pitch. A slot of which the program does not play all
samples is read on its own as well; a program whose parameters have an
unknown layout is read as its slots.

When a program is written, samples which play at the same time get
parts of their own: the two channels of a stereo sample, panned to both
sides, or a second sound on the same keys. A part gets the tuning which
most of its samples share on its oscillator and the level of its
loudest sample on the oscillator level and the part volume, so gains up
to +10.6 dB leave the audio unchanged. Samples are grouped by their
tuning as well if their assigned notes cannot take the difference. Parts
whose slots hold the same samples share one slot, and a layer whose
slots split the keyboard at other notes than the main layer plays all
sections which its samples reach. Velocity layers and round robins are
still reduced to the loudest layer and the first round.

All 64 stock programs, read as instruments, written as programs and read
back, play the same on every key except for the two-octave key range of
one stock sample and one oscillator with a fixed pitch; the 18 layered
programs of the sample library also keep what every key plays through
SFZ and DecentSampler.

* Groove Synthesis 3rd Wave: design document, the SFZ round trip of one program

One part of 'Hanger Drums and FM' is tuned by +36.93 semi-tones, which the SFZ reader limits to 36 when the written preset is read back.

* Groove Synthesis 3rd Wave: combine doubled samples, keep both sides when parts run out

Samples which play the same audio in the same way on the same keys,
e.g. a layer which a preset doubles, are written as one sample with the
sum of their volumes: they sound the same and need one part instead of
two.

If the samples of a program still need more than its 4 parts, the parts
are given layer by layer - the first voice of each panning, then the
second one of each. In a layer, voices which are panned to both sides by
the same amount, e.g. the two channels of a stereo sample, come first
and get their slots together from the lowest one on, so both sides keep
the same keys. Before, the voices got parts in the order of their
panning, so the right channel of a stereo layer was the first to be left
out. A TAL-Sampler preset with a doubled layer on each side and two
centred sounds needed 7 parts and kept only the left side; it now needs
5 and keeps the left and the right layer and both centred sounds.

* Groove Synthesis 3rd Wave: the format is selected by the unified program files

The multi-sample files end with .bin, which many devices use, e.g. the
pad configuration of the Roland SP-404MK2 (PADCONF.BIN): picking such a
file selected the 3rd Wave as the source format. The format list and the
selection of the format by the ending of a picked file now use .pgdata,
the unified program files in which Groove Synthesis distributes its
sample library. The .bin files are read as before, from a folder and as
a picked file while the 3rd Wave is selected.

---------

Co-authored-by: Jürgen Moßgraber <juergen.mossgraber@googlemail.com>
git-moss added a commit that referenced this pull request Sep 25, 2026
…sample slots (#478)

* Groove Synthesis 3rd Wave: read and write the sample slots

The oscillators of the 3rd Wave play sample slots (S00, S01, ...), which
hold up to 8 mono samples, each with its key range around an assigned
note, fine tuning, volume, play range and loop. The device stores a slot
as a multi-sample file (*.bin) and a program together with the slots and
wavetables it uses as a unified program file (*.pgdata).

Reading takes the multi-sample files (versions 1, 4 and 5) and the sample
slots of unified program files. Each slot becomes a multi-sample; key
range, assigned note, fine tuning, volume, play range and the loop with
its cross-fade are read, 'looping on when note on' as a loop which ends
at the release of the note. The settings of the program are not
converted.

Writing creates multi-sample files for 'Import multisample' and 'Bulk
multisample import'. Samples which do not fit into one slot - more than
8, layered samples like velocity layers or round robins, or more than the
sample memory - are written as further, numbered slots. The samples
become 16 bit mono with 10 to 48 kHz; a looped sample outside of that
range is converted together with its loop, for which
AbstractCreator#recalculateSamplePositions got a variant which takes a
range of sample rates. Coarse tuning moves the assigned note, the key
range is limited to two octaves around it and the gain is applied to the
audio, up to its peak level, since the format has no volume.

Tested with the files of the manufacturer: the 45 programs of the sample
library and the 19 unified programs of the factory banks are read to
their exact end (88 slots, 378 samples), as are the six multi-sample
files of the OS 1.8 sample presets; the version 4 file among them is
written back byte-identical. Written as multi-sample files, all 270
samples of the sample library keep audio, play range, loop, key range
and tuning, except for 31 equal-power cross-fades (written as equal
volume), five 12 bit settings and one key range beyond two octaves. The
written files are not yet verified on hardware.

* Groove Synthesis 3rd Wave: write unified program files

A multi-sample file needs to be imported into a sample slot and a
program has to be set up to play it. A unified program file carries a
program together with the samples it plays and loads with a single
import, the way the sample library of the manufacturer is distributed.
It is now the default output; the multi-sample files remain available
with the new 'Output' option (-p ThirdWaveOutputFormat=bin).

The program is the init program of the instrument, stored as a resource
in the program file format of the instrument. Part N plays sample slot
N with its first oscillator at full level, its other oscillators are
silent. A multi-sample with more than 8 samples is split into up to 4
slots and the parts split the keyboard between them. Velocity layers and
round robins cannot be played by a program, only the first layer is
written. The samples store their gain as their volume (up to +6 dB)
instead of applying it to the audio. A program whose samples do not fit
into the sample memory of the device is not written.

Written as programs, the 65 slots of the sample library of the
manufacturer keep the audio, volume, play range, loop, key range and
tuning of all 270 samples, except for one key range beyond two octaves;
read back, the written programs differ from the init program only in
their oscillators and the split of the keyboard. The written files are
not yet verified on hardware.

* Groove Synthesis 3rd Wave: read programs as instruments, write layers to parts

A unified program file is now read as one multi-sample which plays like
the program: each oscillator of a part which plays a sample slot becomes
a group with the level (oscillator level x part volume), panning and
tuning (coarse and fine tuning of the oscillator plus the fine tuning of
the part) of its part, on the keys of the keyboard sections which the
part plays, shifted by the transposition of its keyboard. Stereo
programs (two parts panned to both sides), split programs and layered
programs therefore arrive as one instrument instead of one multi-sample
per slot. An oscillator which does not follow the keyboard plays its
samples at a fixed pitch. A slot of which the program does not play all
samples is read on its own as well; a program whose parameters have an
unknown layout is read as its slots.

When a program is written, samples which play at the same time get
parts of their own: the two channels of a stereo sample, panned to both
sides, or a second sound on the same keys. A part gets the tuning which
most of its samples share on its oscillator and the level of its
loudest sample on the oscillator level and the part volume, so gains up
to +10.6 dB leave the audio unchanged. Samples are grouped by their
tuning as well if their assigned notes cannot take the difference. Parts
whose slots hold the same samples share one slot, and a layer whose
slots split the keyboard at other notes than the main layer plays all
sections which its samples reach. Velocity layers and round robins are
still reduced to the loudest layer and the first round.

All 64 stock programs, read as instruments, written as programs and read
back, play the same on every key except for the two-octave key range of
one stock sample and one oscillator with a fixed pitch; the 18 layered
programs of the sample library also keep what every key plays through
SFZ and DecentSampler.

* Groove Synthesis 3rd Wave: design document, the SFZ round trip of one program

One part of 'Hanger Drums and FM' is tuned by +36.93 semi-tones, which the SFZ reader limits to 36 when the written preset is read back.

* Groove Synthesis 3rd Wave: combine doubled samples, keep both sides when parts run out

Samples which play the same audio in the same way on the same keys,
e.g. a layer which a preset doubles, are written as one sample with the
sum of their volumes: they sound the same and need one part instead of
two.

If the samples of a program still need more than its 4 parts, the parts
are given layer by layer - the first voice of each panning, then the
second one of each. In a layer, voices which are panned to both sides by
the same amount, e.g. the two channels of a stereo sample, come first
and get their slots together from the lowest one on, so both sides keep
the same keys. Before, the voices got parts in the order of their
panning, so the right channel of a stereo layer was the first to be left
out. A TAL-Sampler preset with a doubled layer on each side and two
centred sounds needed 7 parts and kept only the left side; it now needs
5 and keeps the left and the right layer and both centred sounds.

* Groove Synthesis 3rd Wave: the format is selected by the unified program files

The multi-sample files end with .bin, which many devices use, e.g. the
pad configuration of the Roland SP-404MK2 (PADCONF.BIN): picking such a
file selected the 3rd Wave as the source format. The format list and the
selection of the format by the ending of a picked file now use .pgdata,
the unified program files in which Groove Synthesis distributes its
sample library. The .bin files are read as before, from a folder and as
a picked file while the 3rd Wave is selected.

---------

Co-authored-by: Jürgen Moßgraber <juergen.mossgraber@googlemail.com>
git-moss added a commit that referenced this pull request Sep 26, 2026
…ead (#487)

* TAL Sampler: encrypted samples (*.talwav) are decrypted (#460)

* TAL Sampler: encrypted samples (*.talwav) are decrypted

The factory library of TAL-Sampler and many sample packs deliver their
samples as .talwav files, which the plug-in creates with 'Convert wav
Samples to talwav'. Such presets were rejected with 'Encrypted samples are
not supported'.

A .talwav file is the WAV file encrypted with Blowfish in ECB mode with a
fixed 72-byte key; the halves of a block are little-endian words and the
bytes behind the last whole block are not encrypted. The plug-in appends
to an existing file, so a file converted more than once holds several
copies; the first one is read, as the plug-in plays it.

Blowfish is implemented in file/Blowfish, since the cipher of the Java
Cryptography Architecture accepts keys of up to 56 bytes only. The format
is documented in documentation/design/TAL_SAMPLER_TALWAV_FORMAT.md.

* Clarify TAL-Sampler .talwav format documentation

Focus the design notes on decoder requirements, format behavior and interoperability verification.

* Processing: the note about clicking loops leaves loops with a cross-fade alone, like the snapping (#461)

The note about loops which click only skipped loops with a cross-fade of
at least 1% of the loop, while 'Snap loops which click' leaves every loop
with a cross-fade alone. A loop with a shorter cross-fade was therefore
skipped by the snapping ('0 adjusted') and reported by the note, which
recommended the snapping; 'Only loops which click' replaced its
cross-fade. Both now use the same check, so they always agree about a
loop, as the note was documented to do.

When the loops were snapped, the note now says that the loops it names
still click after the snapping instead of recommending it.

Co-authored-by: Jürgen Moßgraber <juergen.mossgraber@googlemail.com>

* TAL Sampler: a layer which is not switched through the filter plays unfiltered (#462)

TAL-Sampler has one filter and switches each layer through it or not. The
reader applied the filter to all layers if the first one is switched
through it and to none otherwise; 83 of the 1,675 presets on the test
machine filter only some of their layers. Only the zones of the layers
which are switched through the filter get it now, and the writer switches
only the layers through it whose zones have a filter.

Waldorf Quantum/Iridium: an oscillator whose zones have no filter while
other zones of the layer have one is written with the destination 'VCA',
which sends it directly to the amplifier, around the filter, and such an
oscillator is read without the filter. The filter, its wheel modulation
and its LFO are taken from the first zone which has a filter, and a
filtered and an unfiltered group are not merged into one oscillator.

Co-authored-by: Jürgen Moßgraber <juergen.mossgraber@googlemail.com>

* Waldorf Quantum/Iridium: warn when the groups of a preset do not fit into the layers, 2 layers by default (#463)

* Waldorf Quantum/Iridium: warn when the groups of a preset need more layers than the option allows

The writer puts every group which needs an oscillator of its own on one,
3 per layer, and adds the groups beyond the maximum number of layers of
the option to the last sample map. Entries which overlap in one sample
map alternate on successive notes instead of sounding together, so such a
preset silently played two of its layers alternately.

A warning now names the preset, the samples which are added and the
number of layers which keeps them apart - or that even the 4 layers of
the device are not enough. The written files do not change.

* Waldorf Quantum/Iridium: the maximum number of layers is 2 by default

With the default of 1 layer, a preset which needs more than the 3
oscillators of one layer played two of its groups alternately, e.g. 7 of
the 32 presets of Michael Oakley's TAL-Sampler pack. Every instrument of
the family plays 2 layers, and a preset which fits into one layer is
still written as one. An explicit setting of the replaced option which
leaves the second layer off still selects 1 layer.

The choices of the option say what they are for: '1 layer
(stackable)', '2 layers (all models)'. The tooltip of the author and the
bank is shorter, so that it fits on small screens.

---------

Co-authored-by: Jürgen Moßgraber <juergen.mossgraber@googlemail.com>

* TAL Sampler: the decay is much slower than the attack and the release (#464)

The decay of the envelopes was converted with the time law of the attack
and the release, 7.2 x^4 seconds. Rendered offline (4.7.2), the decay of
TAL-Sampler approaches the sustain level exponentially and much slower:
with a sustain of 0, the values 0.3 to 0.8 reach -6 dB after 0.11, 0.35,
0.70, 1.35, 2.70 and 4.56 seconds and every further 6 dB after the same
time again, and towards a sustain of 0.5 the time constant is the same.

A decay is now converted to the linear decay which reaches -20 dB at the
same moment as the one of the plug-in, 37.1 x^3.75 seconds (within 9 % of
the measurements), and written back with the inverse law. Sounds which
decay to silence were far too short, e.g. 'Casiowave' of Michael Oakley's
pack decayed in 0.12 instead of 0.8 seconds.

Co-authored-by: Jürgen Moßgraber <juergen.mossgraber@googlemail.com>

* DecentSampler: a preset with a repeated attribute could not be read (#471)

* DecentSampler: a preset with a repeated attribute could not be read

A preset which sets the same attribute twice on one element was rejected
by the XML parser and skipped as a whole, e.g. 'Could not parse XML
(line: 36, column: 54): Attribute "textColor" was already specified for
element "labeled-knob"'. DecentSampler loads such a preset: it is built
on JUCE, whose XML parser appends every attribute it reads and returns
the first one with the requested name. Presets are often written by
hand, where such a repetition is easy to produce - all seven presets of
Harry Zimm's 'Rare Akai AX73' carry a second 'textColor' on the reverb
knob of their user interface, and none of them could be converted.

A repeated attribute is now ignored and its first value used, for
preset files as well as for the presets inside a library. The line
breaks of the file are kept, so a further error is still reported at
its line, and the log names the attribute and the element. Presets
without a repetition are unchanged: the seven presets written by the
DecentSampler destination read back without a message.

* DecentSampler: a repeated attribute is only logged if it matters

The message about a repeated attribute was logged for every repetition,
also for the second 'textColor' on the reverb knob of the 'Rare Akai
AX73' presets, which only colours the user interface and makes no
difference to the conversion. It is now logged only if the two values
differ and the attribute is one which the conversion reads. With 'Log
unused XML elements and attributes' every repetition with a differing
value is logged. A repetition of the same value is never logged, since
either value gives the same result.

The table of the attributes which the conversion reads now also lists
the elements tag, effect, envelope, lfo and binding. Their attributes
were read with literal names or a private constant; they use the
constants of the table now.

---------

Co-authored-by: Jürgen Moßgraber <juergen.mossgraber@googlemail.com>

* DecentSampler: 'Create folder structure' reproduced a dsbundle as a folder (#472)

With 'Create folder structure', the presets of a dsbundle were written
into an output folder named like the bundle, e.g. 'Harry Zimms Rare
Akai AX73 Synthesizer.dsbundle/asgard.sfz', which the Finder shows as a
bundle file again; the DecentSampler destination with 'Create Bundle'
even nested its bundles inside it. A dsbundle is a folder which
DecentSampler treats as one file, like a dslibrary, whose presets
already went into the folder which contains the library file.

A detector can now declare a folder as a package which the format
treats as one file; such a folder is left out of the sub-path of the
output, its name is still used for the detection of the metadata like
any folder name. The DecentSampler detector declares the dsbundle. The
presets of a bundle go into the folder which contains the bundle, also
when the bundle is the selected source folder or has sub-folders. The
Contents dialog matches the folders of a file against the sub-path in
their order, since both do not match one to one any more, and shows
the bundle as the folder it is.

Co-authored-by: Jürgen Moßgraber <juergen.mossgraber@googlemail.com>

* SFZ: exclusive groups are read and written (group, off_by) (#475)

The exclusive groups of the model were neither written nor read, so
e.g. the open and closed hi-hats of a drum kit which was converted to
SFZ played on top of each other.

A region of an exclusive group now carries its number in the 'group'
and the 'off_by' opcode, so that the regions of the group switch each
other off. The opcodes are promoted to the group and global level like
the other opcodes. When reading, a region whose 'group' and 'off_by'
are equal gets that exclusive group. A region which is switched off by
another group than its own, e.g. an open hi-hat which the closed one
stops but not vice versa, cannot be expressed as an exclusive group and
is read without one.

Co-authored-by: Jürgen Moßgraber <juergen.mossgraber@googlemail.com>

* Processing: a sample which would clip after reducing the sample frequency is lowered (#476)

The band-limited conversion of the sample frequency overshoots at steep
edges, e.g. of square waves, therefore the audio of a sample which peaks
close to full scale exceeded the range of its bit depth and was clipped.
E.g. 150 of the 160 tone samples of the Speak & Music library, which
peak at about -1 dBFS, overshot by up to 1.5 dB when converted from
48 to 44.1 kHz.

The processing options now lower such a sample until it fits and add the
attenuation to the gain of its zone, so that its loudness stays the same.
The conversion which a destination format applies when writing its own
sample frequency cannot adjust the zone and still clips.

Co-authored-by: Jürgen Moßgraber <juergen.mossgraber@googlemail.com>

* Processing: the samples can be transposed onto the pitch they sound at (#477)

* Processing: the samples can be transposed onto the pitch they sound at

A sample library is often built from an instrument which was itself
transposed - another footage, a frequency ratio of one half or two, a
transposed patch - so that the recording which is mapped to C3 sounds one
or two octaves away from it. The mapping is faithful and the source plays
exactly the same way, but on the destination device the preset is then
played in another part of the keyboard than the player expects, and a
fixed transposition cannot fix a library in which only some presets are
affected.

The pitch of a sample is now measured and a note reports how far the
samples of a multi-sample sound from their root keys. The Transpose
processing option set to 'Auto' (-Zpa) moves the root keys of each
multi-sample onto its measured pitch; only the root keys are moved, the
audio, the key ranges and the tuning of the zones stay as they are.

The pitch is the highest fundamental whose harmonics hold at least 85% of
the power of the spectrum: a candidate an octave too low explains the same
partials but predicts harmonics between them which are not there, and one
an octave too high is only taken if the odd harmonics are practically
absent, which is then the pitch which is heard. It is measured in up to
twelve zones spread over the multi-sample, in the loop or in the loudest
part after the attack, and a result needs at least three measurable zones
of which at least 80% agree - material which is not clearly pitched and
kits whose zones are each rooted differently get no result.

* Manual: when to use the transposition to the measured pitch

Whether a transposition is wanted is a decision and not a defect - an
instrument is often played one or two octaves away from the key - so the
option is meant for the presets which need it and not for a whole library,
where it would move the bass patches as well. The note is logged without
the option, so a plain conversion already reports which presets sound away
from their keys, and every transposed multi-sample is logged with its
value.

---------

Co-authored-by: Jürgen Moßgraber <juergen.mossgraber@googlemail.com>

* Groove Synthesis 3rd Wave: read and write unified programs and multi-sample slots (#478)

* Groove Synthesis 3rd Wave: read and write the sample slots

The oscillators of the 3rd Wave play sample slots (S00, S01, ...), which
hold up to 8 mono samples, each with its key range around an assigned
note, fine tuning, volume, play range and loop. The device stores a slot
as a multi-sample file (*.bin) and a program together with the slots and
wavetables it uses as a unified program file (*.pgdata).

Reading takes the multi-sample files (versions 1, 4 and 5) and the sample
slots of unified program files. Each slot becomes a multi-sample; key
range, assigned note, fine tuning, volume, play range and the loop with
its cross-fade are read, 'looping on when note on' as a loop which ends
at the release of the note. The settings of the program are not
converted.

Writing creates multi-sample files for 'Import multisample' and 'Bulk
multisample import'. Samples which do not fit into one slot - more than
8, layered samples like velocity layers or round robins, or more than the
sample memory - are written as further, numbered slots. The samples
become 16 bit mono with 10 to 48 kHz; a looped sample outside of that
range is converted together with its loop, for which
AbstractCreator#recalculateSamplePositions got a variant which takes a
range of sample rates. Coarse tuning moves the assigned note, the key
range is limited to two octaves around it and the gain is applied to the
audio, up to its peak level, since the format has no volume.

Tested with the files of the manufacturer: the 45 programs of the sample
library and the 19 unified programs of the factory banks are read to
their exact end (88 slots, 378 samples), as are the six multi-sample
files of the OS 1.8 sample presets; the version 4 file among them is
written back byte-identical. Written as multi-sample files, all 270
samples of the sample library keep audio, play range, loop, key range
and tuning, except for 31 equal-power cross-fades (written as equal
volume), five 12 bit settings and one key range beyond two octaves. The
written files are not yet verified on hardware.

* Groove Synthesis 3rd Wave: write unified program files

A multi-sample file needs to be imported into a sample slot and a
program has to be set up to play it. A unified program file carries a
program together with the samples it plays and loads with a single
import, the way the sample library of the manufacturer is distributed.
It is now the default output; the multi-sample files remain available
with the new 'Output' option (-p ThirdWaveOutputFormat=bin).

The program is the init program of the instrument, stored as a resource
in the program file format of the instrument. Part N plays sample slot
N with its first oscillator at full level, its other oscillators are
silent. A multi-sample with more than 8 samples is split into up to 4
slots and the parts split the keyboard between them. Velocity layers and
round robins cannot be played by a program, only the first layer is
written. The samples store their gain as their volume (up to +6 dB)
instead of applying it to the audio. A program whose samples do not fit
into the sample memory of the device is not written.

Written as programs, the 65 slots of the sample library of the
manufacturer keep the audio, volume, play range, loop, key range and
tuning of all 270 samples, except for one key range beyond two octaves;
read back, the written programs differ from the init program only in
their oscillators and the split of the keyboard. The written files are
not yet verified on hardware.

* Groove Synthesis 3rd Wave: read programs as instruments, write layers to parts

A unified program file is now read as one multi-sample which plays like
the program: each oscillator of a part which plays a sample slot becomes
a group with the level (oscillator level x part volume), panning and
tuning (coarse and fine tuning of the oscillator plus the fine tuning of
the part) of its part, on the keys of the keyboard sections which the
part plays, shifted by the transposition of its keyboard. Stereo
programs (two parts panned to both sides), split programs and layered
programs therefore arrive as one instrument instead of one multi-sample
per slot. An oscillator which does not follow the keyboard plays its
samples at a fixed pitch. A slot of which the program does not play all
samples is read on its own as well; a program whose parameters have an
unknown layout is read as its slots.

When a program is written, samples which play at the same time get
parts of their own: the two channels of a stereo sample, panned to both
sides, or a second sound on the same keys. A part gets the tuning which
most of its samples share on its oscillator and the level of its
loudest sample on the oscillator level and the part volume, so gains up
to +10.6 dB leave the audio unchanged. Samples are grouped by their
tuning as well if their assigned notes cannot take the difference. Parts
whose slots hold the same samples share one slot, and a layer whose
slots split the keyboard at other notes than the main layer plays all
sections which its samples reach. Velocity layers and round robins are
still reduced to the loudest layer and the first round.

All 64 stock programs, read as instruments, written as programs and read
back, play the same on every key except for the two-octave key range of
one stock sample and one oscillator with a fixed pitch; the 18 layered
programs of the sample library also keep what every key plays through
SFZ and DecentSampler.

* Groove Synthesis 3rd Wave: design document, the SFZ round trip of one program

One part of 'Hanger Drums and FM' is tuned by +36.93 semi-tones, which the SFZ reader limits to 36 when the written preset is read back.

* Groove Synthesis 3rd Wave: combine doubled samples, keep both sides when parts run out

Samples which play the same audio in the same way on the same keys,
e.g. a layer which a preset doubles, are written as one sample with the
sum of their volumes: they sound the same and need one part instead of
two.

If the samples of a program still need more than its 4 parts, the parts
are given layer by layer - the first voice of each panning, then the
second one of each. In a layer, voices which are panned to both sides by
the same amount, e.g. the two channels of a stereo sample, come first
and get their slots together from the lowest one on, so both sides keep
the same keys. Before, the voices got parts in the order of their
panning, so the right channel of a stereo layer was the first to be left
out. A TAL-Sampler preset with a doubled layer on each side and two
centred sounds needed 7 parts and kept only the left side; it now needs
5 and keeps the left and the right layer and both centred sounds.

* Groove Synthesis 3rd Wave: the format is selected by the unified program files

The multi-sample files end with .bin, which many devices use, e.g. the
pad configuration of the Roland SP-404MK2 (PADCONF.BIN): picking such a
file selected the 3rd Wave as the source format. The format list and the
selection of the format by the ending of a picked file now use .pgdata,
the unified program files in which Groove Synthesis distributes its
sample library. The .bin files are read as before, from a folder and as
a picked file while the 3rd Wave is selected.

---------

Co-authored-by: Jürgen Moßgraber <juergen.mossgraber@googlemail.com>

* Waldorf Quantum/Iridium: a group gain above 0 dB is kept (#479)

The gain of a group is written as the volume of the oscillator which
plays it, and the same amount is taken off the entries of its sample
map so that it is not applied twice. The volume of an oscillator ends
at 0 dB, though: the part of a higher gain was clamped away there, but
still taken off the sample map, so it was lost. A DecentSampler preset
whose two layers are raised by 1.7 and 2.3 dB arrived that much quieter
and with the balance between its layers changed.

Only the part of a group gain up to 0 dB goes to the oscillator now; the
rest stays in the entries of the sample map, which carry a gain above
0 dB anyway. Read back, the presets keep the gain of every layer.

Co-authored-by: Jürgen Moßgraber <juergen.mossgraber@googlemail.com>

* * discoDSP Bliss
  * New: Added support for reading/writing version 3.8 - 3.20 features (round-robin, one-shot). Writing now always uses version 3.20.
  * New: Add support for LFOs (unfinished)
  * Fixed: Read version is now output in decimal not hexadecimal.
* Consolidation.

* Cleanup.

* DecentSampler: product presets (dsproduct) are read (#473)

A dsproduct file contains the XML document of a dspreset in a binary
container: the header DECENTSAMPLER001 followed by the document, which
is encrypted with Blowfish in ECB mode (little-endian block halves) and
padded to whole blocks. It is decoded in memory and read like a
dspreset, also inside of dslibrary files and dsbundle folders. Unknown
versions and truncated or damaged files are reported, the other presets
of a library are still read.

DecentSampler sends the stored values of the controls of the user
interface to the parameters which they are bound to when it loads a
preset, therefore these values are applied before the conversion, with
linear, table and fixed-value translations: amplitude envelope, volume,
pan, tuning, key and velocity tracking, enabling groups and tags, tag
volume and polyphony, filter frequency and resonance, the gain effect
and the amount and rate of modulators.

Further:
- The settings of the groups element and of a group are the defaults of
  their samples, e.g. velocity ranges which are set on the groups were
  ignored before.
- The pan of a sample replaces the one of its group, the pan offsets of
  the instrument and of a group (globalPan, groupPan) are added. The
  volume of the groups element, the tag volumes, the gain effects and
  the volume of the main output are applied.
- Groups and samples with a disabled tag are skipped like disabled
  groups.
- A sample without the amplitude envelope (ampEnvEnabled) becomes a
  one-shot, samples which silence each other with a tag (silencedByTags)
  an exclusive group.
- If a preset sets its amplitude envelope, the curves which are not set
  get the defaults of DecentSampler (logarithmic attack, exponential
  decay and release). Without any envelope setting the default envelope
  of the category is applied as before.
- The features which change the sound but cannot be converted, e.g. a
  convolution, are listed in one message per preset.

* DecentSampler: one-shots, exclusive groups and linear curves are written (#474)

* DecentSampler: product presets (dsproduct) are read

A dsproduct file contains the XML document of a dspreset in a binary
container: the header DECENTSAMPLER001 followed by the document, which
is encrypted with Blowfish in ECB mode (little-endian block halves) and
padded to whole blocks. It is decoded in memory and read like a
dspreset, also inside of dslibrary files and dsbundle folders. Unknown
versions and truncated or damaged files are reported, the other presets
of a library are still read.

DecentSampler sends the stored values of the controls of the user
interface to the parameters which they are bound to when it loads a
preset, therefore these values are applied before the conversion, with
linear, table and fixed-value translations: amplitude envelope, volume,
pan, tuning, key and velocity tracking, enabling groups and tags, tag
volume and polyphony, filter frequency and resonance, the gain effect
and the amount and rate of modulators.

Further:
- The settings of the groups element and of a group are the defaults of
  their samples, e.g. velocity ranges which are set on the groups were
  ignored before.
- The pan of a sample replaces the one of its group, the pan offsets of
  the instrument and of a group (globalPan, groupPan) are added. The
  volume of the groups element, the tag volumes, the gain effects and
  the volume of the main output are applied.
- Groups and samples with a disabled tag are skipped like disabled
  groups.
- A sample without the amplitude envelope (ampEnvEnabled) becomes a
  one-shot, samples which silence each other with a tag (silencedByTags)
  an exclusive group.
- If a preset sets its amplitude envelope, the curves which are not set
  get the defaults of DecentSampler (logarithmic attack, exponential
  decay and release). Without any envelope setting the default envelope
  of the category is applied as before.
- The features which change the sound but cannot be converted, e.g. a
  convolution, are listed in one message per preset.

* DecentSampler: one-shots, exclusive groups and linear curves are written

- A one-shot sample switches off its amplitude envelope
  (ampEnvEnabled="false"), with which DecentSampler plays it to its end.
  A looped sample is not written as a one-shot, since it would never
  stop then.
- The samples of an exclusive group carry a tag by which they silence
  each other (tags and silencedByTags). A sample keeps the tag which
  limits the number of voices.
- A curve of the amplitude envelope which is not set is logarithmic for
  the attack and exponential for the decay and the release in
  DecentSampler. The curves of an envelope are therefore always written,
  also a linear curve (0), which was left out and played curved.
- If all groups had the same amplitude envelope, it was written to every
  sample instead of once for the instrument (AbstractCreator
  .getAmpEnvelopeParamLevel returned the zone level). The envelope knobs
  of the user interface, which are bound to the instrument, then started
  at default values and did not change the sound.

---------

Co-authored-by: Jürgen Moßgraber <juergen.mossgraber@googlemail.com>

* Process dialog: list the loop options in the order they are applied (#480)

'Snap loops which click' now comes before the loop cross-fade, and the
check box next to the cross-fade reads 'Only loops which still click':
together they snap the loops which click and cross-fade only the loops
which snapping could not fix. The drop-down is labelled 'Cross-fade loops'
instead of 'Set fixed loop-crossfade', and the check box is disabled while
no cross-fade above 0% is selected, since it does nothing without one.

The log counts the loops which snapping moved instead of 'adjusted' ones,
the notes about clicking loops name 'Only loops which still click', and
loops which still click because they start at the beginning of their
sample get a note which says so.

* Loop click note: the movement of the waveform overflowed for 24 and 32 bit audio (#481)

The median frame-to-frame movement around a loop boundary was multiplied by the sample rate
with integers, which overflows for loud 24 and 32 bit audio, e.g. a median step of 74,000 at
48 kHz. The movement turned negative, so every jump above 2% of the level counted as a click:
the note reported such loops and the loop cross-fade for the loops which click was set on them.
After snapping, the 834 TAL-Sampler presets on the test machine report 124 instead of 456 loops,
nearly the 123 which they report when their samples are reduced to 16 bit.

* Processing: loops which wrap seamlessly are no longer cross-faded as clicking or snapped into a click (stacked on #480) (#482)

* Process dialog: list the loop options in the order they are applied

'Snap loops which click' now comes before the loop cross-fade, and the
check box next to the cross-fade reads 'Only loops which still click':
together they snap the loops which click and cross-fade only the loops
which snapping could not fix. The drop-down is labelled 'Cross-fade loops'
instead of 'Set fixed loop-crossfade', and the check box is disabled while
no cross-fade above 0% is selected, since it does nothing without one.

The log counts the loops which snapping moved instead of 'adjusted' ones,
the notes about clicking loops name 'Only loops which still click', and
loops which still click because they start at the beginning of their
sample get a note which says so.

* Loop click note: a loop only clicks if its wrap also breaks the curve of the waveform

The jump from the last frame of a loop to its first frame is large in a steep part of the
waveform even where the loop continues seamlessly, e.g. at the edge of a square or pulse wave.
Such loops were reported as clicking and got the loop cross-fade of 'Only loops which still
click', although 'Snap loops which click' leaves them alone as clean. A loop now only counts as
clicking if its wrap also breaks the curve of the waveform, which is the measure of the snapping.

* Snap loops which click: a loop which does not jump is not moved to a position which jumps

The snapping measures the bend of the waveform at the loop point, and a loop whose last frame
repeats its first frame bends a little there. The nearest zero-crossings of a pulse wave can be
half of its level apart, so such a seamless loop was moved to a position which jumps at every
repeat. A position which jumps at the loop point is not taken anymore for a loop which does not
jump there, measured like the note about clicking loops measures the jump.

---------

Co-authored-by: Jürgen Moßgraber <juergen.mossgraber@googlemail.com>

* Ableton: Live Packs (ALP) and Live Sets (ALS) are read (#483)

Live Packs are the files in which Live content is sold and shared, e.g. the
Sampler and Simpler instruments of issue #227. They are now read directly,
without unpacking them in Live first: the Sampler and Simpler devices of all
presets and Live Sets in a pack are converted with the samples from the pack,
which stores them compressed with FLAC; they are decoded when they are read.
A pack which is compressed as a whole with GZIP is de-compressed into a
temporary file, which is deleted when the next detection starts or the
application ends. Presets which older packs store in the binary format of
older Live versions (e.g. packs from 2008 and 2009) are counted and reported.

A Live Set delivers every Sampler and Simpler on its tracks, also in racks,
named after the Live Set and the track; devices without samples are left out.

Also fixed:
- Presets stored as plain XML instead of compressed XML were rejected with
  'Not in GZIP format', e.g. all 23 kits of the '80s hits' pack of Subsocial
  Studios.
- The samples of presets and Live Sets saved with Live 10 or earlier were not
  found, since these versions store the path of a sample as a list of folders
  with the name of the file separately.
- A rack preset without any Sampler or Simpler reports 'Not a sampler preset
  file.' like a device preset of another instrument, instead of nothing.

* AIFF: files with 32-bit floating-point sound data (AIFC 'fl32') are read

AIFC files whose sound data is 32-bit floating-point ('fl32') were rejected
as if they were compressed, e.g. the sample 'Clave Synth' of the Core Library
of Ableton Live, which its rack 'Percussion Spirit Kit' plays, and the spring
impulse response of Ableton's 'Convolution Reverb' pack. The data is plain
big-endian IEEE float; it is now converted from the chunks like the other
AIFC files, into a WAV file with IEEE float data.

The converted audio is identical, sample for sample, to the source and to
what macOS decodes from the same files. The 325 integer AIFF and AIFC samples
which the Sample Files source converts from the multi-samples of the Core
Library are written byte-identically as before.

* Adapted to latest code changes. Ready to merge.

* Update for merge.

---------

Co-authored-by: Jürgen Moßgraber <juergen.mossgraber@googlemail.com>
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.

2 participants