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

Re: how to save dynamically sized arrays in preset?

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

Nubeat7 wrote:@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

You better had named your post "how to reload..." then :mrgreen:
Since the n connector is reset to zero and then set to the actual size of the array, this should work when reloading, too? If not, could you give a simple example fsm? I would be happy to work something out.

EDIT: I'm thinking of storing the size of the array as the first entry in the array, so you could always access it and reset N to whatever is needed.
"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 12:02 pm

you would need to set the size of the presetparameter array before it gets loaded,

maybe if you read the preset which should be loaded next with the before presetchange trigger - get the size of it - set the presetparameter array size - and then when this is done load the preset - maybe this could work!?

here is a simple schematic which shows th issue, just try it out with different sizes and reload them
Attachments
dynamic_array_preset (1).fsm
(6.7 KiB) Downloaded 833 times
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 » Tue Aug 12, 2014 2:25 pm

Don't listen to me, but... If your intention is to save/reload only non-zero elements, where 0's can happen in between - then you would need to use two param arrays. One for gathering non-zero indexes and one for gathering non-zero values. Then it can work like this:

incoming:

value
0
vaue
0
value

saving:

value
value
value

(and indexes on second array)

loading:

value
value
value

(and indexes on second array)

redistributing:

value
0
vaue
0
value

*

As for preset array param size - you can set it dynamically, but as I said - it tends to crash the schematics.
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 3:47 pm

saving the whole multidimensional array into a file and referencing to the presets with the current program which i get from the presetmanager seems to be a very good way.

the problem i get here is, how i could automaticly reference to the loaded project in the DAW?
like when you load the plugin you get the default presets, fine, but when you load a project where it is included already you should get the presets saved in the last session (gets more complicated with more then one instances) i see no way to make this work without saving and loading the presets by hand for each project you are using it.
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 » Tue Aug 12, 2014 4:30 pm

How about ruby saveState and loadState functions? wouldn't they work?
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 Nubeat7 » Tue Aug 12, 2014 6:25 pm

hmm, maybe, but how to make the difference of loading the plugin new into the project or load it with the project... i also don't know how this is handled between DAW and the Presetsystem in FS?

i think the file solution is good for standalone versions, i will give it a try with the arrays and a maximum nr of entries and see how it loads..
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 tulamide » Fri Aug 15, 2014 9:07 pm

Here's a possible solution. The trick is that all arrays are concatenated into one big array, and only that array is stored as preset array. Modules for concetanation and accessing the sub-arrays seperately afterwards should be self explaining. But of course, feel free to ask!

Remember, this is just a demo. There are a few things to consider. For example, you might want to give the arrays some id-numbers for an even more comfortable access. Or the fact that preset arrays are said to only have values between 0-1.

But the mechanic is fairly easy expandable. For example, just divide the size parameter by, let's say, 1000 before storing it in the array. When reading such an array from the big array, make sure the size parameter is multiplied by 1000.

Hope it helps. Make use of it and don't hold back, if you've something to ask or to criticise!

Loads of thanks to trog, who solved an issue with the read module and further optimized it!
Attachments
multi_arrays_to_one_preset.fsm
(3.52 KiB) 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 tester » Fri Aug 15, 2014 10:36 pm

@tulamide - use CTRL+click on the "x" on the module in "properties" its state, to pin the state permanently.
Then it will not autoclose.
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 » Fri Aug 15, 2014 11:05 pm

tester wrote:@tulamide - use CTRL+click on the "x" on the module in "properties" its state, to pin the state permanently.
Then it will not autoclose.

Ah, I'm sorry! I have auto-close disabled in the options, so that each and every properties view is always pinned (I prefer to manually close those, I don't need to see). I thought, when saving such a schematic, they would stay pinned. I hope to think of it next time ;)
"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 tester » Fri Aug 15, 2014 11:41 pm

Nothing happened. :-)
I did not knew that trick for a long time of use.
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

PreviousNext

Return to General

Who is online

Users browsing this forum: No registered users and 36 guests