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
float to hex converter
8 posts
• Page 1 of 1
float to hex converter
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?
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 1241 times
- KG_is_back
- Posts: 1196
- Joined: Tue Oct 22, 2013 5:43 pm
- Location: Slovakia
Re: float to hex converter
here`s a ruby version
- Attachments
-
- hex_float_ruby.fsm
- (4.54 KiB) Downloaded 1315 times
-
Nubeat7 - Posts: 1347
- Joined: Sat Apr 14, 2012 9:59 am
- Location: Vienna
Re: float to hex converter
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
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?
how did you modify the presetmanager to use hex?
-
Nubeat7 - Posts: 1347
- Joined: Sat Apr 14, 2012 9:59 am
- Location: Vienna
Re: float to hex converter
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.
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 1232 times
- KG_is_back
- Posts: 1196
- Joined: Tue Oct 22, 2013 5:43 pm
- Location: Slovakia
Re: float to hex converter
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?
-
Nubeat7 - Posts: 1347
- Joined: Sat Apr 14, 2012 9:59 am
- Location: Vienna
Re: float to hex converter
This might work...
However, you probably don't benefit from lossless precision on automatable parameters
However, you probably don't benefit from lossless precision on automatable parameters
- Attachments
-
- string preset 2.fsm
- (780 Bytes) Downloaded 1228 times
- KG_is_back
- Posts: 1196
- Joined: Tue Oct 22, 2013 5:43 pm
- Location: Slovakia
Re: float to hex converter
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!
-
Nubeat7 - Posts: 1347
- Joined: Sat Apr 14, 2012 9:59 am
- Location: Vienna
8 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 72 guests