Csound Csound-dev Csound-tekno Search About

How to schedule and exit

Date2016-02-10 19:48
Fromjpff
SubjectHow to schedule and exit
I a sure this is obvious and it used to work.....

I hae an instrument that does stuff, but when a k-variable goes over
a fixed value (70) i want to schedule myself immediately from the top,
and exit the instrument.

What I have is
printk 0, ktime
if (ktime> 70) then
            schedkwhen 1, -1, 1, 1, 0, 77
endif

from instr 1.  This did not end the current instance but it eventually
died.  However I am tracing ktime and also print a message at the start
of the instr, and it happily sails past 70 until the 130 limit I set
for p3 and never schedules a new instance.

What am I doing wrong?  Or is there a better way?  The restart is mainly
to rewind a pvx file.  Setting ktime to zero seems to work but seems
rather a cheat, and I might want to do more complex versions


==John ffitch

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-02-10 20:02
FromVictor Lazzarini
SubjectRe: How to schedule and exit
Did you mean to send a negative p1 to stop it? You are not doing it

> On 10 Feb 2016, at 19:48, jpff  wrote:
> 
> I a sure this is obvious and it used to work.....
> 
> I hae an instrument that does stuff, but when a k-variable goes over
> a fixed value (70) i want to schedule myself immediately from the top,
> and exit the instrument.
> 
> What I have is
> printk 0, ktime
> if (ktime> 70) then
>            schedkwhen 1, -1, 1, 1, 0, 77
> endif
> 
> from instr 1.  This did not end the current instance but it eventually
> died.  However I am tracing ktime and also print a message at the start
> of the instr, and it happily sails past 70 until the 130 limit I set
> for p3 and never schedules a new instance.
> 
> What am I doing wrong?  Or is there a better way?  The restart is mainly
> to rewind a pvx file.  Setting ktime to zero seems to work but seems
> rather a cheat, and I might want to do more complex versions
> 
> 
> ==John ffitch
> 
> 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-02-10 20:02
FromHlöðver Sigurðsson
SubjectRe: How to schedule and exit
If maxnum is 1, then I guess it can't start another one, since it's already active. How about doing turnoff, and have a seperate instrument to watch it and revive it as soon as its active number is less than one.

2016-02-10 20:48 GMT+01:00 jpff <jpff@codemist.co.uk>:
I a sure this is obvious and it used to work.....

I hae an instrument that does stuff, but when a k-variable goes over
a fixed value (70) i want to schedule myself immediately from the top,
and exit the instrument.

What I have is
printk 0, ktime
if (ktime> 70) then
            schedkwhen 1, -1, 1, 1, 0, 77
endif

from instr 1.  This did not end the current instance but it eventually
died.  However I am tracing ktime and also print a message at the start
of the instr, and it happily sails past 70 until the 130 limit I set
for p3 and never schedules a new instance.

What am I doing wrong?  Or is there a better way?  The restart is mainly
to rewind a pvx file.  Setting ktime to zero seems to work but seems
rather a cheat, and I might want to do more complex versions


==John ffitch

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-02-10 20:04
FromHlöðver Sigurðsson
SubjectRe: How to schedule and exit
nevermind, I probably misunderstood the question.

2016-02-10 21:02 GMT+01:00 Hlöðver Sigurðsson <hlolli@gmail.com>:
If maxnum is 1, then I guess it can't start another one, since it's already active. How about doing turnoff, and have a seperate instrument to watch it and revive it as soon as its active number is less than one.

2016-02-10 20:48 GMT+01:00 jpff <jpff@codemist.co.uk>:
I a sure this is obvious and it used to work.....

I hae an instrument that does stuff, but when a k-variable goes over
a fixed value (70) i want to schedule myself immediately from the top,
and exit the instrument.

What I have is
printk 0, ktime
if (ktime> 70) then
            schedkwhen 1, -1, 1, 1, 0, 77
endif

from instr 1.  This did not end the current instance but it eventually
died.  However I am tracing ktime and also print a message at the start
of the instr, and it happily sails past 70 until the 130 limit I set
for p3 and never schedules a new instance.

What am I doing wrong?  Or is there a better way?  The restart is mainly
to rewind a pvx file.  Setting ktime to zero seems to work but seems
rather a cheat, and I might want to do more complex versions


==John ffitch

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-02-12 16:28
Fromjpff
SubjectRe: How to schedule and exit
No -- what I was missing fir part of this was turnoff opcode.  I am not 
familiar with much reatime/performance aspects of csound.  The scdkwhen 
wasd trying to start a new instance of instr1 now with duration 77 
seconds.  It certainly used too work a coule of years ago when I first 
wrote this experimemt -- just trying to move it to android.
   Actually redesigned version is now running.  Next step is yto work out 
how to have just the widgets I was.
==John

On Wed, 10 Feb 2016, Victor Lazzarini wrote:

