Csound Csound-dev Csound-tekno Search About

[Csnd] tablei gives "nan" at last index

Date2010-07-23 22:01
Fromjoachim heintz
Subject[Csnd] tablei gives "nan" at last index
hi -

i see a littlebit strange behaviour of tablei. if it reads this  
function table ...
giFt1 ftgen 1, 0, -10, -2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10.10
... it says that index 9 is not a number.

if i add an extra argument (which should actually be senseless), it's  
ok.

is this a bug? or is it related to the size of the table (not a power  
of two - size=8 seems to be ok)?

it works if i put the f-statement in the score, and tab_i instead of  
tablei works, too.

	joachim





giFt1 ftgen 1, 0, -10, -2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10.10; "nan"
giFt2 ftgen 2, 0, -10, -2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10.10, 0; ok
instr 1
prints "%nFunction Table %d:%n", p4
indx init 0
loop:
ival tablei indx, p4
prints "Index %d = %f%n", indx, ival
loop_lt indx, 1, ftlen(p4), loop
endin


i 1 0 0 1
i 1 0 0 2



output:
Function Table 1:
Index 0 = 1.000000
Index 1 = 2.000000
Index 2 = 3.000000
Index 3 = 4.000000
Index 4 = 5.000000
Index 5 = 6.000000
Index 6 = 7.000000
Index 7 = 8.000000
Index 8 = 9.000000
Index 9 = nan
Function Table 2:
Index 0 = 1.000000
Index 1 = 2.000000
Index 2 = 3.000000
Index 3 = 4.000000
Index 4 = 5.000000
Index 5 = 6.000000
Index 6 = 7.000000
Index 7 = 8.000000
Index 8 = 9.000000
Index 9 = 10.100000


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"

Date2010-07-23 23:27
FromVictor Lazzarini
Subject[Csnd] Re: tablei gives "nan" at last index
I thought tablei only read pow-2 tables.

Victor
On 23 Jul 2010, at 22:01, joachim heintz wrote:

> hi -
>
> i see a littlebit strange behaviour of tablei. if it reads this  
> function table ...
> giFt1 ftgen 1, 0, -10, -2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10.10
> ... it says that index 9 is not a number.
>
> if i add an extra argument (which should actually be senseless),  
> it's ok.
>
> is this a bug? or is it related to the size of the table (not a  
> power of two - size=8 seems to be ok)?
>
> it works if i put the f-statement in the score, and tab_i instead of  
> tablei works, too.
>
> 	joachim
>
> 
> 
> 
> 
> giFt1 ftgen 1, 0, -10, -2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10.10; "nan"
> giFt2 ftgen 2, 0, -10, -2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10.10, 0; ok
> instr 1
> prints "%nFunction Table %d:%n", p4
> indx init 0
> loop:
> ival tablei indx, p4
> prints "Index %d = %f%n", indx, ival
> loop_lt indx, 1, ftlen(p4), loop
> endin
> 
> 
> i 1 0 0 1
> i 1 0 0 2
> 
> 
>
> output:
> Function Table 1:
> Index 0 = 1.000000
> Index 1 = 2.000000
> Index 2 = 3.000000
> Index 3 = 4.000000
> Index 4 = 5.000000
> Index 5 = 6.000000
> Index 6 = 7.000000
> Index 7 = 8.000000
> Index 8 = 9.000000
> Index 9 = nan
> Function Table 2:
> Index 0 = 1.000000
> Index 1 = 2.000000
> Index 2 = 3.000000
> Index 3 = 4.000000
> Index 4 = 5.000000
> Index 5 = 6.000000
> Index 6 = 7.000000
> Index 7 = 8.000000
> Index 8 = 9.000000
> Index 9 = 10.100000
>
>
> 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"

Date2010-07-23 23:43
FromVictor Lazzarini
Subject[Csnd] Re: tablei gives "nan" at last index
This is what I get here (OSX 10.5, 5.12.4 universal binary):

