Basic array question
-
Gilsornette
- Member
- Posts: 280
- Contact:
Basic array question
Hello,
I'm working on a patch in which several values are received via a data bus ; I'd like to store them in an array. What is the easiest way? I've seen there is an Unpack Array module, is there a kind of Pack Array Module?
Thank you
I'm working on a patch in which several values are received via a data bus ; I'd like to store them in an array. What is the easiest way? I've seen there is an Unpack Array module, is there a kind of Pack Array Module?
Thank you
Data flow also supports arrays (at data rate), so you can send array into Data bus.
join Hollyhock Usine Discord server: https://discord.gg/EdJarnE
-
Gilsornette
- Member
- Posts: 280
- Contact:
In this case I'm sending some values (Racks Ids) at different moments and I just need to "pack" , to store them in an array. The fact they are sent via data bus is not important.
My problem is: how do I create an array with several separate values (int or floats...). I'm not sure to be clear.
My problem is: how do I create an array with several separate values (int or floats...). I'm not sure to be clear.
-
Gilsornette
- Member
- Posts: 280
- Contact:
One more thing. Maybe the fact they are sent through Data bus has its importance. All the values are coming from the same output .
a store array script module ?
-
Gilsornette
- Member
- Posts: 280
- Contact:
Isn't it a kind of preset of arrays? In my case it does not work. What I'm looking for is the opposite of the Unpack Module (I guess so).
Another example could be: how to store in (or create) an array with the 10 first values of a fader when moving it?
Another example could be: how to store in (or create) an array with the 10 first values of a fader when moving it?
-
Gilsornette
- Member
- Posts: 280
- Contact:
Yes, it works for me, thank you Yan
But I was hoping there was a single module that can do that. Maybe I could suggest it?
But I was hoping there was a single module that can do that. Maybe I could suggest it?
-
Gilsornette
- Member
- Posts: 280
- Contact:
I made a simple version of your patch and wanted to upload it. But I don't find where, how to upload it...
try full editor with preview, there you can use attachments
also, there is a single module for this, Array queue. it's just that it will store any change at data rate. with Nay's patch it stores at lower 'refresh speed', but even so you can do it simpler way with queue module:
also, there is a single module for this, Array queue. it's just that it will store any change at data rate. with Nay's patch it stores at lower 'refresh speed', but even so you can do it simpler way with queue module:
join Hollyhock Usine Discord server: https://discord.gg/EdJarnE
-
Gilsornette
- Member
- Posts: 280
- Contact:
Thank you x.iso, that was the module I was looking for
You're right @x.iso ! 
-
woodslanding
- Member
- Posts: 1327
- Contact:
If arrays sent using data busses are sent at 'data rate', what rate are they sent at when you use an array send? Is one faster than the other? more CPU efficient?
Custom Ryzen 5900x MATX build, Win10, Fireface UFX, touchscreen
Custom 2 manual midi keyboard
Usine, Kontakt, Reaktor, Synthmaster, Byome, Arturia, Soundtoys, Unify
Custom 2 manual midi keyboard
Usine, Kontakt, Reaktor, Synthmaster, Byome, Arturia, Soundtoys, Unify
What do you mean by "array send"?
Everything is sent at "data rate" in Usine, even audio wich is sent with arrays sized on "block size".
Arrays are data, so you can use "data busses". Using busses compared to wires will introduced one block size latency, but could be more CPU efficient.
Sylvain
Everything is sent at "data rate" in Usine, even audio wich is sent with arrays sized on "block size".
Arrays are data, so you can use "data busses". Using busses compared to wires will introduced one block size latency, but could be more CPU efficient.
Sylvain
-
sm_jamieson
- Member
- Posts: 553
- Contact:
If this is helpful to anyone:
If you send an array event (event size > 1) to a data bus, then whole array will be sent every bloc.
If you send a sequence of events and queue them into an array (like the x.iso patch), each value will take a bloc,
so an array size 8 would take 8 blocs to fill.
If you write User module, you can create sort of custom event formats - an event is just a block of 32 bit words after all.
Also, a text event is just an array with a floating point ascii value in each array position. You can find out by putting a text wire into an array display module.
This is sort of inefficient, since an ascii value is only 8 bits and an event value is 32 bits. However, this makes it more flexible and also
would allow Unicode values in there.
Something to watch out for if you use the SDK: some functions provide a Unicode string rather than an ascii string.
Some other things I have noticed:
Although all events are the same format, the parameter/PIN you send it to can affect the way it is interpreted - which matters
if you make User modules or scripts.
Since events are nominally 32 bit float, if you try to send a large integer value you need to avoid the integer value being converted to
a float (which only has 24 bits of precision), which means some colours will be corrupted.
The way to do this is to use a "Bitwise" parameter, which will leave the bits how you put them into the event.
And in the SDK set the values using an event pointer that can be cast to whatever type you want.
If you send an array event (event size > 1) to a data bus, then whole array will be sent every bloc.
If you send a sequence of events and queue them into an array (like the x.iso patch), each value will take a bloc,
so an array size 8 would take 8 blocs to fill.
If you write User module, you can create sort of custom event formats - an event is just a block of 32 bit words after all.
Also, a text event is just an array with a floating point ascii value in each array position. You can find out by putting a text wire into an array display module.
This is sort of inefficient, since an ascii value is only 8 bits and an event value is 32 bits. However, this makes it more flexible and also
would allow Unicode values in there.
Something to watch out for if you use the SDK: some functions provide a Unicode string rather than an ascii string.
Some other things I have noticed:
Although all events are the same format, the parameter/PIN you send it to can affect the way it is interpreted - which matters
if you make User modules or scripts.
Since events are nominally 32 bit float, if you try to send a large integer value you need to avoid the integer value being converted to
a float (which only has 24 bits of precision), which means some colours will be corrupted.
The way to do this is to use a "Bitwise" parameter, which will leave the bits how you put them into the event.
And in the SDK set the values using an event pointer that can be cast to whatever type you want.
well, all signals sent at data-rate except for audio signals, when sent through appropriate nodes. some modules also have options to enable audio-rate for data modulation.SylvainT wrote: ↑10 Jan 2020, 10:09What do you mean by "array send"?
Everything is sent at "data rate" in Usine, even audio wich is sent with arrays sized on "block size".
Arrays are data, so you can use "data busses". Using busses compared to wires will introduced one block size latency, but could be more CPU efficient.
Sylvain
join Hollyhock Usine Discord server: https://discord.gg/EdJarnE
Who is online
Users browsing this forum: No registered users and 71 guests