> Did you mean to send a negative p1 to stop it? You are not doing it
>
>> On 10 Feb 2016, at 19:48, jpff  wrote:
>>
>> I a sure this is obvious and it used to work.....
>>
>> I hae an instrument that does stuff, but when a k-variable goes over
>> a fixed value (70) i want to schedule myself immediately from the top,
>> and exit the instrument.
>>
>> What I have is
>> printk 0, ktime
>> if (ktime> 70) then
>>            schedkwhen 1, -1, 1, 1, 0, 77
>> endif
>>
>> from instr 1.  This did not end the current instance but it eventually
>> died.  However I am tracing ktime and also print a message at the start
>> of the instr, and it happily sails past 70 until the 130 limit I set
>> for p3 and never schedules a new instance.
>>
>> What am I doing wrong?  Or is there a better way?  The restart is mainly
>> to rewind a pvx file.  Setting ktime to zero seems to work but seems
>> rather a cheat, and I might want to do more complex versions
>>
>>
>> ==John ffitch
>>
>> 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-02-12 16:35
FromTarmo Johannes
SubjectRe: How to schedule and exit

Widgets - can you run your csd in thd "official" Android Cound player or you are buildib youf own app? In the first case, it supports html5 widgets and javascript. Michel Gogins has written some very nice examples about it. Also cabbage for Android is another good option.
Best!
Tarmo

12.02.2016 18:29 kirjutas kuupäeval "jpff" <jpff@codemist.co.uk>:
No -- what I was missing fir part of this was turnoff opcode.  I am not familiar with much reatime/performance aspects of csound.  The scdkwhen wasd trying to start a new instance of instr1 now with duration 77 seconds.  It certainly used too work a coule of years ago when I first wrote this experimemt -- just trying to move it to android.
  Actually redesigned version is now running.  Next step is yto work out how to have just the widgets I was.
==John

On Wed, 10 Feb 2016, Victor Lazzarini wrote:

Did you mean to send a negative p1 to stop it? You are not doing it

On 10 Feb 2016, at 19:48, jpff <jpff@CODEMIST.CO.UK> wrote:

I a sure this is obvious and it used to work.....

I hae an instrument that does stuff, but when a k-variable goes over
a fixed value (70) i want to schedule myself immediately from the top,
and exit the instrument.

What I have is
printk 0, ktime
if (ktime> 70) then
           schedkwhen 1, -1, 1, 1, 0, 77
endif

from instr 1.  This did not end the current instance but it eventually
died.  However I am tracing ktime and also print a message at the start
of the instr, and it happily sails past 70 until the 130 limit I set
for p3 and never schedules a new instance.

What am I doing wrong?  Or is there a better way?  The restart is mainly
to rewind a pvx file.  Setting ktime to zero seems to work but seems
rather a cheat, and I might want to do more complex versions


==John ffitch

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-02-12 17:08
Fromjpff
SubjectRe: How to schedule and exit
I have it running with the default 5 slidfers 5 buttons and x-y.  But all 
I need are 3 sliders (or 1 and the trackpad) and 3 buttons.  As the 
eventual aim is for non-csounders a crafted screen would be nice.

The real interest is in a demo of audio stuff to excite preteens, as part 
of "Bath Taps into Science".  This is one possible demo; suggestions for 
other ideas welcome, especially using a phone with interaction.
==John


On Fri, 12 Feb 2016, Tarmo Johannes wrote:

> 
> Widgets - can you run your csd in thd "official" Android Cound player or you
> are buildib youf own app? In the first case, it supports html5 widgets and
> javascript. Michel Gogins has written some very nice examples about it. Also
> cabbage for Android is another good option.
> Best!
> Tarmo
> 
> 12.02.2016 18:29 kirjutas kuupäeval "jpff" :
>       No -- what I was missing fir part of this was turnoff opcode.  I
>       am not familiar with much reatime/performance aspects of csound. 
>       The scdkwhen wasd trying to start a new instance of instr1 now
>       with duration 77 seconds.  It certainly used too work a coule of
>       years ago when I first wrote this experimemt -- just trying to
>       move it to android.
>         Actually redesigned version is now running.  Next step is yto
>       work out how to have just the widgets I was.
>       ==John
>
>       On Wed, 10 Feb 2016, Victor Lazzarini wrote:
>
>             Did you mean to send a negative p1 to stop it? You are
>             not doing it
>
>                   On 10 Feb 2016, at 19:48, jpff
>                    wrote:
>
>                   I a sure this is obvious and it used to
>                   work.....
>
>                   I hae an instrument that does stuff, but
>                   when a k-variable goes over
>                   a fixed value (70) i want to schedule
>                   myself immediately from the top,
>                   and exit the instrument.
>
>                   What I have is
>                   printk 0, ktime
>                   if (ktime> 70) then
>                              schedkwhen 1, -1, 1, 1, 0, 77
>                   endif
>
>                   from instr 1.  This did not end the
>                   current instance but it eventually
>                   died.  However I am tracing ktime and also
>                   print a message at the start
>                   of the instr, and it happily sails past 70
>                   until the 130 limit I set
>                   for p3 and never schedules a new instance.
>
>                   What am I doing wrong?  Or is there a
>                   better way?  The restart is mainly
>                   to rewind a pvx file.  Setting ktime to
>                   zero seems to work but seems
>                   rather a cheat, and I might want to do
>                   more complex versions
> 
>
>                   ==John ffitch
>
>                   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