Csound Csound-dev Csound-tekno Search About

canceling events with delayed p2

Date2016-01-27 17:36
FromGuillermo Senna
Subjectcanceling events with delayed p2
Hi,

Say I have this instrument:

instr 1
    event_i "i", 2, 5, 1
endin

If then, say from "instr 3", I use turnoff2 to kill instrument N.2 
BEFORE the start time in p2, obviously turnoff2 doesn't work. This is I 
think because instrument 2 isn't actually playing when you trigger the 
turnoff.

I have found solutions to the problem by using a third instrument with 
p2=0 and a timer. So I kill this "proxy" instrument instead and that 
solves my problem.

But I wonder, is there's something you could do to "unschedule" an 
event_i with delayed p2?

Thank you.

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

Date2016-01-27 18:20
FromTarmo Johannes
SubjectRe: canceling events with delayed p2

I am afraid no.
If an event is scheduled, it will be started. But you can use some global variable as flag that signals if instr 2 is allowed to play. And have a line in instr 2 that turn itself off if the flag is set.
Would it help?
Tarmo

27.01.2016 19:38 kirjutas kuupäeval "Guillermo Senna" <gsenna@gmail.com>:
Hi,

Say I have this instrument:

instr 1
   event_i "i", 2, 5, 1
endin

If then, say from "instr 3", I use turnoff2 to kill instrument N.2 BEFORE the start time in p2, obviously turnoff2 doesn't work. This is I think because instrument 2 isn't actually playing when you trigger the turnoff.

I have found solutions to the problem by using a third instrument with p2=0 and a timer. So I kill this "proxy" instrument instead and that solves my problem.

But I wonder, is there's something you could do to "unschedule" an event_i with delayed p2?

Thank you.

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

Date2016-01-27 18:35
FromGuillermo Senna
SubjectRe: canceling events with delayed p2
Hi Tarmo.

Unfortunately, it would not. Because I might want to execute the following order:
1) cancel p2-delayed instruments
2) start instr2 with p2=0 set, immediately.

This 2 sentences are actually a Start/Stop button. And as you can't cancel p2-delayed instruments, I get overlapping instances of p2 (because the first order doesn't "unschedule" the delayed instance).

Anyway, my trick with the "proxy" instrument works fine. I just wanted confirmation that it is not possible to do it.

Cheers.

On 27/01/16 15:20, Tarmo Johannes wrote:

I am afraid no.
If an event is scheduled, it will be started. But you can use some global variable as flag that signals if instr 2 is allowed to play. And have a line in instr 2 that turn itself off if the flag is set.
Would it help?
Tarmo

27.01.2016 19:38 kirjutas kuupäeval "Guillermo Senna" <gsenna@gmail.com>:
Hi,

Say I have this instrument:

instr 1
   event_i "i", 2, 5, 1
endin

If then, say from "instr 3", I use turnoff2 to kill instrument N.2 BEFORE the start time in p2, obviously turnoff2 doesn't work. This is I think because instrument 2 isn't actually playing when you trigger the turnoff.

I have found solutions to the problem by using a third instrument with p2=0 and a timer. So I kill this "proxy" instrument instead and that solves my problem.

But I wonder, is there's something you could do to "unschedule" an event_i with delayed p2?

Thank you.

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


Date2016-01-27 19:23
FromRory Walsh
SubjectRe: canceling events with delayed p2
This sounds like a very complex setup. I've found that people often over complicate instrument design when starting off Cabbage. I wonder if your whole approach couldn't be simplified?

On 27 January 2016 at 18:35, Guillermo Senna <gsenna@gmail.com> wrote:
Hi Tarmo.

Unfortunately, it would not. Because I might want to execute the following order:
1) cancel p2-delayed instruments
2) start instr2 with p2=0 set, immediately.

This 2 sentences are actually a Start/Stop button. And as you can't cancel p2-delayed instruments, I get overlapping instances of p2 (because the first order doesn't "unschedule" the delayed instance).

Anyway, my trick with the "proxy" instrument works fine. I just wanted confirmation that it is not possible to do it.

Cheers.


On 27/01/16 15:20, Tarmo Johannes wrote:

I am afraid no.
If an event is scheduled, it will be started. But you can use some global variable as flag that signals if instr 2 is allowed to play. And have a line in instr 2 that turn itself off if the flag is set.
Would it help?
Tarmo

27.01.2016 19:38 kirjutas kuupäeval "Guillermo Senna" <gsenna@gmail.com>:
Hi,

Say I have this instrument:

instr 1
   event_i "i", 2, 5, 1
endin

If then, say from "instr 3", I use turnoff2 to kill instrument N.2 BEFORE the start time in p2, obviously turnoff2 doesn't work. This is I think because instrument 2 isn't actually playing when you trigger the turnoff.

