Csound Csound-dev Csound-tekno Search About

[Csnd] fillarray and multidimensional array

Date2013-08-21 13:24
FromTarmo Johannes
Subject[Csnd] fillarray and multidimensional array
Hi,

is there a way to evaluate conveniently multidimensional array?

like 

giArr init 2,3

giArr[0] fillarray 1,2,3
giArr[1] fillarray 7,6,5

(does not seem to work?)

or even
giarr fillarray [1,2,3], [7,6,5]


or can I define the array in python and somehow reach it in csound code?

best!
tarmo


Date2013-08-21 14:44
Fromjoachim heintz
SubjectRe: [Csnd] fillarray and multidimensional array
hi tarmo -

i think you must declare the array with the brackets. and as far as i 
see, fillarray is k-rate only at the moment. this seems to work, 
although it is rather awkward:

instr 1
gkArr[][] init 2,3
gkArr1[] fillarray 1,2,3
gkArr2[] fillarray 7,6,5
kfill = 0
until kfill == lenarray(gkArr1) do
gkArr[0][kfill] = gkArr1[kfill]
gkArr[1][kfill] = gkArr2[kfill]
kfill += 1
od
turnoff
endin

did you see the text about arrays in the csound6 manual (on csounds.com 
is still the 5.19 manual, so i cannot link to it -- it is under math i 
think)? we should improve it together. i will also write something 
similar for the floss manual -- i'll let you know to have a look.

hope this helps -

	joachim


Am 21.08.2013 14:24, schrieb Tarmo Johannes:
> Hi,
>
> is there a way to evaluate conveniently multidimensional array?
>
> like
>
> giArr init 2,3
>
> giArr[0] fillarray 1,2,3
> giArr[1] fillarray 7,6,5
>
> (does not seem to work?)
>
> or even
> giarr fillarray [1,2,3], [7,6,5]
>
>
> or can I define the array in python and somehow reach it in csound code?
>
> best!
> tarmo
>
>
>
> Send bugs reports to the Sourceforge bug trackers
> csound6:
>              https://sourceforge.net/p/csound/tickets/
> csound5:
>              https://sourceforge.net/p/csound/bugs/
> Discussions of bugs and features can be posted here
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
>
>
>

Date2013-08-21 17:34
Fromjpff@cs.bath.ac.uk
SubjectRe: [Csnd] fillarray and multidimensional array
Does this work?
  giArr init 2,3
  giArr fillarray 1,2,3,7,6,5

==John


> Hi,
>
> is there a way to evaluate conveniently multidimensional array?
>
> like
>
> giArr init 2,3
>
> giArr[0] fillarray 1,2,3
> giArr[1] fillarray 7,6,5
>
> (does not seem to work?)
>
> or even
> giarr fillarray [1,2,3], [7,6,5]
>
>
> or can I define the array in python and somehow reach it in csound code?
>
> best!
> tarmo
>
>
>
> Send bugs reports to the Sourceforge bug trackers
> csound6:
>             https://sourceforge.net/p/csound/tickets/
> csound5:
>             https://sourceforge.net/p/csound/bugs/
> Discussions of bugs and features can be posted here
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
> csound"
>
>
>
>
>



Date2013-08-21 17:36
Fromjpff@cs.bath.ac.uk
SubjectRe: [Csnd] fillarray and multidimensional array
> hi tarmo -
>
> i think you must declare the array with the brackets. and as far as i
> see, fillarray is k-rate only at the moment. this seems to work,
> although it is rather awkward:
>

fillarray_i is at i-rate for k-arrays
fillarray works for i or k rate





Date2013-08-21 18:50
Fromjoachim heintz
SubjectRe: [Csnd] fillarray and multidimensional array
excellent, thanks. my version of the manual says:
"Generate a vector (one-dimensional k-rate array) with an arithmetic 
sequence."

perhaps i have not the most recent version. all best -

	joachim


