When the release opcode returns 1, is there any way to know how much extra time has been added by the various envelope opcodes like mxadsr or is this something I need to keep track of myself? I feel like the release time is known by Csound internally, but I’m not seeing an opcode that lets me get that value.
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
I see that lastcycle is documented as taking the envelope release time into consideration for the linesegr and xtratim opcodes, but it does not seem to take the mxadsr opcode’s release time into account when driving the instrument from MIDI. Is this expected?
yep, there isn’t an opcode, but the time added to the performance is the largest of all of the extra times employed.
An opcode would be handy though
Prof. Victor Lazzarini
Maynooth University
Ireland
mxadsr is based on expsegr afaik (basically a frontend to it) so it should work similarly.
Prof. Victor Lazzarini
Maynooth University
Ireland
Do you have an example to test? Internally csound does not make any difference between linsegr or any other time extending envelopes. Always the longest of the envelopes sets the extra time. lastcycle will only not fire if the note is turned off without release, which should not be the case for midi events.
If you need to be notified when a note has actually stopped, I would recommend atstop:
https://csound-plugins.github.io/csound-plugins/opcodes/atstop.html
Csound mailing list Send bugs reports to Discussions of bugs and features can be posted here
Ok, thank you for the information. I was not able to reproduce the issue in an example, but the effort showed me what I was doing wrong; the UDO with lastcycle in it was being called before the UDO with madsr in it. Switching the order of the UDOs fixed the problem I was seeing in my instrument.