Support

If you have a problem or need to report a bug please email : support@dsprobotics.com

There are 3 sections to this support area:

DOWNLOADS: access to product manuals, support files and drivers

HELP & INFORMATION: tutorials and example files for learning or finding pre-made modules for your projects

USER FORUMS: meet with other users and exchange ideas, you can also get help and assistance here

NEW REGISTRATIONS - please contact us if you wish to register on the forum

Users are reminded of the forum rules they sign up to which prohibits any activity that violates any laws including posting material covered by copyright

how to save dynamically sized arrays in preset?

For general discussion related FlowStone

how to save dynamically sized arrays in preset?

Postby Nubeat7 » Mon Aug 11, 2014 9:32 pm

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?
User avatar
Nubeat7
 
Posts: 1347
Joined: Sat Apr 14, 2012 9:59 am
Location: Vienna

Re: how to save dynamically sized arrays in preset?

Postby tester » Mon Aug 11, 2014 11:34 pm

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.
tester
 
Posts: 1786
Joined: Wed Jan 18, 2012 10:52 pm
Location: Poland, internet

Re: how to save dynamically sized arrays in preset?

Postby Nubeat7 » Mon Aug 11, 2014 11:45 pm

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
User avatar
Nubeat7
 
Posts: 1347
Joined: Sat Apr 14, 2012 9:59 am
Location: Vienna

Re: how to save dynamically sized arrays in preset?

Postby KG_is_back » Mon Aug 11, 2014 11:48 pm

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.
KG_is_back
 
Posts: 1196
Joined: Tue Oct 22, 2013 5:43 pm
Location: Slovakia

Re: how to save dynamically sized arrays in preset?

Postby tester » Mon Aug 11, 2014 11:48 pm

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.
tester
 
Posts: 1786
Joined: Wed Jan 18, 2012 10:52 pm
Location: Poland, internet

Re: how to save dynamically sized arrays in preset?

Postby Nubeat7 » Tue Aug 12, 2014 12:09 am

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
User avatar
Nubeat7
 
Posts: 1347
Joined: Sat Apr 14, 2012 9:59 am
Location: Vienna

Re: how to save dynamically sized arrays in preset?

Postby RJHollins » Tue Aug 12, 2014 12:27 am

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 ;)
RJHollins
 
Posts: 1571
Joined: Thu Mar 08, 2012 7:58 pm

Re: how to save dynamically sized arrays in preset?

Postby tester » Tue Aug 12, 2014 12:48 am

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.
tester
 
Posts: 1786
Joined: Wed Jan 18, 2012 10:52 pm
Location: Poland, internet

Re: how to save dynamically sized arrays in preset?

Postby tulamide » Tue Aug 12, 2014 11:11 am

Give this a try. I'd say it's as dynamic as can be :mrgreen:
Attachments
dynamic_array_preset.fsm
(399 Bytes) Downloaded 854 times
"There lies the dog buried" (German saying translated literally)
tulamide
 
Posts: 2714
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: how to save dynamically sized arrays in preset?

Postby Nubeat7 » Tue Aug 12, 2014 11:43 am

@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
User avatar
Nubeat7
 
Posts: 1347
Joined: Sat Apr 14, 2012 9:59 am
Location: Vienna

Next

Return to General

Who is online

Users browsing this forum: No registered users and 52 guests