Flex AHDSR Sustain: Normalized vs dB Values
-
I really like the new Flex AHDSR, but I noticed that its Sustain parameter ranges from 0.0 to 1.0.
In the previous regular AHDSR, Sustain ranged from -100 dB to 0 dB.
The issue is that I want to migrate a plugin that used the regular AHDSR to the Flex AHDSR, but the Sustain values don’t match. While I can easily update my preset values with a script, it becomes problematic if users save their own presets.
Would it be possible for the new Flex AHDSR to use dB for Sustain as before? Or perhaps include a toggle between normalized and dB values?
-
@bendurso O wait.. I realized there's function called Engine.getGainFactorForDecibels() I can use to convert dB to gain factor.
-
@bendurso yes and if you have problems with existing user presets from a previous version, you can add a user preset pre processing step that converts the sustain value when the user preset from an older version is loaded.
Be aware that the attack and decay times will also not translate 100% between the envelopes too.