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
String array to preset string.
6 posts
• Page 1 of 1
String array to preset string.
I am trying to save a string array into a preset but on load it always returns the string array with these "/////"
Any thoughts on this ?
Any thoughts on this ?
-
lalalandsynth - Posts: 600
- Joined: Sat Oct 01, 2016 12:48 pm
Re: String array to preset string.
hmm, odd I've never had that happen before.
Sorry I don't have My PC available to Me ATM but if I did I'd sort it out for You, GL.
Sorry I don't have My PC available to Me ATM but if I did I'd sort it out for You, GL.
-
wlangfor@uoguelph.ca - Posts: 912
- Joined: Tue Apr 03, 2018 5:50 pm
- Location: North Bay, Ontario, Canada
Re: String array to preset string.
This is what it looks like opened in Sublime text.
So It obviously saves it like that ?
So It obviously saves it like that ?
-
lalalandsynth - Posts: 600
- Joined: Sat Oct 01, 2016 12:48 pm
Re: String array to preset string.
Multi-line preset strings have always been a problem, but this seems to be a rather new spin on it (I think you're using a later version of FS to me, judging by the extra inputs on your VST String primitive.)
The extra data in the file represents line endings, which in Windows are always a sequence of two characters; CTRL-R (carriage return) followed by CTRL-N (new-line). Backslash is often used as an escape character to indicate that what follows is a control character (as it is in Ruby - "Line1\r\nLine2" would be a two-line String.)
In older versions of FS, you couldn't have line breaks in a preset String at all, because each parameter was allowed only one line of the file, and any new line characters got interpreted literally as starting a new row of the table, messing up the data. It looks as if newer versions of FS have tried to get around this limitation by using escaped control characters to mark line endings - but the doubled backslashes are messing this up. The intent seems pretty clear, so I'd say that this is certainly a bug in FS.
For both the old and this new problem with multi-line VST Strings, you can work around them by joining the array elements into a single String with the "String Array to String" primitive, using a separator character of your choice (e.g. a comma), and then use the "Split String" primitive to convert back to a string array. However, note that a VST String can only contain 255 (IIRC) characters, so you need to be careful that your array isn't too large!
The extra data in the file represents line endings, which in Windows are always a sequence of two characters; CTRL-R (carriage return) followed by CTRL-N (new-line). Backslash is often used as an escape character to indicate that what follows is a control character (as it is in Ruby - "Line1\r\nLine2" would be a two-line String.)
In older versions of FS, you couldn't have line breaks in a preset String at all, because each parameter was allowed only one line of the file, and any new line characters got interpreted literally as starting a new row of the table, messing up the data. It looks as if newer versions of FS have tried to get around this limitation by using escaped control characters to mark line endings - but the doubled backslashes are messing this up. The intent seems pretty clear, so I'd say that this is certainly a bug in FS.
For both the old and this new problem with multi-line VST Strings, you can work around them by joining the array elements into a single String with the "String Array to String" primitive, using a separator character of your choice (e.g. a comma), and then use the "Split String" primitive to convert back to a string array. However, note that a VST String can only contain 255 (IIRC) characters, so you need to be careful that your array isn't too large!
All schematics/modules I post are free for all to use - but a credit is always polite!
Don't stagnate, mutate to create!
Don't stagnate, mutate to create!
-
trogluddite - Posts: 1730
- Joined: Fri Oct 22, 2010 12:46 am
- Location: Yorkshire, UK
Re: String array to preset string.
Excellent ! , Thanks for this Trog .
Only need to save 24 characters but 24 sets of them so 288 if i joined it into one string array .
Will report this as a bug .
Only need to save 24 characters but 24 sets of them so 288 if i joined it into one string array .
Will report this as a bug .
-
lalalandsynth - Posts: 600
- Joined: Sat Oct 01, 2016 12:48 pm
Re: String array to preset string.
Reported as a bug in the ALPHA , bug found , fixed.
-
lalalandsynth - Posts: 600
- Joined: Sat Oct 01, 2016 12:48 pm
6 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 80 guests