Skip to content

TAL Sampler: read the pitch envelope depth from the correct matrix row#223

Merged
git-moss merged 1 commit into
git-moss:mainfrom
douglas-carmichael:fix-tal-pitch-env-source
Jul 25, 2026
Merged

TAL Sampler: read the pitch envelope depth from the correct matrix row#223
git-moss merged 1 commit into
git-moss:mainfrom
douglas-carmichael:fix-tal-pitch-env-source

Conversation

@douglas-carmichael

Copy link
Copy Markdown
Contributor

The lookup which finds the modulation routing envelope 3 to the global pitch combines its two conditions with a logical OR instead of an AND:

if (modulator.isSource (SOURCE_ID_ENV3) || modulator.isDestination (DEST_ID_TUNE_A, DEST_ID_MASTER_TUNE))

so it accepts the first row which is either sourced from envelope 3 or targets a tuning parameter, and takes its amount as the depth of the pitch envelope. The two comparable lookups in the same method (isDestination (VOLUME_A) && isSource (VELOCITY) and isDestination (CUTOFF) && isSource (VELOCITY)) use AND, so this one is the outlier.

The practical effect is that a row like LFO → Master Tune supplies the depth of a pitch envelope which the preset does not have.

Measured

The 214 TAL Sampler presets of the Goldbaby BlueWave library:

presets
no envelope 3 → tuning row exists, but a depth of 0.5–1.0 is taken from another row 207
such a row exists, but a different row is read first 7
unaffected 0

The row picked up instead is the same one in almost every case — source id 3 targeting Master Tune, in presets named …RiseLFO…, …FallLFO…, …randLFO….

Converting one folder of eight presets to SFZ, before and after:

zones with a pitch envelope
before 1006, at depths of 5359 to 12000 cent (4.5 to 10 octaves)
after 296

Six of the eight presets lose the pitch envelope completely, which is correct — they have no envelope 3 to tuning modulation. The remaining two really do have one and keep their envelope, now with the amount of the correct row. Nothing other than the pitch envelope differs between the two runs.

Note

Found while auditing the readers for a related question on #216 (whether a modulation amount that is gated behind a controller can be read as one which is always applied). This one is independent of that PR and of the format's mod matrix having no "via" column — it is purely the operator.

The lookup for the modulation which routes envelope 3 to the global
pitch combined its two conditions with a logical OR instead of an AND,
so it accepted the first row which was either sourced from envelope 3
or targeted a tuning parameter. A row such as an LFO to Master Tune
therefore supplied the depth of the pitch envelope.

Measured on the 214 TAL Sampler presets of the Goldbaby BlueWave
library: 207 of them have no envelope 3 to tuning modulation at all, yet
a depth between 0.5 and 1.0 was taken from an LFO row, and the remaining
7 read a different row than the intended one - so every preset of the
library was affected. Converting the eight presets of one folder to SFZ
removes 710 of 1006 pitch envelopes, which were sweeping the pitch by
4.5 to 10 octaves; the two presets which really do modulate the tuning
with envelope 3 keep theirs and now use the correct depth. Nothing but
the pitch envelope changes.
@git-moss
git-moss merged commit 7784f2f into git-moss:main Jul 25, 2026
@douglas-carmichael
douglas-carmichael deleted the fix-tal-pitch-env-source branch July 25, 2026 14:10
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