Function Table 1:
Index 0 = 1.000000
Index 1 = 2.000000
Index 2 = 3.000000
Index 3 = 4.000000
Index 4 = 5.000000
Index 5 = 6.000000
Index 6 = 7.000000
Index 7 = 8.000000
Index 8 = 9.000000
Index 9 = 10.100000
Function Table 2:
Index 0 = 1.000000
Index 1 = 2.000000
Index 2 = 3.000000
Index 3 = 4.000000
Index 4 = 5.000000
Index 5 = 6.000000
Index 6 = 7.000000
Index 7 = 8.000000
Index 8 = 9.000000
Index 9 = 10.100000

On 23 Jul 2010, at 22:01, joachim heintz wrote:

> hi -
>
> i see a littlebit strange behaviour of tablei. if it reads this  
> function table ...
> giFt1 ftgen 1, 0, -10, -2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10.10
> ... it says that index 9 is not a number.
>
> if i add an extra argument (which should actually be senseless),  
> it's ok.
>
> is this a bug? or is it related to the size of the table (not a  
> power of two - size=8 seems to be ok)?
>
> it works if i put the f-statement in the score, and tab_i instead of  
> tablei works, too.
>
> 	joachim
>
> 
> 
> 
> 
> giFt1 ftgen 1, 0, -10, -2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10.10; "nan"
> giFt2 ftgen 2, 0, -10, -2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10.10, 0; ok
> instr 1
> prints "%nFunction Table %d:%n", p4
> indx init 0
> loop:
> ival tablei indx, p4
> prints "Index %d = %f%n", indx, ival
> loop_lt indx, 1, ftlen(p4), loop
> endin
> 
> 
> i 1 0 0 1
> i 1 0 0 2
> 
> 
>
> output:
> Function Table 1:
> Index 0 = 1.000000
> Index 1 = 2.000000
> Index 2 = 3.000000
> Index 3 = 4.000000
> Index 4 = 5.000000
> Index 5 = 6.000000
> Index 6 = 7.000000
> Index 7 = 8.000000
> Index 8 = 9.000000
> Index 9 = nan
> Function Table 2:
> Index 0 = 1.000000
> Index 1 = 2.000000
> Index 2 = 3.000000
> Index 3 = 4.000000
> Index 4 = 5.000000
> Index 5 = 6.000000
> Index 6 = 7.000000
> Index 7 = 8.000000
> Index 8 = 9.000000
> Index 9 = 10.100000
>
>
> 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"

Date2010-07-24 09:13
Fromjoachim heintz
Subject[Csnd] Re: Re: tablei gives "nan" at last index
as to the power-of-two question i am really not sure. obviously the  
table opcode work also for non-power-of-two tables, and i can't find  
anything in the manual against it.

if it's easy for you to have a look in the code and see if it's really  
no difference in the use of power-of-two or non-power-of-two tables, i  
would be very interested in the result.

	joachim

Am 24.07.2010 um 00:27 schrieb Victor Lazzarini:

> I thought tablei only read pow-2 tables.
>
> Victor
> On 23 Jul 2010, at 22:01, joachim heintz wrote:
>
>> hi -
>>
>> i see a littlebit strange behaviour of tablei. if it reads this  
>> function table ...
>> giFt1 ftgen 1, 0, -10, -2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10.10
>> ... it says that index 9 is not a number.
>>
>> if i add an extra argument (which should actually be senseless),  
>> it's ok.
>>
>> is this a bug? or is it related to the size of the table (not a  
>> power of two - size=8 seems to be ok)?
>>
>> it works if i put the f-statement in the score, and tab_i instead  
>> of tablei works, too.
>>
>> 	joachim
>>
>> 
>> 
>> 
>> 
>> giFt1 ftgen 1, 0, -10, -2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10.10; "nan"
>> giFt2 ftgen 2, 0, -10, -2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10.10, 0; ok
>> instr 1
>> prints "%nFunction Table %d:%n", p4
>> indx init 0
>> loop:
>> ival tablei indx, p4
>> prints "Index %d = %f%n", indx, ival
>> loop_lt indx, 1, ftlen(p4), loop
>> endin
>> 
>> 
>> i 1 0 0 1
>> i 1 0 0 2
>> 
>> 
>>
>> output:
>> Function Table 1:
>> Index 0 = 1.000000
>> Index 1 = 2.000000
>> Index 2 = 3.000000
>> Index 3 = 4.000000
>> Index 4 = 5.000000
>> Index 5 = 6.000000
>> Index 6 = 7.000000
>> Index 7 = 8.000000
>> Index 8 = 9.000000
>> Index 9 = nan
>> Function Table 2:
>> Index 0 = 1.000000
>> Index 1 = 2.000000
>> Index 2 = 3.000000
>> Index 3 = 4.000000
>> Index 4 = 5.000000
>> Index 5 = 6.000000
>> Index 6 = 7.000000
>> Index 7 = 8.000000
>> Index 8 = 9.000000
>> Index 9 = 10.100000
>>
>>
>> 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"

