First time here? Check out the FAQ!

How to inverse an envelope (e.g., ADSR) for a control signal (e.g. "Envelope" within Oscillator)?

0 votes
That's the question in brief and in full. I want a real-time ADSR control of the Envelope parameter within an Oscillator Sound. It works fine 'as is,' with just the ADSR pasted into the parameter field. I want to use the inverse signal (not reverse, but +/- inverse), but am not sure how to get this to work inside that field. Advice?  Thanks.
asked Dec 23, 2021 in Sound Design by bbelet (Practitioner) (310 points)

1 Answer

0 votes
Hey there,

addding '* -1' after the pasted sound should do the trick


[ADSR] * -1
answered Dec 24, 2021 by sean-flannery (Adept) (1,490 points)
I tried this, and some related variants, but I get "There is a problem in the Envelope parameter" error message when I attempt to Accept the new value to proceed. Is there something about this parameter that does not want a real-time computation combined with the pasted Sound itself?
  NOTE: The pasted ADSR works OK in this parameter field.
Sorry, was away from Kyma. I'd suggest adding a capital L after the ADSR but also, which field are you pasting into? and how are you triggering the ADSR?

If you're using the default ADSR (rather than ADSR Drag and Drop) and you're triggering it with the fake keyboard you might want to change the Velocity Value to 0.5 rather than 1 - because there is velocity rate scaling in all the time fields of the ADSR. Also, if you are pasting into the pitch field you will definitely have to multiply the inverted ADSR by the number of semitones bend you want.

I got this working using the following the the frequency field

!PitchNN nn + (([ADSR]L*-1)*!Scale nn)
Great answer, Sean.
An alternative approach might be to feed the ADSR into a ScaleAndOffset Sound. Set the Scale to -1 and the Offset to 1. Then you can paste it into the Envelope field without the "L" to get a full sample rate envelope.
The result will be full-on when the ADSR is 0 and 0 when the ADSR is at its maximum (if that's the behavior you're looking for)
The ScaleAndOffset approach worked fine - thanks SSC!  For Sean: I am pasting this sound into the Envelope parameter within a basic Oscillator Sound. It seems that this parameter is fine with a pasted Sound or a hot parameter control. But it does not like internal math (e.g. ADSR * -1). I'm not sure why this is the case.
  Anyway, using the ScaleAndOffset as suggested, I am able to accomplish the inverse math within that Sound, and then pasting it into the parameter field works fine. - BB