Csound Csound-dev Csound-tekno Search About

[Csnd] i() behavior on PC / Mac

Date2012-01-27 17:42
FromTakahiko Tsuchiya
Subject[Csnd] i() behavior on PC / Mac
Dear list and developers,

I’ve encountered a csd file made by a friend, that uses a massive amount of i() casting with expression arguments, like this:

	gitable ftgen 1, 0, 16, -2, i(gka + gkb), i(gkc * .5 + gkd), etc...

The file is somehow force-compiled and runs ok on Mac version of csound 5.15f, only with this message: 

	“WARNING: i() should not be used with expression argument”

However, it fails to compile on Windows 7 & csound 5.15d with the same warning sign but as an “error.” 

I guess these behaviors depend on the platform, but it could be the difference between the float and double. (I cannot test both right now...) Anyway, is there by any chance these behaviors will be addressed and changed in the future versions? Or should I just tell my friend to fix all the i()’s not to include math expressions?

Takahiko


; example code




sr = 44100
ksmps = 2
instr 1
gka init 1
gkb init 1
gkc init 1
gkd init 1
gke init 1
gkf init 1
endin
instr 2
gitable ftgen 1, 0, 4, -2, i(gka), i(gkb + gkc), i(gkd * .5 + gke), i(gkf)
endin


f0 1000




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"


