Build array
-
gentleclockdivider gentleclockdivider https://www.kvraudio.com/forum/memberlist.php?mode=viewprofile&u=203660
- KVRAF
- Topic Starter
- 6112 posts since 22 Mar, 2009 from gent
Can we have some examples on how to use build arrays
What's wrong with the following example ?
This message does my head , array can not contain elements of different type , tuple or integer .
Isn't a tuple always made out of integers , index + value
While in the buid array info box it specifically says : Builds an array of size `length` by writes of 2-tuples (index, val) (or an array of such tuples) to the `write` index.
We need some serious docu about al the programming stuff
What's wrong with the following example ?
This message does my head , array can not contain elements of different type , tuple or integer .
Isn't a tuple always made out of integers , index + value
While in the buid array info box it specifically says : Builds an array of size `length` by writes of 2-tuples (index, val) (or an array of such tuples) to the `write` index.
We need some serious docu about al the programming stuff
Eyeball exchanging
Soul calibrating ..frequencies
Soul calibrating ..frequencies
-
gentleclockdivider gentleclockdivider https://www.kvraudio.com/forum/memberlist.php?mode=viewprofile&u=203660
- KVRAF
- Topic Starter
- 6112 posts since 22 Mar, 2009 from gent
Adress start from '0' , and multiple tuples should be in between [ ]
My next question is , what can the build array do , that a data module can't ?
A build array of length 3 would need the tuples to be in between [] to make an array before going into write , is there some kind of module that automatically wraps them in an array ?
Never mind ,just found out , still a comprhensive documentation would be great
My next question is , what can the build array do , that a data module can't ?
A build array of length 3 would need the tuples to be in between [] to make an array before going into write , is there some kind of module that automatically wraps them in an array ?
Never mind ,just found out , still a comprhensive documentation would be great
Eyeball exchanging
Soul calibrating ..frequencies
Soul calibrating ..frequencies
-
- KVRAF
- 2682 posts since 25 Aug, 2003 from Bournemouth, UK
Tuples elements can be made of any type, they don't necessarily have to be integers: for example, the tuples used to to create MIDI messages are of the form (string, number, number, ...), such as ("noteon", 60, 10, 1) for a noteon with pitch 60, velocity 10, channel 1.
[build array] allows you to create an array programatically, element by element, whereas with [data] you need to know the entire content up front.
[build array] allows you to create an array programatically, element by element, whereas with [data] you need to know the entire content up front.
Architect, the modular MIDI toolkit, beta now available for macOS, Windows, and Linux.
-
- KVRian
- 678 posts since 15 Feb, 2012 from France
-
- KVRAF
- 2682 posts since 25 Aug, 2003 from Bournemouth, UK
When [build array] receives a number to its "length" inlet, it internally allocates an array of that fixed size, where each element is by default "undefined". You'll then need to send a number of tuples of the form (index, value). Because arrays have to be homogenous, you'll need to ensure that each element is set as Architect won't create arrays with undefined and other types together.
Something like this:
(And yes, the error message definitely needs to be improved here, I do understand!)
Something like this:
(And yes, the error message definitely needs to be improved here, I do understand!)
Architect, the modular MIDI toolkit, beta now available for macOS, Windows, and Linux.