[Csnd] Perform an action at the end of a note
Date | 2020-05-26 11:18 |
From | "Jeanette C." |
Subject | [Csnd] Perform an action at the end of a note |
Hey hey, I'd like to change a control signal at the end of a note, so just before an instance of an instrument shuts off. One solution would be to schedule/event a call to another instrument to achieve that, but can you think of a way to get the same result within the instrument (efficiently)? I try to implement a kind of semaphore, counting how many sources feed one channel (chn* family). The count is written to another channel, names are programatic so keeping track of the count on the sink/channel reading side is easy enough. Best wishes and thanks for any tips, Jeanette -- * Website: http://juliencoder.de - for summer is a state of sound * Youtube: https://www.youtube.com/channel/UCMS4rfGrTwz8W7jhC1Jnv7g * SoundCloud: https://soundcloud.com/jeanette_c * Twitter: https://twitter.com/jeanette_c_s * Audiobombs: https://www.audiobombs.com/users/jeanette_c * GitHub: https://github.com/jeanette-c If there's nothing missing in my life Then why do these tears come at night <3 (Britney Spears) 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 |
Date | 2020-05-26 11:54 |
From | Eduardo Moguillansky |
Subject | Re: [Csnd] Perform an action at the end of a note |
there's an opcode for that: https://csound-plugins.github.io/csound-plugins/opcodes/atstop.html On 26.05.20 12:18, Jeanette C. wrote: > Hey hey, > I'd like to change a control signal at the end of a note, so just > before an instance of an instrument shuts off. > > One solution would be to schedule/event a call to another instrument > to achieve that, but can you think of a way to get the same result > within the instrument (efficiently)? > > I try to implement a kind of semaphore, counting how many sources feed > one channel (chn* family). The count is written to another channel, > names are programatic so keeping track of the count on the > sink/channel reading side is easy enough. > > Best wishes and thanks for any tips, > > Jeanette > 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 |
Date | 2020-05-26 12:06 |
From | Hlöðver Sigurðsson |
Subject | Re: [Csnd] Perform an action at the end of a note |
looks like pretty useful plugin, nice On Tue, 26 May 2020 at 12:55, Eduardo Moguillansky <eduardo.moguillansky@gmail.com> wrote: there's an opcode for that: |
Date | 2020-05-26 12:22 |
From | "Jeanette C." |
Subject | Re: [Csnd] Perform an action at the end of a note |
May 26 2020, Eduardo Moguillansky has written: > there's an opcode for that: > https://csound-plugins.github.io/csound-plugins/opcodes/atstop.html This does look interesting. Though the technique remains: call another instrument to perform the required action. Thanks and best wishes, Jeanette > > On 26.05.20 12:18, Jeanette C. wrote: >> Hey hey, >> I'd like to change a control signal at the end of a note, so just before an >> instance of an instrument shuts off. >> >> One solution would be to schedule/event a call to another instrument to >> achieve that, but can you think of a way to get the same result within the >> instrument (efficiently)? >> >> I try to implement a kind of semaphore, counting how many sources feed one >> channel (chn* family). The count is written to another channel, names are >> programatic so keeping track of the count on the sink/channel reading side >> is easy enough. >> >> Best wishes and thanks for any tips, >> >> Jeanette >> > > 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 > -- * Website: http://juliencoder.de - for summer is a state of sound * Youtube: https://www.youtube.com/channel/UCMS4rfGrTwz8W7jhC1Jnv7g * SoundCloud: https://soundcloud.com/jeanette_c * Twitter: https://twitter.com/jeanette_c_s * Audiobombs: https://www.audiobombs.com/users/jeanette_c * GitHub: https://github.com/jeanette-c If there's nothing missing in my life Then why do these tears come at night <3 (Britney Spears) 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 |
Date | 2020-05-26 12:24 |
From | Eduardo Moguillansky |
Subject | Re: [Csnd] Perform an action at the end of a note |
Within the instrument you can also use "lastcycle" : https://csound.com/docs/manual/lastcycle.html On 26.05.20 13:22, Jeanette C. wrote: > May 26 2020, Eduardo Moguillansky has written: > >> there's an opcode for that: >> https://csound-plugins.github.io/csound-plugins/opcodes/atstop.html > This does look interesting. Though the technique remains: call another > instrument to perform the required action. > > Thanks and best wishes, > > Jeanette >> >> On 26.05.20 12:18, Jeanette C. wrote: >>> Hey hey, >>> I'd like to change a control signal at the end of a note, so just >>> before an instance of an instrument shuts off. >>> >>> One solution would be to schedule/event a call to another instrument >>> to achieve that, but can you think of a way to get the same result >>> within the instrument (efficiently)? >>> >>> I try to implement a kind of semaphore, counting how many sources >>> feed one channel (chn* family). The count is written to another >>> channel, names are programatic so keeping track of the count on the >>> sink/channel reading side is easy enough. >>> >>> Best wishes and thanks for any tips, >>> >>> Jeanette >>> >> >> 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 >> > 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 |
Date | 2020-05-26 20:26 |
From | Pete Goodeve |
Subject | Re: [Csnd] Perform an action at the end of a note |
Attachments | None |
Date | 2020-05-26 20:36 |
From | joachim heintz |
Subject | Re: [Csnd] Perform an action at the end of a note |
i never understood the difference between "lastcycle" and "release": https://csound.com/docs/manual/release.html On 26/05/2020 21:26, Pete Goodeve wrote: > On Tue, May 26, 2020 at 01:24:06PM +0200, Eduardo Moguillansky wrote: >> Within the instrument you can also use "lastcycle" : >> https://csound.com/docs/manual/lastcycle.html >> > Probably should point out that this didn't make it into > the 6.14 manual index, or the release notes, of the > last release on Jan 24 (though the relevant page is > present in the set). Not sure why, as the commit > adding it to the index was on Jan 9. > > Sounds like an opcode I'ver needed a few times! > > -- Pete -- > > 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 > 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 |
Date | 2020-05-26 22:22 |
From | Kevin Welsh |
Subject | Re: [Csnd] Perform an action at the end of a note |
I assume (dangerous, I know!) that "lastcycle" will only trigger *after* the entire release stage has completed and the instrument will not conduct a single k-rate cycle more, whereas "release" would trigger at the start of the release cycle, allowing other control events to occur while the note releases for however long that release cycle may be? I haven't done a whole lot with either opcode, so I don't really know for sure. On Tue, May 26, 2020 at 3:36 PM joachim heintz <jh@joachimheintz.de> wrote: i never understood the difference between "lastcycle" and "release": |
Date | 2020-05-27 01:18 |
From | Pete Goodeve |
Subject | Re: [Csnd] Perform an action at the end of a note |
Attachments | None |
Date | 2020-05-27 06:56 |
From | Eduardo Moguillansky |
Subject | Re: [Csnd] Perform an action at the end of a note |
The use case for lastcycle is this: Imagine there is an event which already has a release envelope, for example with linsegr. This event is triggered via midi or osc and you need to notify some other instrument that the event has finished. If you use release you will notify it too early. You can calculate how long the longest release time of your instrument is, quantize it to the nearest k-cycle and calculate when that last cycle will be so that you accurately perform an action there, or use a schedulek event triggered at the first release, etc. Or you can use lastcycle, which does all this. "atstop" is an external opcode which can be even more accurate because it triggeres at deinit time so it will always catch when the event has finished. On 27.05.20 02:18, Pete Goodeve wrote: > On Tue, May 26, 2020 at 05:22:49PM -0400, Kevin Welsh wrote: >> I assume (dangerous, I know!) that "lastcycle" will only trigger *after* >> the entire release stage has completed and the instrument will not conduct >> a single k-rate cycle more, whereas "release" would trigger at the start of >> the release cycle, allowing other control events to occur while the note >> releases for however long that release cycle may be? >> > That's the way I understand it. I've actually used 'release' for > something similar to what I think Jeanette intends. As long as > the release time is short, that might be accurate enough for > many things. As the release time is known, one might even > be able to determine a moment very close to the last cycle, > by adding that time to the moment of release. (Have to be > sure that the result isn't *after* the last cycle, though!) > > -- Pete -- > > 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 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 |
Date | 2020-05-27 11:36 |
From | joachim heintz |
Subject | Re: [Csnd] Perform an action at the end of a note |
ok, got it now, thanks =) On 27/05/2020 07:56, Eduardo Moguillansky wrote: > The use case for lastcycle is this: > > Imagine there is an event which already has a release envelope, for > example with linsegr. This event is triggered via midi or osc and you > need to notify some other instrument that the event has finished. If you > use release you will notify it too early. You can calculate how long the > longest release time of your instrument is, quantize it to the nearest > k-cycle and calculate when that last cycle will be so that you > accurately perform an action there, or use a schedulek event triggered > at the first release, etc. Or you can use lastcycle, which does all this. > > "atstop" is an external opcode which can be even more accurate because > it triggeres at deinit time so it will always catch when the event has > finished. > > > On 27.05.20 02:18, Pete Goodeve wrote: >> On Tue, May 26, 2020 at 05:22:49PM -0400, Kevin Welsh wrote: >>> I assume (dangerous, I know!) that "lastcycle" will only trigger *after* >>> the entire release stage has completed and the instrument will not >>> conduct >>> a single k-rate cycle more, whereas "release" would trigger at the >>> start of >>> the release cycle, allowing other control events to occur while the note >>> releases for however long that release cycle may be? >>> >> That's the way I understand it. I've actually used 'release' for >> something similar to what I think Jeanette intends. As long as >> the release time is short, that might be accurate enough for >> many things. As the release time is known, one might even >> be able to determine a moment very close to the last cycle, >> by adding that time to the moment of release. (Have to be >> sure that the result isn't *after* the last cycle, though!) >> >> -- Pete -- >> >> 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 > > 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 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 |