Date2012-01-27 20:11
Fromjoachim heintz
SubjectRe: [Csnd] i() behavior on PC / Mac
hi takahiko -
just to cite the manual (http://www.csounds.com/manual/html/opi.html):
"Using i() with a k-rate expression argument is not recommended, and can
produce unexpected results."
seems to be true ...
	joachim



Am 27.01.2012 18:42, schrieb Takahiko Tsuchiya:
> Dear list and developers,
> 
> I’ve encountered a csd file made by a friend, that uses a massive amount of i() casting with expression arguments, like this:
> 
> 	gitable ftgen 1, 0, 16, -2, i(gka + gkb), i(gkc * .5 + gkd), etc...
> 
> The file is somehow force-compiled and runs ok on Mac version of csound 5.15f, only with this message: 
> 
> 	“WARNING: i() should not be used with expression argument”
> 
> However, it fails to compile on Windows 7 & csound 5.15d with the same warning sign but as an “error.” 
> 
> I guess these behaviors depend on the platform, but it could be the difference between the float and double. (I cannot test both right now...) Anyway, is there by any chance these behaviors will be addressed and changed in the future versions? Or should I just tell my friend to fix all the i()’s not to include math expressions?
> 
> Takahiko
> 
> 
> ; example code
> 
> 
> 
> 
> sr = 44100
> ksmps = 2
> instr 1
> gka init 1
> gkb init 1
> gkc init 1
> gkd init 1
> gke init 1
> gkf init 1
> endin
> instr 2
> gitable ftgen 1, 0, 4, -2, i(gka), i(gkb + gkc), i(gkd * .5 + gke), i(gkf)
> endin
> 
> 
> f0 1000
> 
> 
> 
> 
> 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"

Date2012-01-27 20:16
From"Dr. Richard Boulanger"
SubjectRe: [Csnd] i() behavior on PC / Mac
Is there a way to make this work/possible without more complex reinit designs?

___________________________________

Dr. Richard Boulanger, Ph.D.

Professor of Electronic Production and Design
Professional Writing and Music Technology Division
Berklee College of Music
1140 Boylston Street
Boston, MA 02215-3693

617-747-2485 (office)
774-488-9166 (cell)

____________________________________

____________________________________

____________________________________

On Jan 27, 2012, at 3:11 PM, joachim heintz wrote:

hi takahiko -
just to cite the manual (http://www.csounds.com/manual/html/opi.html):
"Using i() with a k-rate expression argument is not recommended, and can
produce unexpected results."
seems to be true ...
joachim



Am 27.01.2012 18:42, schrieb Takahiko Tsuchiya:
Dear list and developers,

I’ve encountered a csd file made by a friend, that uses a massive amount of i() casting with expression arguments, like this:

gitable ftgen 1, 0, 16, -2, i(gka + gkb), i(gkc * .5 + gkd), etc...

The file is somehow force-compiled and runs ok on Mac version of csound 5.15f, only with this message:

“WARNING: i() should not be used with expression argument”

However, it fails to compile on Windows 7 & csound 5.15d with the same warning sign but as an “error.”

I guess these behaviors depend on the platform, but it could be the difference between the float and double. (I cannot test both right now...) Anyway, is there by any chance these behaviors will be addressed and changed in the future versions? Or should I just tell my friend to fix all the i()’s not to include math expressions?

Takahiko


; example code
<CsoundSynthesizer>
<CsOptions>
</CsOptions>
<CsInstruments>
sr = 44100
ksmps = 2
instr 1
gka init 1
gkb init 1
gkc init 1
gkd init 1
gke init 1
gkf init 1
endin
instr 2
gitable ftgen 1, 0, 4, -2, i(gka), i(gkb + gkc), i(gkd * .5 + gke), i(gkf)
endin
</CsInstruments>
<CsScore>
f0 1000
</CsScore>
</CsoundSynthesizer>


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"



Date2012-01-27 21:38
FromTito Latini
SubjectRe: [Csnd] i() behavior on PC / Mac
AttachmentsNone  

Date2012-01-28 04:03
FromTakahiko Tsuchiya
SubjectRe: [Csnd] i() behavior on PC / Mac
Hi Joachim and Tito,

Thanks for the comments and the solution idea. Also good to know the behavior on GNU/Linux too. 
Seems I may have to tell the coder to fix them manually... it's just that there are dozens of them.

Takahiko


On Jan 27, 2012, at 4:38 PM, Tito Latini wrote:

> It works (5.15 single and double float, gnu/linux)
> 
>  gitable ftgen 1, 0, 4, -2, i(gka), i(gkb) + i(gkc), i(gkd) * .5 + i(gke), i(gkf)
> 
> Tomorrow I can try to see if there is an alternative
> 
> tito
> 
> 
> 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"


Date2012-01-28 18:29
FromAdam Puckett
SubjectRe: [Csnd] i() behavior on PC / Mac
The CSD is being "force"-compiled with the --no-expression-opt option.
This option makes it possible to write i(ka+kb) expressions although I
personally don't use these.

On 1/27/12, Takahiko Tsuchiya  wrote:
> Hi Joachim and Tito,
>
> Thanks for the comments and the solution idea. Also good to know the
> behavior on GNU/Linux too.
> Seems I may have to tell the coder to fix them manually... it's just that
> there are dozens of them.
>
> Takahiko
>
>
> On Jan 27, 2012, at 4:38 PM, Tito Latini wrote:
>
>> It works (5.15 single and double float, gnu/linux)
>>
>>  gitable ftgen 1, 0, 4, -2, i(gka), i(gkb) + i(gkc), i(gkd) * .5 + i(gke),
>> i(gkf)
>>
>> Tomorrow I can try to see if there is an alternative
>>
>> tito
>>
>>
>> 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"
>
>

Date2012-01-28 19:31
FromTakahiko Tsuchiya
SubjectRe: [Csnd] i() behavior on PC / Mac
Hi Adam,

I checked and it did force-compile the csd on Windows. I agree it's not recommended, but saved us a huge amount of time in this case. Thanks a lot.

Takahiko


On Jan 28, 2012, at 1:29 PM, Adam Puckett wrote:

> The CSD is being "force"-compiled with the --no-expression-opt option.
> This option makes it possible to write i(ka+kb) expressions although I
> personally don't use these.
> 
> On 1/27/12, Takahiko Tsuchiya  wrote:
>> Hi Joachim and Tito,
>> 
>> Thanks for the comments and the solution idea. Also good to know the
>> behavior on GNU/Linux too.
>> Seems I may have to tell the coder to fix them manually... it's just that
>> there are dozens of them.
>> 
>> Takahiko
>> 
>> 
>> On Jan 27, 2012, at 4:38 PM, Tito Latini wrote:
>> 
>>> It works (5.15 single and double float, gnu/linux)
>>> 
>>> gitable ftgen 1, 0, 4, -2, i(gka), i(gkb) + i(gkc), i(gkd) * .5 + i(gke),
>>> i(gkf)
>>> 
>>> Tomorrow I can try to see if there is an alternative
>>> 
>>> tito
>>> 
>>> 
>>> 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"
>> 
>> 
> 
> 
> 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"
> 



Date2012-01-28 20:14
FromAdam Puckett
SubjectRe: [Csnd] i() behavior on PC / Mac
I think maybe something you didn't realize is the fact that Csound can
take a .csoundrc file, which your friend may have modified or put one
in the current tirectory, and since you didn't say anything about a
.csoundrc file, chances are the original wwas modified or replaced
unless Csound defaults to --no-expression-opt, which I don't think is
the case.

On 1/28/12, Takahiko Tsuchiya  wrote:
> Hi Adam,
>
> I checked and it did force-compile the csd on Windows. I agree it's not
> recommended, but saved us a huge amount of time in this case. Thanks a lot.
>
> Takahiko
>
>
> On Jan 28, 2012, at 1:29 PM, Adam Puckett wrote:
>
>> The CSD is being "force"-compiled with the --no-expression-opt option.
>> This option makes it possible to write i(ka+kb) expressions although I
>> personally don't use these.
>>
>> On 1/27/12, Takahiko Tsuchiya  wrote:
>>> Hi Joachim and Tito,
>>>
>>> Thanks for the comments and the solution idea. Also good to know the
>>> behavior on GNU/Linux too.
>>> Seems I may have to tell the coder to fix them manually... it's just that
>>> there are dozens of them.
>>>
>>> Takahiko
>>>
>>>
>>> On Jan 27, 2012, at 4:38 PM, Tito Latini wrote:
>>>
>>>> It works (5.15 single and double float, gnu/linux)
>>>>
>>>> gitable ftgen 1, 0, 4, -2, i(gka), i(gkb) + i(gkc), i(gkd) * .5 +
>>>> i(gke),
>>>> i(gkf)
>>>>
>>>> Tomorrow I can try to see if there is an alternative
>>>>
>>>> tito
>>>>
>>>>
>>>> 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"
>>>
>>>
>>
>>
>> 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"
>
>

Date2012-01-28 20:43
FromTakahiko Tsuchiya
SubjectRe: [Csnd] i() behavior on PC / Mac
There was no .csoundrc file included in the current directory. And I have not modified them on my PC / Mac. It might actually be the that the default option of "expression optimiztion" in Windows version of Csound differs from the others?

Takahiko


On Jan 28, 2012, at 3:14 PM, Adam Puckett wrote:

> I think maybe something you didn't realize is the fact that Csound can
> take a .csoundrc file, which your friend may have modified or put one
> in the current tirectory, and since you didn't say anything about a
> .csoundrc file, chances are the original wwas modified or replaced
> unless Csound defaults to --no-expression-opt, which I don't think is
> the case.
> 
> On 1/28/12, Takahiko Tsuchiya  wrote:
>> Hi Adam,
>> 
>> I checked and it did force-compile the csd on Windows. I agree it's not
>> recommended, but saved us a huge amount of time in this case. Thanks a lot.
>> 
>> Takahiko
>> 
>> 
>> On Jan 28, 2012, at 1:29 PM, Adam Puckett wrote:
>> 
>>> The CSD is being "force"-compiled with the --no-expression-opt option.
>>> This option makes it possible to write i(ka+kb) expressions although I
>>> personally don't use these.
>>> 
>>> On 1/27/12, Takahiko Tsuchiya  wrote:
>>>> Hi Joachim and Tito,
>>>> 
>>>> Thanks for the comments and the solution idea. Also good to know the
>>>> behavior on GNU/Linux too.
>>>> Seems I may have to tell the coder to fix them manually... it's just that
>>>> there are dozens of them.
>>>> 
>>>> Takahiko
>>>> 
>>>> 
>>>> On Jan 27, 2012, at 4:38 PM, Tito Latini wrote:
>>>> 
>>>>> It works (5.15 single and double float, gnu/linux)
>>>>> 
>>>>> gitable ftgen 1, 0, 4, -2, i(gka), i(gkb) + i(gkc), i(gkd) * .5 +
>>>>> i(gke),
>>>>> i(gkf)
>>>>> 
>>>>> Tomorrow I can try to see if there is an alternative
>>>>> 
>>>>> tito
>>>>> 
>>>>> 
>>>>> 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"
>>>> 
>>>> 
>>> 
>>> 
>>> 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"
>> 
>> 
> 
> 
> 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"
> 



Date2012-01-29 11:02
FromTito Latini
SubjectRe: [Csnd] i() behavior on PC / Mac
AttachmentsNone  

Date2012-01-29 13:22
FromAndres Cabrera
SubjectRe: [Csnd] i() behavior on PC / Mac
Hi,

I think this is an interesting issue which begs the question, should
opcodes that modify k-rate vairables always make the first value
available during the init-pass?

If they do, and it's considered a bug not to, it would be very
convenient and it would avoid a lot of unexpected behavior with
if-thens and reinits, however, It can also be problematic performance
wise to have to run a control pass as part of initialization.

I recently spent a long while trying to debug a problem due to this,
so specifying a default behavior, and an easy
 way to know whether a control-rate opcode updates the k-variables
during the init pass would be great!

What do you all think?

Cheers,
Andrés

On Sun, Jan 29, 2012 at 11:02 AM, Tito Latini  wrote:
> fixed in git; Takahiko, here is your example + some extravagance
>
> 
> 
> 
> 
> sr = 44100
> ksmps = 2
> instr 1
> gka init 1
> gkb init 1
> gkc init 1
> gkd init 1
> gke init 1
> gkf init 1
> gkg init 10
> gkh init 100
> gki init -123
> endin
> instr 2
> gitable ftgen 1, 0, 4, -2, i(gka), i(gkb + gkc), i(gkd * .5 + gke), i(gkf)
>
> print i(gkb + gkc)
> print i(gkd * .5 + gke)
> print i(gkd * .5 + gke + abs(gki * 2 / 3) + sin(gkg / 3.33 + p3) * gkh)
> endin
> 
> 
> i1 0 .1
> i2 0 .1
> 
> 
>
> csound -g test.csd
> ...
> ftable 1:       4 points, scalemax 2.000
>  _
>
>
>  -
>
> _  _
> instr 2:  #i11 = 2.000
> instr 2:  #i15 = 1.500
> instr 2:  #i31 = 87.358
> ...
>
> tito
>
>
> 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"
>