[Csnd] pause or wait statement in csound?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Csnd] pause or wait statement in csound?

zappfinger
see the following code:

instr 2
     tablew gisize, gkindx, gifn2, 0        ; write audio end as final index
     ftsave    "indexes.txt", 1, 2
endin

apparantly the ftsave happens too soon, as the 'gisize' is not in the
indexes.txt file.
If I split this into 2 instruments and execute instr 2 first and then
instr 3, it works:

instr 2
     tablew gisize, gkindx, gifn2, 0        ; write audio end as final index
endin

instr 3
     ftsave    "indexes.txt", 1, 2
endin

So my question is, is there some kind of pause or wait statement in
csound, so that I could write:

instr 2
     tablew gisize, gkindx, gifn2, 0        ; write audio end as final index
     pause 1
     ftsave    "indexes.txt", 1, 2
endin

Richard

Csound mailing list
[hidden email]
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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] pause or wait statement in csound?

joachim-3
i think there no such statement currently.  but i remember steven
mentionedd some plans.  meanwhile you might do something like this:

instr Wait

   iTime times
   if times:k() > iTime+1 then
    printks "Overall Csound time = %.3f Sec.\n", 0, times:k()
    turnoff
   endif

endin

        joachim


On 27/02/17 14:59, Richard wrote:

> see the following code:
>
> instr 2
>     tablew gisize, gkindx, gifn2, 0        ; write audio end as final index
>     ftsave    "indexes.txt", 1, 2
> endin
>
> apparantly the ftsave happens too soon, as the 'gisize' is not in the
> indexes.txt file.
> If I split this into 2 instruments and execute instr 2 first and then
> instr 3, it works:
>
> instr 2
>     tablew gisize, gkindx, gifn2, 0        ; write audio end as final index
> endin
>
> instr 3
>     ftsave    "indexes.txt", 1, 2
> endin
>
> So my question is, is there some kind of pause or wait statement in
> csound, so that I could write:
>
> instr 2
>     tablew gisize, gkindx, gifn2, 0        ; write audio end as final index
>     pause 1
>     ftsave    "indexes.txt", 1, 2
> endin
>
> Richard
>
> Csound mailing list
> [hidden email]
> 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
[hidden email]
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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] pause or wait statement in csound?

Steven Yi
A wait opcode isn't necessary. The problem is that you are using
ftsave and not ftsavek.  ftsave runs at init-time.  You might try
using code like this

 tablew gisize, gkindx, gifn2, 0        ; write audio end as final index
 ftsavek    "indexes.txt", 1, 2
turnoff



On Mon, Feb 27, 2017 at 2:36 PM, joachim heintz <[hidden email]> wrote:

> i think there no such statement currently.  but i remember steven mentionedd
> some plans.  meanwhile you might do something like this:
>
> instr Wait
>
>   iTime times
>   if times:k() > iTime+1 then
>    printks "Overall Csound time = %.3f Sec.\n", 0, times:k()
>    turnoff
>   endif
>
> endin
>
>         joachim
>
>
>
> On 27/02/17 14:59, Richard wrote:
>>
>> see the following code:
>>
>> instr 2
>>     tablew gisize, gkindx, gifn2, 0        ; write audio end as final
>> index
>>     ftsave    "indexes.txt", 1, 2
>> endin
>>
>> apparantly the ftsave happens too soon, as the 'gisize' is not in the
>> indexes.txt file.
>> If I split this into 2 instruments and execute instr 2 first and then
>> instr 3, it works:
>>
>> instr 2
>>     tablew gisize, gkindx, gifn2, 0        ; write audio end as final
>> index
>> endin
>>
>> instr 3
>>     ftsave    "indexes.txt", 1, 2
>> endin
>>
>> So my question is, is there some kind of pause or wait statement in
>> csound, so that I could write:
>>
>> instr 2
>>     tablew gisize, gkindx, gifn2, 0        ; write audio end as final
>> index
>>     pause 1
>>     ftsave    "indexes.txt", 1, 2
>> endin
>>
>> Richard
>>
>> Csound mailing list
>> [hidden email]
>> 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
> [hidden email]
> 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
[hidden email]
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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] pause or wait statement in csound?

zappfinger
Good one Steven.


On 27/02/17 21:18, Steven Yi wrote:

> A wait opcode isn't necessary. The problem is that you are using
> ftsave and not ftsavek.  ftsave runs at init-time.  You might try
> using code like this
>
>   tablew gisize, gkindx, gifn2, 0        ; write audio end as final index
>   ftsavek    "indexes.txt", 1, 2
> turnoff
>
>
>
> On Mon, Feb 27, 2017 at 2:36 PM, joachim heintz <[hidden email]> wrote:
>> i think there no such statement currently.  but i remember steven mentionedd
>> some plans.  meanwhile you might do something like this:
>>
>> instr Wait
>>
>>    iTime times
>>    if times:k() > iTime+1 then
>>     printks "Overall Csound time = %.3f Sec.\n", 0, times:k()
>>     turnoff
>>    endif
>>
>> endin
>>
>>          joachim
>>
>>
>>
>> On 27/02/17 14:59, Richard wrote:
>>> see the following code:
>>>
>>> instr 2
>>>      tablew gisize, gkindx, gifn2, 0        ; write audio end as final
>>> index
>>>      ftsave    "indexes.txt", 1, 2
>>> endin
>>>
>>> apparantly the ftsave happens too soon, as the 'gisize' is not in the
>>> indexes.txt file.
>>> If I split this into 2 instruments and execute instr 2 first and then
>>> instr 3, it works:
>>>
>>> instr 2
>>>      tablew gisize, gkindx, gifn2, 0        ; write audio end as final
>>> index
>>> endin
>>>
>>> instr 3
>>>      ftsave    "indexes.txt", 1, 2
>>> endin
>>>
>>> So my question is, is there some kind of pause or wait statement in
>>> csound, so that I could write:
>>>
>>> instr 2
>>>      tablew gisize, gkindx, gifn2, 0        ; write audio end as final
>>> index
>>>      pause 1
>>>      ftsave    "indexes.txt", 1, 2
>>> endin
>>>
>>> Richard
>>>
>>> Csound mailing list
>>> [hidden email]
>>> 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
>> [hidden email]
>> 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
> [hidden email]
> 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
[hidden email]
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
Loading...