Page 1 of 4

how to save dynamically sized arrays in preset?

Posted: Mon Aug 11, 2014 9:32 pm
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?

Re: how to save dynamically sized arrays in preset?

Posted: Mon Aug 11, 2014 11:34 pm
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.

Re: how to save dynamically sized arrays in preset?

Posted: Mon Aug 11, 2014 11:45 pm
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

Re: how to save dynamically sized arrays in preset?

Posted: Mon Aug 11, 2014 11:48 pm
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.

Re: how to save dynamically sized arrays in preset?

Posted: Mon Aug 11, 2014 11:48 pm
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?

Re: how to save dynamically sized arrays in preset?

Posted: Tue Aug 12, 2014 12:09 am
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

Re: how to save dynamically sized arrays in preset?

Posted: Tue Aug 12, 2014 12:27 am
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 ;)

Re: how to save dynamically sized arrays in preset?

Posted: Tue Aug 12, 2014 12:48 am
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:

Re: how to save dynamically sized arrays in preset?

Posted: Tue Aug 12, 2014 11:11 am
by tulamide
Give this a try. I'd say it's as dynamic as can be :mrgreen:

Re: how to save dynamically sized arrays in preset?

Posted: Tue Aug 12, 2014 11:43 am
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