I have found solutions to the problem by using a third instrument with p2=0 and a timer. So I kill this "proxy" instrument instead and that solves my problem.

But I wonder, is there's something you could do to "unschedule" an event_i with delayed p2?

Thank you.

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

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

Date2016-01-27 19:47
FromGuillermo Senna
SubjectRe: canceling events with delayed p2
Probably. I'm sure someone like Iain or you would solve things much faster and efficiently. That's why, after I've finished writing the code and comments, I'd like to publish the whole thing in the Cabbage forum.
Then if you have a spare moment you could take a look at it and give me some feedback. ;-)

On 27/01/16 16:23, Rory Walsh wrote:
This sounds like a very complex setup. I've found that people often over complicate instrument design when starting off Cabbage. I wonder if your whole approach couldn't be simplified?

On 27 January 2016 at 18:35, Guillermo Senna <gsenna@gmail.com> wrote:
Hi Tarmo.

Unfortunately, it would not. Because I might want to execute the following order:
1) cancel p2-delayed instruments
2) start instr2 with p2=0 set, immediately.

This 2 sentences are actually a Start/Stop button. And as you can't cancel p2-delayed instruments, I get overlapping instances of p2 (because the first order doesn't "unschedule" the delayed instance).

Anyway, my trick with the "proxy" instrument works fine. I just wanted confirmation that it is not possible to do it.

Cheers.


On 27/01/16 15:20, Tarmo Johannes wrote:

I am afraid no.
If an event is scheduled, it will be started. But you can use some global variable as flag that signals if instr 2 is allowed to play. And have a line in instr 2 that turn itself off if the flag is set.
Would it help?
Tarmo

27.01.2016 19:38 kirjutas kuupäeval "Guillermo Senna" <gsenna@gmail.com>:
Hi,

Say I have this instrument:

instr 1
   event_i "i", 2, 5, 1
endin

If then, say from "instr 3", I use turnoff2 to kill instrument N.2 BEFORE the start time in p2, obviously turnoff2 doesn't work. This is I think because instrument 2 isn't actually playing when you trigger the turnoff.

I have found solutions to the problem by using a third instrument with p2=0 and a timer. So I kill this "proxy" instrument instead and that solves my problem.

But I wonder, is there's something you could do to "unschedule" an event_i with delayed p2?

Thank you.

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

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


Date2016-01-27 20:50
FromRory Walsh
SubjectRe: canceling events with delayed p2

I'm honoured to be mentioned in the same sentence as Iain! I'm going to print this email and stick it on my fridge :)

On 27 Jan 2016 19:47, "Guillermo Senna" <gsenna@gmail.com> wrote:
Probably. I'm sure someone like Iain or you would solve things much faster and efficiently. That's why, after I've finished writing the code and comments, I'd like to publish the whole thing in the Cabbage forum.
Then if you have a spare moment you could take a look at it and give me some feedback. ;-)

On 27/01/16 16:23, Rory Walsh wrote:
This sounds like a very complex setup. I've found that people often over complicate instrument design when starting off Cabbage. I wonder if your whole approach couldn't be simplified?

On 27 January 2016 at 18:35, Guillermo Senna <gsenna@gmail.com> wrote:
Hi Tarmo.

Unfortunately, it would not. Because I might want to execute the following order:
1) cancel p2-delayed instruments
2) start instr2 with p2=0 set, immediately.

This 2 sentences are actually a Start/Stop button. And as you can't cancel p2-delayed instruments, I get overlapping instances of p2 (because the first order doesn't "unschedule" the delayed instance).

Anyway, my trick with the "proxy" instrument works fine. I just wanted confirmation that it is not possible to do it.

Cheers.


On 27/01/16 15:20, Tarmo Johannes wrote:

I am afraid no.
If an event is scheduled, it will be started. But you can use some global variable as flag that signals if instr 2 is allowed to play. And have a line in instr 2 that turn itself off if the flag is set.
Would it help?
Tarmo

27.01.2016 19:38 kirjutas kuupäeval "Guillermo Senna" <gsenna@gmail.com>:
Hi,

Say I have this instrument:

instr 1
   event_i "i", 2, 5, 1
endin

If then, say from "instr 3", I use turnoff2 to kill instrument N.2 BEFORE the start time in p2, obviously turnoff2 doesn't work. This is I think because instrument 2 isn't actually playing when you trigger the turnoff.

I have found solutions to the problem by using a third instrument with p2=0 and a timer. So I kill this "proxy" instrument instead and that solves my problem.

But I wonder, is there's something you could do to "unschedule" an event_i with delayed p2?

Thank you.

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

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