Cabbage Logo
Back to Cabbage Site

Retrigger an envelope in release stage

Hello! I would like to ask if it is possible to retrigger an amplitude envelope like madsr or linsegr in a monosynth (maxalloc 1, 1). when a new key is pressed even though the release stage has not finished. I see that new notes cannot be triggered until the previous note has finished its release stage. It is possible to change it?
It’s like they new notes can’t be placed in the same instance of the instrument until the release is finished

You can do this using the reinit opcode, which is explained quite well in this. Or you can use the new trigger linseg/expseg opcodes.

Thanks for the answer.
I will try reinit. I´ve try to test the “triglinseg/trigexpseg” opcodes in Cabbage and it seems that they are not recognized. The console says:" error: syntax error, unexpected T_IDENT (token “trigexpseg”) from file…" When I write “triglinseg” or “trigexpseg” the letters turn red as with the other opcodes but the arguments are not show in the upper line of the console. I mention it because I have seen that they are your opcodes. I have also tried to copy and paste the examples in an empty file but it seems that it is not recognized
I´ve deleted and reinstalled the last version of Cabbage with the Csound version that cames with Cabbage to check if it was outdated but it is the same.

Are you in windows by any chance? I’m not at a PC right now but if you search the Csound GitHub issue tracker you’ll find a link to a window build that has them. If you can’t find it I’ll post the link when I’m next at the PC. I’m in Easter holiday mode so access to a PC is limited 🤦

Yes I´m on a windows machine. I´ve found the windows build and now it works. Thank you for the solution.
The opcodes work nice. They do not have an auto-release stage like the linesgr and the variants that ends with “r”, anyway I think that I could make something for the release stage in combination with “xtrim” and “release”.Also it would be a great addition to Csound to have a “triglinsegr/trigexpsegr” variants.
For me it is something that remain modular synths, the ability to trigger the envelope not only with the keyboad but also with an Lfo, or sequencer. For live use it´s cool.

Have you considering triggering the synth instrument from another instrument using one of the event opcodes? This might give you better results. I’m not sure how an ‘r’ version of the triglinseg would work. But you could feed a gate signal to it from another location, and use it to trigger the envelope? Something like this below, where “gateSignal” is being generated in another instrument?

instr 1
kGate chnget “gateSignal”
kEnv linsegtrig kGate …
a1 oscill kEnv …
outs a1, a1

Thank you for the info. I din´t know about that possibility, I will check that option.
What I’ve found of the possible options so far that is most closely of what I was lookint for is an UDO called “Adsr140”. Or maybe the easiest for me in this moment. It resembles a modular synth envelope that can be retriggered in an easy way, and actually appears to be based on an actual Doepfer synth module. In combination with madsr as a secondary envelope for the midi release it works well.

I knew Steven has written something like this but I couldn’t find it. Thanks for posting the link :grinning:

Hello, where is the link to the builds that allow the use of those opcodes? I can’t seem to find it on the GitHub issue tracker

Here you go:

The github actions builds are a little tricky to find!