I’ve put together a UDO called adsr140 that is based on the Doepfer A-140 envelope generator. It uses code by Nigel Redmon for its ADSR, but has been ported to Csound ORC code as well has the added ability to take in a retrigger signal.
To note: adsr140 uses positive values from signals for gate and retrigger as a gate on. (The examples use the lfo opcode with default sine as a gate and retrigger signal.)
The first example sounds use instr 1 which only uses the gate signal to trigger the adsr. The second example that comes in at 18 seconds uses instr 2 which uses both gate and retrigger.
Also to note, the code for adsr140 is using a-rate signals for gate and retrigger. It also requires Csound 6.04 as it uses a while-loop.
p.s. – Life’s been busy lately, but I plan to add this to Pink as soon as I have a chance.