Csound Csound-dev Csound-tekno Search About

[Csnd] INF macro in orchestras?

Date2011-11-12 04:07
FromForrest Cahoon
Subject[Csnd] INF macro in orchestras?
One of the items listed as new in 5.13 is "INF macro added to orchestras; z read as infinity in scores"

Can anyone give me an example of these?  I am working with plucked string sounds that I want to keep going until they fade out naturally, like a harp. I'd really like to be able to specify an "infinite" duration in my instrument, but I can't figure out how to make this work.

Forrest

Date2011-11-12 14:07
FromAdam Puckett
SubjectRe: [Csnd] INF macro in orchestras?
You don't need INF. Just set p3 to -1.

On 11/11/11, Forrest Cahoon  wrote:
> One of the items listed as new in 5.13 is "INF macro added to orchestras; z
> read as infinity in scores"
>
> Can anyone give me an example of these?  I am working with plucked string
> sounds that I want to keep going until they fade out naturally, like a
> harp. I'd really like to be able to specify an "infinite" duration in my
> instrument, but I can't figure out how to make this work.
>
> Forrest
>
> Send bugs reports to the Sourceforge bug tracker
>             https://sourceforge.net/tracker/?group_id=81968&atid=564599
> Discussions of bugs and features can be posted here
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
> csound"
>
>


Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"

Date2011-11-12 17:13
Fromthorin kerr
SubjectRe: [Csnd] INF macro in orchestras?
I can't work out INF, but it looks like z in the score actually inserts a value of 2147483648 (2 ^ 31). Which I assume is meant to be something like a 32 bit maximum signed integer value. Except... Isn't a 32 bit integer range from -2147483648 to 2147483647 ?

Otherwise... it could be useful, since a duration of -1 in the score isn't actually 'forever' but only until the last event has finished... Except... it won't work as a duration, because... I seem to remember in Csound scores, the longest note duration you can specify is the maximum integer of control samples. (2 ^ 31 - 1) / kr - (and maybe minus a bit more to avoid rounding errors).

And now for some complete 'z statement' weirdness...
When I run this CSD (using 5.13 on OSX), a completely empty Instrument 2, controls how long Instrument 1 will make sound.

<CsoundSynthesizer>
<CsOptions>
-odac  -d 
</CsOptions>
<CsInstruments>

sr = 44100
kr = 4410
nchnls = 1

gisine ftgen 0, 0, 2048, 10, 1

instr 1
a1 oscil 10000, 440, gisine
prints "instrument 1 duration is %f\\n\\r", p3
out a1 
endin 

instr 2
;dummy instrument
endin 


</CsInstruments>
<CsScore>

i1 0 z ;will only sound until instrument 2 is finished
i2 2 0 

;uncomment this to run instrument 1 for as long as possible.
;i1 0 [(2 ^ 31 - 1) / 4410 ]  

</CsScore>
</CsoundSynthesizer>

















On Sat, Nov 12, 2011 at 2:07 PM, Forrest Cahoon <forrest.cahoon@gmail.com> wrote:
One of the items listed as new in 5.13 is "INF macro added to orchestras; z read as infinity in scores"

Can anyone give me an example of these?  I am working with plucked string sounds that I want to keep going until they fade out naturally, like a harp. I'd really like to be able to specify an "infinite" duration in my instrument, but I can't figure out how to make this work.

Forrest


Date2011-11-12 17:36
FromAdam Puckett
SubjectRe: [Csnd] INF macro in orchestras?
Actually, Csound will only run for 2^31-1 control periods until
problems occur. Those problems include stuff like instruments not
playing in sync.

On 11/12/11, thorin kerr  wrote:
> I can't work out INF, but it looks like z in the score actually inserts a
> value of 2147483648 (2 ^ 31). Which I assume is meant to be something like
> a 32 bit maximum signed integer value. Except... Isn't a 32 bit integer
> range from -2147483648 to 2147483647 ?
>
> Otherwise... it could be useful, since a duration of -1 in the score isn't
> actually 'forever' but only until the last event has finished...
> Except... it won't work as a duration, because... I seem to remember in
> Csound scores, the longest note duration you can specify is the maximum
> integer of control samples. (2 ^ 31 - 1) / kr - (and maybe minus a bit more
> to avoid rounding errors).
>
> And now for some complete 'z statement' weirdness...
> When I run this CSD (using 5.13 on OSX), a completely empty Instrument 2,
> controls how long Instrument 1 will make sound.
>
> 
> 
> -odac  -d
> 
> 
>
> sr = 44100
> kr = 4410
> nchnls = 1
>
> gisine ftgen 0, 0, 2048, 10, 1
>
> instr 1
> a1 oscil 10000, 440, gisine
> prints "instrument 1 duration is %f\\n\\r", p3
> out a1
> endin
>
> instr 2
> ;dummy instrument
> endin
>
>
> 
> 
>
> i1 0 z ;will only sound until instrument 2 is finished
> i2 2 0
>
> ;uncomment this to run instrument 1 for as long as possible.
> ;i1 0 [(2 ^ 31 - 1) / 4410 ]
>
> 
> 
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> On Sat, Nov 12, 2011 at 2:07 PM, Forrest Cahoon
> wrote:
>
>> One of the items listed as new in 5.13 is "INF macro added to orchestras;
>> z read as infinity in scores"
>>
>> Can anyone give me an example of these?  I am working with plucked string
>> sounds that I want to keep going until they fade out naturally, like a
>> harp. I'd really like to be able to specify an "infinite" duration in my
>> instrument, but I can't figure out how to make this work.
>>
>> Forrest
>>
>
> Send bugs reports to the Sourceforge bug tracker
>             https://sourceforge.net/tracker/?group_id=81968&atid=564599
> Discussions of bugs and features can be posted here
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
> csound"
>
>


Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"