Am 21.08.2013 18:36, schrieb jpff@cs.bath.ac.uk:
>> hi tarmo -
>>
>> i think you must declare the array with the brackets. and as far as i
>> see, fillarray is k-rate only at the moment. this seems to work,
>> although it is rather awkward:
>>
>
> fillarray_i is at i-rate for k-arrays
> fillarray works for i or k rate
>
>
>
>
>
>
> Send bugs reports to the Sourceforge bug trackers
> csound6:
>              https://sourceforge.net/p/csound/tickets/
> csound5:
>              https://sourceforge.net/p/csound/bugs/
> Discussions of bugs and features can be posted here
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
>
>
>

Date2013-08-21 19:11
Fromjoachim heintz
SubjectRe: [Csnd] fillarray and multidimensional array
no, but this:

iArr[][] init 2,3
iArr fillarray 1,2,3,7,6,5
iRow = 0
until iRow == 2 do
iColumn = 0
   until iColumn == 3 do
   prints "iArr[%d][%d] = %d\n", iRow, iColumn, iArr[iRow][iColumn]
   iColumn += 1
   od
iRow += 1
od

	j


Am 21.08.2013 18:34, schrieb jpff@cs.bath.ac.uk:
>
> Does this work?
>    giArr init 2,3
>    giArr fillarray 1,2,3,7,6,5
>
> ==John
>
>
>> Hi,
>>
>> is there a way to evaluate conveniently multidimensional array?
>>
>> like
>>
>> giArr init 2,3
>>
>> giArr[0] fillarray 1,2,3
>> giArr[1] fillarray 7,6,5
>>
>> (does not seem to work?)
>>
>> or even
>> giarr fillarray [1,2,3], [7,6,5]
>>
>>
>> or can I define the array in python and somehow reach it in csound code?
>>
>> best!
>> tarmo
>>
>>
>>
>> Send bugs reports to the Sourceforge bug trackers
>> csound6:
>>              https://sourceforge.net/p/csound/tickets/
>> csound5:
>>              https://sourceforge.net/p/csound/bugs/
>> 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 trackers
> csound6:
>              https://sourceforge.net/p/csound/tickets/
> csound5:
>              https://sourceforge.net/p/csound/bugs/
> Discussions of bugs and features can be posted here
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
>
>
>

Date2013-08-21 21:16
FromTarmo Johannes
SubjectRe: [Csnd] fillarray and multidimensional array
Thanks a lot!
Many new things to learn!
I noticed the new manual is now up as zip in sourceforge. To be
honest, I have not downloaded it yet, but time for that!

best!
tarmo

2013/8/21, joachim heintz :
> no, but this:
>
> iArr[][] init 2,3
> iArr fillarray 1,2,3,7,6,5
> iRow = 0
> until iRow == 2 do
> iColumn = 0
>    until iColumn == 3 do
>    prints "iArr[%d][%d] = %d\n", iRow, iColumn, iArr[iRow][iColumn]
>    iColumn += 1
>    od
> iRow += 1
> od
>
> 	j
>
>
> Am 21.08.2013 18:34, schrieb jpff@cs.bath.ac.uk:
>>
>> Does this work?
>>    giArr init 2,3
>>    giArr fillarray 1,2,3,7,6,5
>>
>> ==John
>>
>>
>>> Hi,
>>>
>>> is there a way to evaluate conveniently multidimensional array?
>>>
>>> like
>>>
>>> giArr init 2,3
>>>
>>> giArr[0] fillarray 1,2,3
>>> giArr[1] fillarray 7,6,5
>>>
>>> (does not seem to work?)
>>>
>>> or even
>>> giarr fillarray [1,2,3], [7,6,5]
>>>
>>>
>>> or can I define the array in python and somehow reach it in csound code?
>>>
>>> best!
>>> tarmo
>>>
>>>
>>>
>>> Send bugs reports to the Sourceforge bug trackers
>>> csound6:
>>>              https://sourceforge.net/p/csound/tickets/
>>> csound5:
>>>              https://sourceforge.net/p/csound/bugs/
>>> 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 trackers
>> csound6:
>>              https://sourceforge.net/p/csound/tickets/
>> csound5:
>>              https://sourceforge.net/p/csound/bugs/
>> 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 trackers
> csound6:
>             https://sourceforge.net/p/csound/tickets/
> csound5:
>             https://sourceforge.net/p/csound/bugs/
> Discussions of bugs and features can be posted here
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
> csound"
>
>
>