Date2010-07-24 09:14
Fromjoachim heintz
Subject[Csnd] Re: Re: tablei gives "nan" at last index
this is my platform and csound version, too.
it sounds ridiculous, but now i get the same output.
i think my fault was actually that i meant "table" and not "tablei". i  
misinterpreted the "i" at the end as an initialization-i, not a  
interpolation-i. it makes sense that interpolation opcodes are looking  
for the next value, and it seems to be a bit ambivalent what they do  
if there is no next value like in my example. i just tried "table3",  
and it definitely does not work with the first table.

thanks for the feedback -

	joachim

Am 24.07.2010 um 00:43 schrieb Victor Lazzarini:

> This is what I get here (OSX 10.5, 5.12.4 universal binary):
>
> Function Table 1:
> Index 0 = 1.000000
> Index 1 = 2.000000
> Index 2 = 3.000000
> Index 3 = 4.000000
> Index 4 = 5.000000
> Index 5 = 6.000000
> Index 6 = 7.000000
> Index 7 = 8.000000
> Index 8 = 9.000000
> Index 9 = 10.100000
> Function Table 2:
> Index 0 = 1.000000
> Index 1 = 2.000000
> Index 2 = 3.000000
> Index 3 = 4.000000
> Index 4 = 5.000000
> Index 5 = 6.000000
> Index 6 = 7.000000
> Index 7 = 8.000000
> Index 8 = 9.000000
> Index 9 = 10.100000
>
> On 23 Jul 2010, at 22:01, joachim heintz wrote:
>
>> hi -
>>
>> i see a littlebit strange behaviour of tablei. if it reads this  
>> function table ...
>> giFt1 ftgen 1, 0, -10, -2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10.10
>> ... it says that index 9 is not a number.
>>
>> if i add an extra argument (which should actually be senseless),  
>> it's ok.
>>
>> is this a bug? or is it related to the size of the table (not a  
>> power of two - size=8 seems to be ok)?
>>
>> it works if i put the f-statement in the score, and tab_i instead  
>> of tablei works, too.
>>
>> 	joachim
>>
>> 
>> 
>> 
>> 
>> giFt1 ftgen 1, 0, -10, -2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10.10; "nan"
>> giFt2 ftgen 2, 0, -10, -2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10.10, 0; ok
>> instr 1
>> prints "%nFunction Table %d:%n", p4
>> indx init 0
>> loop:
>> ival tablei indx, p4
>> prints "Index %d = %f%n", indx, ival
>> loop_lt indx, 1, ftlen(p4), loop
>> endin
>> 
>> 
>> i 1 0 0 1
>> i 1 0 0 2
>> 
>> 
>>
>> output:
>> Function Table 1:
>> Index 0 = 1.000000
>> Index 1 = 2.000000
>> Index 2 = 3.000000
>> Index 3 = 4.000000
>> Index 4 = 5.000000
>> Index 5 = 6.000000
>> Index 6 = 7.000000
>> Index 7 = 8.000000
>> Index 8 = 9.000000
>> Index 9 = nan
>> Function Table 2:
>> Index 0 = 1.000000
>> Index 1 = 2.000000
>> Index 2 = 3.000000
>> Index 3 = 4.000000
>> Index 4 = 5.000000
>> Index 5 = 6.000000
>> Index 6 = 7.000000
>> Index 7 = 8.000000
>> Index 8 = 9.000000
>> Index 9 = 10.100000
>>
>>
>> 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"