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

float to hex converter

Post any examples or modules that you want to share here

float to hex converter

Postby KG_is_back » Sat May 17, 2014 3:44 pm

Lately I needed to store a bunch of coefficients with preset manager and I've found out that the floats get rounded to 6 decimal places. That is OK when saving knob positions and bar graphs, but it is very poor when saving coefficients for a filter. This little tool can lossless convert float array to array of hex (string array) and vice versa, which let's you save your parameters with full precision.

I believe this can be dome much faster and easier in ruby...can someone do that too please?
Attachments
hex_float.fsm
(1.52 KiB) Downloaded 1186 times
KG_is_back
 
Posts: 1196
Joined: Tue Oct 22, 2013 5:43 pm
Location: Slovakia

Re: float to hex converter

Postby Nubeat7 » Sun May 18, 2014 10:15 am

here`s a ruby version
Attachments
hex_float_ruby.fsm
(4.54 KiB) Downloaded 1251 times
User avatar
Nubeat7
 
Posts: 1347
Joined: Sat Apr 14, 2012 9:59 am
Location: Vienna

Re: float to hex converter

Postby KG_is_back » Sun May 18, 2014 4:16 pm

Thanks Nubeat, this is great! This should be a default way to save floating point numbers in preset manager. Or there should be a boolean input on the preset parameter primitive to switch between classic (decimal) and precise (hex) parameter saving mode. Actually it also takes less space to save the number as 8 symbols rather than 7+ numbers and a decimal dot.
KG_is_back
 
Posts: 1196
Joined: Tue Oct 22, 2013 5:43 pm
Location: Slovakia

Re: float to hex converter

Postby Nubeat7 » Sun May 18, 2014 7:32 pm

you`re welcome KG, yes you are right, also when the file gets more cryptic but it isn`t here for change things anyway, it just gets bit morecomplicated when you need to compare or look the preset file for testreasons... but everything which make them smaller is good!

how did you modify the presetmanager to use hex?
User avatar
Nubeat7
 
Posts: 1347
Joined: Sat Apr 14, 2012 9:59 am
Location: Vienna

Re: float to hex converter

Postby KG_is_back » Sun May 18, 2014 9:18 pm

very simple - convert string array to string delimiting with random char (usually I use ? or * as they are rarely used) and save them using "string preset" primitive. extraction works other way around - convert string to string array by separating it at ? or * whichever is the case. ....actually for the float arrays saved as hex, you can simply convert them to string with no delimiter and convert them back by spliting them to 8 long strings.

It is written there that the string must be 255-long at max, but I never noticed any problem even with much longer strings.
Attachments
string preset.fsm
(355 Bytes) Downloaded 1175 times
KG_is_back
 
Posts: 1196
Joined: Tue Oct 22, 2013 5:43 pm
Location: Slovakia

Re: float to hex converter

Postby Nubeat7 » Sun May 18, 2014 11:18 pm

ah okay, so you collect parameters and save it under one presetname (why does longer strings then 255 works too?), but what about automation and parameter names then? would this work too, or is it only good for non automated parameters?
User avatar
Nubeat7
 
Posts: 1347
Joined: Sat Apr 14, 2012 9:59 am
Location: Vienna

Re: float to hex converter

Postby KG_is_back » Sun May 18, 2014 11:35 pm

This might work...

However, you probably don't benefit from lossless precision on automatable parameters
Attachments
string preset 2.fsm
(780 Bytes) Downloaded 1165 times
KG_is_back
 
Posts: 1196
Joined: Tue Oct 22, 2013 5:43 pm
Location: Slovakia

Re: float to hex converter

Postby Nubeat7 » Mon May 19, 2014 10:29 am

oh, i didn`t know that the parameters will be recognised in the DAW when preset is off and automate is on - thats fine thanks!
User avatar
Nubeat7
 
Posts: 1347
Joined: Sat Apr 14, 2012 9:59 am
Location: Vienna


Return to User Examples

Who is online

Users browsing this forum: No registered users and 29 guests