Waldorf Quantum/Iridium: convert the vibrato and the tremolo of a source - #372
Open
douglas-carmichael wants to merge 2 commits into
Open
Waldorf Quantum/Iridium: convert the vibrato and the tremolo of a source#372douglas-carmichael wants to merge 2 commits into
douglas-carmichael wants to merge 2 commits into
Conversation
The device cannot play an amplitude stage shorter than 0.07 seconds. A shorter one was therefore lifted to that length, so that it would not collapse into an instant stage, which snaps the VCA open and clicks when the audio does not start at a zero crossing. That lift was applied to every source. A sampled instrument, however, carries its attack in the audio itself and starts at silence, so there was nothing to click - the lift only faded the recorded attack in over 70 milliseconds and took the strike off every piano, plucked string and drum. An Akai S-1000 electric piano asks for 3 milliseconds and was written as 70, which is 23 times longer. The audio of the zones is now measured and the stage is only lifted when a zone really starts with a step which can be heard: more than 2 % of the peak level of that audio, the ratio at which the wrap of a loop becomes audible. The measurement runs only for a preset whose attack is short enough to be affected at all. Of the 117 presets of a commercial CD-ROM 78 regain their instant attack and 1 - whose audio starts at 3.5 % of its peak - keeps the lift. An instant attack is what the device uses for a percussive sound itself: 35 % of 141 presets written by an Iridium set the amplitude attack to 0.
The format was the last of the larger ones without any LFO support: a source which carries a vibrato or a tremolo lost it, and a preset of the device which has one was read without it. Both are routed through the modulation matrix. Of its 40 slots the first three already carry the pitch envelopes of the three oscillators, so the vibrato takes the slot 4 and the tremolo the slot 5 and the slots 6-40 as well as the LFOs 3-6 stay untouched for the user. The vibrato drives the destination "Pitch", which moves all three oscillators with a single slot instead of one slot per oscillator - a vibrato of a multi-sample belongs to the whole instrument and not to one of its layers. Reading also accepts the per-oscillator destinations "Osc1/2/3 Pitch", which a preset of the device may well use. The tremolo drives the destination "VCA". Its oscillator is written unipolar with a negative amount, so the modulation attenuates from the full level of the amplifier downwards; a bipolar one would press the first half of every cycle against the upper end of the amplifier and leave only the rectified half of the waveform. The depth is scaled with the loudness law of the device, where the maximum depth of the model (96 dB) becomes the swing from the full level down to silence - which is an amount of -99.6 % and therefore also the end of the range of a matrix slot. The waveform, rate, delay and fade-in use the laws of the sound engine, which were read from the firmware of an Iridium MK2 (4.0.5): the rate is 1/240 Hz + (100 Hz - 1/240 Hz) * x^4, the delay is 20 * x^2 seconds and the fade-in 10 * x^2 seconds. The quartic gives at the middle of its range 6.2539 Hz, which is the default the manual documents, and at zero the 240 seconds it documents as the slowest speed. The six shapes of the device map one to one onto the waveforms of the model. Every parameter the modulation depends on is written, so that the result does not depend on what the previously loaded preset left in that oscillator. An oscillator of a read preset which is synchronized to the tempo of the song is skipped, since a multi-sample carries no tempo with which its note lengths could be converted into Hertz.
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.
The Waldorf Quantum/Iridium was the last of the larger formats without any LFO support: a source which carries a vibrato or a tremolo lost it, and a preset of the device which has one was read without it. This adds both, in the creator and in the detector.
Where the modulation goes
The device has 6 low frequency oscillators and 40 modulation matrix slots. The slots 1-3 are already spent on the pitch envelopes of the three oscillators (
createPitchEnvelopeModulator, keyed to the oscillator index), so the two new modulations take the next free ones:Nothing has to give way: 5 of 40 slots and 2 of 6 LFOs is the most this creator ever writes, so the slots 6-40 and the LFOs 3-6 stay free for the user.
The vibrato uses the destination Pitch, which moves all three oscillators at once, rather than one slot per oscillator. That is one slot instead of three, and it matches what a vibrato of a multi-sample is - a property of the whole instrument, not of one of its layers. Reading also accepts the per-oscillator destinations
Osc1/2/3 Pitch, since a preset written on the device may well use them.The tremolo uses the destination VCA, the amplifier of the voice. Its oscillator is written unipolar with a negative amount, so the modulation attenuates from the full level downwards. A bipolar oscillator would press the first half of every cycle against the upper end of the amplifier and leave only the rectified half of the waveform audible - which is why the two modulations cannot share one LFO, the vibrato needs the bipolar swing around the played note.
The laws
The waveform, rate, delay and fade-in are converted with the laws of the sound engine, read out of the Iridium MK2 firmware (4.0.5). The parameter registrar at
0x100BE938names every QPAT parameter and hands it the function which formats its value; those formatters are the laws:1/240 Hz + (100 Hz - 1/240 Hz) * x^4- the quartic gives 6.2539 Hz at the middle of the range, which is the default the manual documents, and 240 seconds at zero, which is the slowest speed it documents20 * x^2seconds10 * x^2seconds[0] Sine [1] Triangle [2] Square [3] Saw (down) [4] Saw (up) [5] S&H- a one-to-one map ontoLfoWaveformThe vibrato depth converts the model's cent scale (
IEnvelope.MAX_ENVELOPE_DEPTH) to the ±24 semi-tones one matrix slot reaches. The tremolo depth is scaled with the loudness law of the device (dB = 40*log10(x), the oneOsc{n}Volalready uses), so a depth of 6 dB is an amount of -29.21 % and the maximum depth of the model, 96 dB, is -99.60 % - the swing from the full level down to silence, i.e. the end of the range of a slot. That the two ends coincide is the reason for using that law.Every parameter the modulation depends on is written explicitly (Speed, Sync, Global, Shape, Polarity, Phase, Delay, Attack, Decay), so the result does not depend on what the previously loaded preset left in that oscillator.
Two things are deliberately not carried:
Polymode. No source format fills that flag today, so honouring itsfalsedefault would put every converted preset on a free-running, voice-shared LFO, which is not what a vibrato or a tremolo of a sampled instrument does.What was verified
In software, with a build of this branch:
Tremolo: 4.00 Hz, depth 6.0 dB, delay 0.100 s, fade-in 0.800 sandVibrato: 5.50 Hz, depth +50 cents, delay 0.250 s, fade-in 1.500 scome back identically (the analysis details of-ad).Osc2 Pitchis correctly not applied to oscillator 1; a full-range tremolo reads back as exactly 96 dB; an over-range source is clamped (-9600 cents -> the -2400 the device can reach, 120 Hz -> 100 Hz, a 40 s delay -> 20 s).Lfo*and noMatrix*parameter at all, and the 141 presets of an Iridium library read with zero errors and zero spurious vibrato or tremolo - none of them routes an LFO to Pitch or VCA.Not verified on hardware: the scale of the VCA destination. The modulation matrix is additive in the destination's own normalized units (
ModMatrix::calcat0x100A1884:dest += source * (2*amount - 1), clamped), but the consumer which turns the VCA slot into a gain is not in the part of the firmware I decoded, so how many dB an amount of 100 % actually attenuates is inferred from the device's level law rather than read out of it. Everything else above is either firmware-exact or a round-trip result. I have an Iridium MK2 and can check the tremolo depth against the device.Base
Branched on top of #367 (
Waldorf Quantum/Iridium: keep the instant attack of a percussive sound), which touches the same creator - that PR's commit is the first of the two here. Merging #367 first leaves this one as a single commit.