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
save multiline text in preset
36 posts
• Page 2 of 4 • 1, 2, 3, 4
Re: save multiline text in preset
adamszabo wrote:The easiest and most simplest solution is to convert your multiline string to hexadecimal then convert it back. The problem is that the string preset only holds 255 (i think) characters and you can only write a small description, but it does the job
That's a cool idea! Also, it stays within the VST definitions. And yes, as I said earlier in another post, there still is the 255 char limit. You have to take care of it, or else the text will be cut.
"There lies the dog buried" (German saying translated literally)
- tulamide
- Posts: 2714
- Joined: Sat Jun 21, 2014 2:48 pm
- Location: Germany
Re: save multiline text in preset
adamszabo wrote:The easiest and most simplest solution is to convert your multiline string to hexadecimal then convert it back. The problem is that the string preset only holds 255 (i think) characters and you can only write a small description, but it does the job
Excellent Adam! Straight into my toolbox.
Simple and effective solution and using none of that magic Ruby stuff!
255 characters should be sufficient for notes and bits of help text I would say.
Thanks for sharing!
Spogg
-
Spogg - Posts: 3358
- Joined: Thu Nov 20, 2014 4:24 pm
- Location: Birmingham, England
Re: save multiline text in preset
Thanks Adam .... works nice !
- RJHollins
- Posts: 1571
- Joined: Thu Mar 08, 2012 7:58 pm
Re: save multiline text in preset
Base64 encoding
you can store max 186 char ascii, included special control.
- Code: Select all
str = ["\x31"*186].pack('m')
watch 'str', s = str.unpack('m').first
watch 'size', [str.size, s.size]
you can store max 186 char ascii, included special control.
- FlowStoner
- Posts: 24
- Joined: Tue Aug 01, 2017 2:03 pm
Re: save multiline text in preset
Thaks Adam! great work with simple resources.
I attempted to double the number of characters in this new attached scheme.
This scheme stores the text in 2 presets, since 500 characters it is enough for my needs.
There´s 2 box. The idea is to accommodate them graphically so they look like a single box.
If you type in the upper box, when it reaches 255 characters, the cursor will automatically switch to the box below. This system works fine, but if after writing in the box below I click on the upper one, it allows me to write more than 255 characters (obviously them will be not saved correctly). I have tried several things to limit text input to a maximum of 255 characters but I have not succeeded. any idea?
I attempted to double the number of characters in this new attached scheme.
This scheme stores the text in 2 presets, since 500 characters it is enough for my needs.
There´s 2 box. The idea is to accommodate them graphically so they look like a single box.
If you type in the upper box, when it reaches 255 characters, the cursor will automatically switch to the box below. This system works fine, but if after writing in the box below I click on the upper one, it allows me to write more than 255 characters (obviously them will be not saved correctly). I have tried several things to limit text input to a maximum of 255 characters but I have not succeeded. any idea?
- Attachments
-
- text in 2 presets.fsm
- (29 KiB) Downloaded 924 times
-
gvalletto - Posts: 117
- Joined: Fri Jul 09, 2010 10:15 pm
- Location: Argentina
Re: save multiline text in preset
Had just a quick look, since I'm on something else currently, but the issue is the bool to trigger prim. This fires one trigger only when the boolean changes to true. Since on re-entering the boolean still is true, no trigger is sent this time. You might want to find a way to "reset" the comparison prim to false on leave (which is what I will also try later), so that the prim can send a trigger again on re-entering.
"There lies the dog buried" (German saying translated literally)
- tulamide
- Posts: 2714
- Joined: Sat Jun 21, 2014 2:48 pm
- Location: Germany
Re: save multiline text in preset
Also, right now you are counting the actual strings before they get converted into hex and thats not accurate. You need to put the length after the String to Hex, because thats the actual values that go into the preset text.
- adamszabo
- Posts: 667
- Joined: Sun Jul 11, 2010 7:21 am
Re: save multiline text in preset
adamszabo wrote:Also, right now you are counting the actual strings before they get converted into hex and thats not accurate. You need to put the length after the String to Hex, because thats the actual values that go into the preset text.
Please see this image. There is the reason by which I connected the counter before the conversion: I prefer to see the real quantity of chars.
In addition, although 255 characters of text mean 510 characters in hexadecimal, the presets work fine, which caught my attention ...
- Attachments
-
- snap.jpg (20.57 KiB) Viewed 25572 times
-
gvalletto - Posts: 117
- Joined: Fri Jul 09, 2010 10:15 pm
- Location: Argentina
Re: save multiline text in preset
tulamide wrote:That also is not a solution. While you can indeed save an array in a preset, it again is limited. This time to a single precision float and only in the range 0-1. So, even if you'd convert the ints to floats in that range, due to the imprecise single precision floats it would come to decryption errors.Youlean wrote:Can you save array in preset? (Haven't used a Flowstone for a while). If so, just cast every char to int and save is as int array...
Not true. You only need to store 256 different values in range 0-1 which is enough precise for float.
- Youlean
- Posts: 176
- Joined: Mon Jun 09, 2014 2:49 pm
Re: save multiline text in preset
FlowStoner wrote:Base64 encoding
- Code: Select all
str = ["\x31"*186].pack('m')
watch 'str', s = str.unpack('m').first
watch 'size', [str.size, s.size]
you can store max 186 char ascii, included special control.
Hi Flowstoner, excuse my ignorance, can You explain about that? I just use Flowstone DSP code...
-
gvalletto - Posts: 117
- Joined: Fri Jul 09, 2010 10:15 pm
- Location: Argentina
36 posts
• Page 2 of 4 • 1, 2, 3, 4
Who is online
Users browsing this forum: No registered users and 26 guests