Csound Csound-dev Csound-tekno Search About

[Csnd] table index

Date2011-09-01 13:57
Fromfrancesco
Subject[Csnd] table index
Hello All,
just two trivial question:
1 - if i use a random index to a table like this

ind	random	0, ftlen(itab)
inote	table		ind, itab

is index automatically converted to a integer?
It is not necessary this

ind	=		int(ind)

am i right or it is better to use the last expression?

2 - is it last table index never reached or do i use

ind	random	0, ftlen(itab) + 1

Thanks,
ciao,
francesco.



--
View this message in context: http://csound.1045644.n5.nabble.com/table-index-tp4758206p4758206.html
Sent from the Csound - General mailing list archive at Nabble.com.


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-09-01 14:00
Fromjpff@cs.bath.ac.uk
SubjectRe: [Csnd] table index
> Hello All,
> just two trivial question:
> 1 - if i use a random index to a table like this
>
> ind	random	0, ftlen(itab)
> inote	table		ind, itab

All values in Csound are floiating point.  Conversion to integer is internal

>
> is index automatically converted to a integer?
> It is not necessary this
>
> ind	=		int(ind)
>
> am i right or it is better to use the last expression?
>
> 2 - is it last table index never reached or do i use
>
> ind	random	0, ftlen(itab) + 1
>

I believe it is reached, but one needs to check the rounding/truncation.

> Thanks,
> ciao,
> francesco.
>
>
>
> --
> View this message in context:
> http://csound.1045644.n5.nabble.com/table-index-tp4758206p4758206.html
> Sent from the Csound - General mailing list archive at Nabble.com.
>
>
> 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-09-01 14:04
Frompeiman khosravi
SubjectRe: [Csnd] table index
On 1 September 2011 15:00,   wrote:
>> Hello All,
>> just two trivial question:
>> 1 - if i use a random index to a table like this
>>
>> ind   random  0, ftlen(itab)
>> inote table           ind, itab
>
> All values in Csound are floiating point.  Conversion to integer is internal
>

Would the floating point be truncated or rounded by table?

>>
>> is index automatically converted to a integer?
>> It is not necessary this
>>
>> ind   =               int(ind)
>>
>> am i right or it is better to use the last expression?
>>
>> 2 - is it last table index never reached or do i use
>>
>> ind   random  0, ftlen(itab) + 1
>>
>
> I believe it is reached, but one needs to check the rounding/truncation.
>
>> Thanks,
>> ciao,
>> francesco.
>>
>>
>>
>> --
>> View this message in context:
>> http://csound.1045644.n5.nabble.com/table-index-tp4758206p4758206.html
>> Sent from the Csound - General mailing list archive at Nabble.com.
>>
>>
>> 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"


Date2011-09-01 14:09
Fromjpff@cs.bath.ac.uk
SubjectRe: [Csnd] table index
Reading the code....

     indx = (int32) MYFLOOR((double)ndx);

for it rounds down.  Not sure that is useful but that is what the code does

==John

> On 1 September 2011 15:00,   wrote:
>>> Hello All,
>>> just two trivial question:
>>> 1 - if i use a random index to a table like this
>>>
>>> ind   random  0, ftlen(itab)
>>> inote table           ind, itab
>>
>> All values in Csound are floiating point.  Conversion to integer is
>> internal
>>
>
> Would the floating point be truncated or rounded by table?
>
>>>
>>> is index automatically converted to a integer?
>>> It is not necessary this
>>>
>>> ind   =               int(ind)
>>>
>>> am i right or it is better to use the last expression?
>>>
>>> 2 - is it last table index never reached or do i use
>>>
>>> ind   random  0, ftlen(itab) + 1
>>>
>>
>> I believe it is reached, but one needs to check the rounding/truncation.
>>
>>> Thanks,
>>> ciao,
>>> francesco.
>>>
>>>
>>>
>>> --
>>> View this message in context:
>>> http://csound.1045644.n5.nabble.com/table-index-tp4758206p4758206.html
>>> Sent from the Csound - General mailing list archive at Nabble.com.
>>>
>>>
>>> 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"

Date2011-09-01 14:17
Fromfrancesco
Subject[Csnd] Re: table index
i guess this is happens also when Csound internally convert floating values
to integer for table index?
I.e. i don't need to use int(val) for the index, but also i never will have
last value in table
(because my random index is from 0 to table lenght)?

Am i totally wrong?

Thank You,
ciao,
francesco.


--
View this message in context: http://csound.1045644.n5.nabble.com/table-index-tp4758206p4758264.html
Sent from the Csound - General mailing list archive at Nabble.com.


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-09-01 14:19
FromVictor Lazzarini
SubjectRe: [Csnd] table index
I think that is correct and what it should do (after it is brought  
between 0 and length - 1).

On 1 Sep 2011, at 14:09, jpff@cs.bath.ac.uk wrote:

