understanding preset primatives

For general discussion related FlowStone
Post Reply
Quentin
Posts: 37
Joined: Sat Jul 14, 2012 5:35 am

understanding preset primatives

Post by Quentin »

I am trying to understand the preset modules and have confused myself- I have the string presets working- I give them distinct names as they have distinct values as I cycle through different "programs" in the preset manager.
However, the array preset confuses me. I am not able to create distinct float arrays based on their names eg "array_1" "array_2"in my example. I must be missing something.
Thanks,
Quentin
Attachments
preset_question.fsm
(7.66 KiB) Downloaded 909 times
User avatar
nix
Posts: 817
Joined: Tue Jul 13, 2010 10:51 am

Re: understanding preset primatives

Post by nix »

That all looks fine Quentin.
What's wrong with the example?

Where are you checking the saved arrays?
It does work, I have hundreds of float array presets in my VSTs
User avatar
trogluddite
Posts: 1730
Joined: Fri Oct 22, 2010 12:46 am
Location: Yorkshire, UK

Re: understanding preset primatives

Post by trogluddite »

Hi Quentin,

I don't think you've done anything wrong, it really should work. There is something odd going on with the String->Array conversion - possibly a bug in FS. When I looked inside the array presets module, I found that the string is not being converted to an array on its way into the preset parameter.
Can't work out why that is - I tried the same string with other array prim's, and it didn't work with those either. I thought maybe the line separators were not right, but they looked OK when I scanned the string with Ruby - but maybe the multi-line edit is inserting some other illegal non-printing character that's confusing the array conversion?

Anyhow - here's a fix.
preset_question FIX.fsm
(7.86 KiB) Downloaded 927 times

I put in a little Ruby module to turn the string into an array. It works by actually scanning for the pattern of characters that makes up a number, so it should work regardless of what separator characters are used, and will ignore any illegal characters.
I also set the "Trig" inputs on the edit box primitives to true - this makes the edit box only send a value when you finish editing the value on the GUI. Without this, you will get a nasty feedback loop where; edit box updates preset, preset updates edit box, edit box updates preset.... round and round until FS blows its "too many triggers" fuse.
All schematics/modules I post are free for all to use - but a credit is always polite!
Don't stagnate, mutate to create!
Post Reply