Csound Csound-dev Csound-tekno Search About

pause or wait statement in csound?

Date2017-02-27 13:59
FromRichard
Subjectpause or wait statement in csound?
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
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

Date2017-02-27 19:36
Fromjoachim heintz
SubjectRe: pause or wait statement in csound?
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
> 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

Date2017-02-27 20:18
FromSteven Yi
SubjectRe: pause or wait statement in csound?
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  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
>> 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

Date2017-02-27 20:59
FromRichard
SubjectRe: pause or wait statement in csound?
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  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
>>> 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