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

save multiline text in preset

For general discussion related FlowStone

Re: save multiline text in preset

Postby tulamide » Tue Sep 12, 2017 12:35 pm

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

Postby Spogg » Tue Sep 12, 2017 12:36 pm

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
User avatar
Spogg
 
Posts: 3358
Joined: Thu Nov 20, 2014 4:24 pm
Location: Birmingham, England

Re: save multiline text in preset

Postby RJHollins » Tue Sep 12, 2017 5:58 pm

Thanks Adam .... works nice !
8-)
RJHollins
 
Posts: 1571
Joined: Thu Mar 08, 2012 7:58 pm

Re: save multiline text in preset

Postby FlowStoner » Tue Sep 12, 2017 7:47 pm

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.
FlowStoner
 
Posts: 24
Joined: Tue Aug 01, 2017 2:03 pm

Re: save multiline text in preset

Postby gvalletto » Tue Sep 12, 2017 9:33 pm

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?
Attachments
text in 2 presets.fsm
(29 KiB) Downloaded 924 times
User avatar
gvalletto
 
Posts: 117
Joined: Fri Jul 09, 2010 10:15 pm
Location: Argentina

Re: save multiline text in preset

Postby tulamide » Tue Sep 12, 2017 9:49 pm

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

Postby adamszabo » Tue Sep 12, 2017 11:14 pm

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

Postby gvalletto » Wed Sep 13, 2017 3:20 pm

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
snap.jpg (20.57 KiB) Viewed 25621 times
User avatar
gvalletto
 
Posts: 117
Joined: Fri Jul 09, 2010 10:15 pm
Location: Argentina

Re: save multiline text in preset

Postby Youlean » Wed Sep 13, 2017 5:00 pm

tulamide wrote:
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...
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.

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

Postby gvalletto » Wed Sep 13, 2017 9:32 pm

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...
User avatar
gvalletto
 
Posts: 117
Joined: Fri Jul 09, 2010 10:15 pm
Location: Argentina

PreviousNext

Return to General

Who is online

Users browsing this forum: No registered users and 12 guests