Array within array

Official support for: loomer.co.uk
Post Reply New Topic
RELATED
PRODUCTS

Post

Example , I've got an array [ 60,63,67] , going into a " get element" module .
Triggering the key input of the "get element" with a counter gives me the notes in successive order .
In supercollider we can have arrays within arrays so it will give you successive notes until it get to the nested array which will then be a chord or interval , like this
[ 60,63,[67,79],58]
67-79 will be played as an octave interval of two notes
Sadly architect doesn' tallow for nested arrays , so how would one solve this ?
Eyeball exchanging
Soul calibrating ..frequencies

Post

GOt it , has to be an array in a tuple like this
I thought the get element was only for arrays , but it also works for tuples and thus array within tuple
(60,61,[64,67,70],73,77)
Image
Last edited by gentleclockdivider on Fri Jan 27, 2023 12:45 pm, edited 1 time in total.
Eyeball exchanging
Soul calibrating ..frequencies

Post

Damn , which brings us to the next problem
Transposing arrays is fine , but not tuples , same goes for reversing
Image
Eyeball exchanging
Soul calibrating ..frequencies

Post

Shuffle doesn't work on tuples either.

Image
Eyeball exchanging
Soul calibrating ..frequencies

Post

Any info ?
It would be great if tuples can also be processed by certain modules ( see above )
Eyeball exchanging
Soul calibrating ..frequencies

Post

Tuples are typically immutable, so doing something like changing the order of elements (i.e shuffle) isn't possible. The quick start guide makes a comment about this:
In tuples, each element position represents something specific, so reordering a tuple's elements makes no sense.
I know that doesn't help answer the original question, but it seems that support for nested arrays would be better than finding workarounds using tuples.

Post

Could you use an array of tuples where the note numbers are stored in tuples to solve your original problem?

Post

drohnee wrote: Sat Jan 28, 2023 7:09 pm Could you use an array of tuples where the note numbers are stored in tuples to solve your original problem?

Noppes , I want a collection of note data+chord data within a single data module
This works
(60,62,[70,74,77],65)
element 1 =60
element 2=62
element3=[70,74,77]
element 4=65
The tuple contains an array which is the chord , the other elements are just regular notes
This is feeded into an get element and the get element nr. is read by an upwards counter , but as written earlier certain operations are not possible .
Best way would be this [60,62,[70,74,77],65] , a nested array , the single elements are still read as single notes , the nested array is a chord .
Last edited by gentleclockdivider on Sat Jan 28, 2023 9:48 pm, edited 1 time in total.
Eyeball exchanging
Soul calibrating ..frequencies

Post

double post
Eyeball exchanging
Soul calibrating ..frequencies

Post

I was wondering whether an array of tuples might be a workaround, albeit a possibly ugly one. Something like [(60, 0, 0), (62, 0, 0), (70, 74, 77), (65, 0, 0)] and you just discard the zero values in your subsequent processing.

Post

drohnee wrote: Sun Jan 29, 2023 1:53 am I was wondering whether an array of tuples might be a workaround, albeit a possibly ugly one. Something like [(60, 0, 0), (62, 0, 0), (70, 74, 77), (65, 0, 0)] and you just discard the zero values in your subsequent processing.
That doesn't work .
Image
Eyeball exchanging
Soul calibrating ..frequencies

Post

2 Colin , would it be possible to get this in a future update (array in array)
Eyeball exchanging
Soul calibrating ..frequencies

Post Reply

Return to “Loomer”