> Reading the code....
>
>     indx = (int32) MYFLOOR((double)ndx);
>
> for it rounds down.  Not sure that is useful but that is what the  
> code does
>
> ==John
>
>> On 1 September 2011 15:00,   wrote:
>>>> Hello All,
>>>> just two trivial question:
>>>> 1 - if i use a random index to a table like this
>>>>
>>>> ind   random  0, ftlen(itab)
>>>> inote table           ind, itab
>>>
>>> All values in Csound are floiating point.  Conversion to integer is
>>> internal
>>>
>>
>> Would the floating point be truncated or rounded by table?
>>
>>>>
>>>> is index automatically converted to a integer?
>>>> It is not necessary this
>>>>
>>>> ind   =               int(ind)
>>>>
>>>> am i right or it is better to use the last expression?
>>>>
>>>> 2 - is it last table index never reached or do i use
>>>>
>>>> ind   random  0, ftlen(itab) + 1
>>>>
>>>
>>> I believe it is reached, but one needs to check the rounding/ 
>>> truncation.
>>>
>>>> Thanks,
>>>> ciao,
>>>> francesco.
>>>>
>>>>
>>>>
>>>> --
>>>> View this message in context:
>>>> http://csound.1045644.n5.nabble.com/table-index-tp4758206p4758206.html
>>>> Sent from the Csound - General mailing list archive at Nabble.com.
>>>>
>>>>
>>>> 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"
>

Dr Victor Lazzarini
Senior Lecturer
Dept. of Music
NUI Maynooth Ireland
tel.: +353 1 708 3545
Victor dot Lazzarini AT nuim dot ie





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-09-01 14:48
Fromjpff@cs.bath.ac.uk
SubjectRe: [Csnd] Re: table index
> i guess this is happens also when Csound internally convert floating
> values
> to integer for table index?

That is the internal line of conversion in the case of table.  It may be
different for other opcodes

> I.e. i don't need to use int(val) for the index, but also i never will
> have
> last value in table
> (because my random index is from 0 to table lenght)?
>

That is true almost.  If the random generator actually achieved the
maximum value then floor(x) is x.

So I need to check the internals of random next....  but i do not
undersrand it.

> Am i totally wrong?
>
> Thank You,
> ciao,
> francesco.
>
>
> --
> View this message in context:
> http://csound.1045644.n5.nabble.com/table-index-tp4758206p4758264.html
> Sent from the Csound - General mailing list archive at Nabble.com.
>
>
> 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-09-01 17:24
Fromfrancesco
Subject[Csnd] Re: table index
Thank You all,
i think i have understand.

in my empirical experiment using random opcode, seems that this will never
reach max value
(i.e. range is (min, max] ). I'm not so sure, but in manual page of random
opcode it is not specified.

ciao,
francesco.



--
View this message in context: http://csound.1045644.n5.nabble.com/table-index-tp4758206p4759009.html
Sent from the Csound - General mailing list archive at Nabble.com.


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-09-01 17:36
Fromjpff@cs.bath.ac.uk
SubjectRe: [Csnd] Re: table index
> Thank You all,
> i think i have understand.
>
> in my empirical experiment using random opcode, seems that this will never
> reach max value
> (i.e. range is (min, max] ). I'm not so sure, but in manual page of random
> opcode it is not specified.
>


Reading the code it will achieve the maximum but with a much lower
probability that other values;  that is 1 case in 2147483647




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-09-01 18:15
Fromfrancesco
Subject[Csnd] Re: table index
Ok, thank You.
Just another stupid curiosity ...
If i would like to try at least all the possibilities (2147483647) with kr =
sr = 44100 i will need
a csd running for near 13.5 hours. Then i have think that i can use a really
high kr, es 
kr = sr = 100000 and then i will need 'only' 6 hours.

But using only krate (no audio) can i use any kr ? For example 1000000?
Is there a limit?

apologies for stupid question, but i am really curious about things without
utility.

ciao,
francesco.


--
View this message in context: http://csound.1045644.n5.nabble.com/table-index-tp4758206p4759227.html
Sent from the Csound - General mailing list archive at Nabble.com.


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-09-01 18:32
FromTarmo Johannes
SubjectRe: [Csnd] Re: table index
Hi, 

i guess
if you don't run the csd in real-time but as for rendering to file with  -o somefile (or better /dev/null)
or maybe even better without any ouytput (with flag --nosound )

then the computer should do its work as fast it can and does not think about the sample rate in real time at all.

tarmo

On Thursday 01 September 2011 20:15:15 francesco wrote:
> Ok, thank You.
> Just another stupid curiosity ...
> If i would like to try at least all the possibilities (2147483647) with kr =
> sr = 44100 i will need
> a csd running for near 13.5 hours. Then i have think that i can use a really
> high kr, es 
> kr = sr = 100000 and then i will need 'only' 6 hours.
> 
> But using only krate (no audio) can i use any kr ? For example 1000000?
> Is there a limit?
> 
> apologies for stupid question, but i am really curious about things without
> utility.
> 
> ciao,
> francesco.
> 
> 
> --
> View this message in context: http://csound.1045644.n5.nabble.com/table-index-tp4758206p4759227.html
> Sent from the Csound - General mailing list archive at Nabble.com.
> 
> 
> 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-09-01 19:50
Fromfrancesco
Subject[Csnd] Re: table index
Thank You Mr Tarmo,
this was also what i had think. Obviously not using audio (i.e. with -n
flags),
like You said.

ciao,
francesco.


--
View this message in context: http://csound.1045644.n5.nabble.com/table-index-tp4758206p4759582.html
Sent from the Csound - General mailing list archive at Nabble.com.


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-09-01 20:35
Fromthorin kerr
SubjectRe: [Csnd] Re: table index
Now I'm curious... Does the 64 bit version change this? 

thorin



On Fri, Sep 2, 2011 at 2:36 AM, <jpff@cs.bath.ac.uk> wrote:
> Thank You all,
> i think i have understand.
>
> in my empirical experiment using random opcode, seems that this will never
> reach max value
> (i.e. range is (min, max] ). I'm not so sure, but in manual page of random
> opcode it is not specified.
>


Reading the code it will achieve the maximum but with a much lower
probability that other values;  that is 1 case in 2147483647




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"