how to save dynamically sized arrays in preset?

For general discussion related FlowStone
User avatar
Nubeat7
Posts: 1347
Joined: Sat Apr 14, 2012 9:59 am
Location: Vienna
Contact:

how to save dynamically sized arrays in preset?

Post by Nubeat7 »

hi, like the title says, how can i save dynamically sized arrays in a preset?

using the presetparameter array i need to limit the size with the nr of entries and when there are less entries saved i have a lots of 0.0 elements,

using string preset is limited to 255 chars which gets to small pretty fast when floatvalues needed to be saved..

any ideas?
tester
Posts: 1786
Joined: Wed Jan 18, 2012 10:52 pm
Location: Poland, internet

Re: how to save dynamically sized arrays in preset?

Post by tester »

Have you tried to pusch the preset array through "add" primitive that combines preset values with text that contains 0's? Theoretically it could work, because 0 + nil = 0.

But changing the amount of parameters within preset array and ruringoperation - may crash the schematic very often as far I remember.
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
User avatar
Nubeat7
Posts: 1347
Joined: Sat Apr 14, 2012 9:59 am
Location: Vienna
Contact:

Re: how to save dynamically sized arrays in preset?

Post by Nubeat7 »

tester wrote:Have you tried to pusch the preset array through "add" primitive that combines preset values with text that contains 0's? Theoretically it could work, because 0 + nil = 0.

i don't understand what you mean with this
KG_is_back
Posts: 1196
Joined: Tue Oct 22, 2013 5:43 pm
Location: Slovakia

Re: how to save dynamically sized arrays in preset?

Post by KG_is_back »

You can convert floats to hex to save place (as hex float is 8characters long an in full precision, opposed to decimal version stored as text). I was able to store preset strings longer than 255chars here, without any problems.

Maybe you can save the array as a text file on harddrive and only reference that text. However that way the preset sharing between machines will not work.

Nubeat7 wrote:i don't understand what you mean with this


He means that you may try to store the array size as a parameter (one parameter to resize the array). I do not know it that will actually work at all.
tester
Posts: 1786
Joined: Wed Jan 18, 2012 10:52 pm
Location: Poland, internet

Re: how to save dynamically sized arrays in preset?

Post by tester »

On one side you can limit preset array size to store.

On the other side, you can do this:

presetvalue
presetvalue
presetvalue

+

0
0
0
0
0

=

presetvalue
presetvalue
presetvalue
0
0

thus - it will send 0's to other fields.
Or I did not understood your concept?
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
User avatar
Nubeat7
Posts: 1347
Joined: Sat Apr 14, 2012 9:59 am
Location: Vienna
Contact:

Re: how to save dynamically sized arrays in preset?

Post by Nubeat7 »

KG_is_back wrote:You can convert floats to hex to save place (as hex float is 8characters long an in full precision, opposed to decimal version stored as text). I was able to store preset strings longer than 255chars here, without any problems.

Maybe you can save the array as a text file on harddrive and only reference that text. However that way the preset sharing between machines will not work.


yeah, i thought about the hex float conversion too, i need to test this because a limitation to 32 values is too small but if it works with more then 255 chars (up to 1000 or so) it would be fine

the reference to a textfile is a great idea, specially because i would have multidimensional arrays (4 parameters for each array element), so i wouldn't need to split them to 4 preset parameter arrays :!:

@tester i think the zeros would be added anyway if the array is smaller then the presetparameter array as long as you feed the whole array and not by index where it could happen that some old values are still in the unused area of the array
RJHollins
Posts: 1573
Joined: Thu Mar 08, 2012 7:58 pm

Re: how to save dynamically sized arrays in preset?

Post by RJHollins »

Hi NuBeat,

If looking at saving it off as text .... MAYBE the idea of the 'Marshall' routine might be handy. I know it saved me a tremedous amount of array management [like the size].

Just a suggestion, not following exactly your needs.

Reading this with interest ;)
tester
Posts: 1786
Joined: Wed Jan 18, 2012 10:52 pm
Location: Poland, internet

Re: how to save dynamically sized arrays in preset?

Post by tester »

Nubeat7 wrote:@tester i think the zeros would be added anyway if the array is smaller then the presetparameter array as long as you feed the whole array and not by index where it could happen that some old values are still in the unused area of the array


Don't listen to me today. :mrgreen:
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
tulamide
Posts: 2714
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: how to save dynamically sized arrays in preset?

Post by tulamide »

Give this a try. I'd say it's as dynamic as can be :mrgreen:
Attachments
dynamic_array_preset.fsm
(399 Bytes) Downloaded 1086 times
"There lies the dog buried" (German saying translated literally)
User avatar
Nubeat7
Posts: 1347
Joined: Sat Apr 14, 2012 9:59 am
Location: Vienna
Contact:

Re: how to save dynamically sized arrays in preset?

Post by Nubeat7 »

@tulamide

the problem is not to assign it dynamically, its to reload it..

lets say you have just saved a preset with 5 elements - so thereis 5 at the n connector - now you load the next preset which has 10 elements - it cannot work because there will be loaded just 5 because on the n connector there is still the 5... so you has to set this connector to the maximum size of the array
Post Reply