skinnable user-interface with Text Load and Parser
Archive · 200517 old posts
From the original SynthMaker forum (2004–2014), with its members’ names and dates.
rl ·
Here is a simple experiment with a skinnable user-interface.
The idea is that the UI is driven by a settings file (default.cfg) which is loaded at startup. The user can modify the file and load it into the plugin. If it looks good he can save the settings as default.cfg.
Here is the schematic together with two configurations
It's ok with OSM files in SM, but works not so well when exported as a VSTi, caused by some bugs/strange behaviour in SM (or I'm doing something wrong) :
Bugs
-
when loading file using "load config..."-button: ok
when loading file thru "After Load": error: synthmaker puts extra chars in string (after save: line ending is 0x0d 0x0d 0x0d 0x0a)
-
error: FileFilters Input in "File Dialog" does not work (no filtering in File Open Dialog)
-
error: connect a String to the FileFilters Input of "File Dialog": everytime a Character is typed the File Open Dialog is triggered.
-
error: "After Load" does not work in VST plugin - seems to work only when opened as OSM file within SM
Suggestions:
-
Add an error trigger for Text Load and Text Save in addition to done trigger that fires on errors, so "Load Failed"/"Save Failed" messages can be shown.
-
In the example schematic the "save" Button (without giving any path) saves default.cfg in the directory which has the last open File Dialog displayed. I think it needs some way to use the plugin's directory as the default directory, when no path is given. (As dicussed recently in this forum)
Questions (advice needed):
-
The parser in the example works only when the exact sequence of lines (key=value; settings) is written in the file.
How could I change the parser, so that the lines could be in any sequence?
-
Can I setup the parser, so that comment lines could be written anywhere? (currently only the first line)?
-
How can I specify special (non Alnum) chars in "Rule Range" - I would like to specify something like a-zA-Z0-9,.:-_+()[]{} ?
EDIT: schematic improved. Parser now works as expected. Pls. download again from URL above
jorge ·
Great stuff rl, if you keep using it I'll implement new missing parsing rules if needed.
rl wrote: Questions (advice needed):
-
The parser in the example works only when the exact sequence of lines (key=value; settings) is written in the file.
How could I change the parser, so that the lines could be in any sequence?
The following schematic would match either "aaa" or "bbb" but not "aaa bbb" and not "bbb aaa":
The following will match 0 or more matched of either "aaa" or "bbb", I think it's what you need in your schematic:
jorge ·
rl wrote: Can I setup the parser, so that comment lines could be written anywhere? (currently only the first line)?
I think if you use the Kleene start rule as I suggest in the last post it will sort that too. The comment will just become one of the optional lines that can appear anywhere zero or more times.
I'm not sure but I think there is a small bug that might make your parsing not work after you delete a parsing component. If you save and load that bug doesnt show and it should always work.
jorge ·
rl wrote: How can I specify special (non Alnum) chars in "Rule Range" - I would like to specify something like a-zA-Z0-9,.:-_+()[]{} ?
There should be a new component to do that.
For now you'll have to look at an ASCII table:
http://www.lookuptables.com
and do something like the following:
Shifrin ·
That's way cool rl 😀
Shif.
rl ·
jorge wrote: Great stuff rl, if you keep using it I'll implement new missing parsing rules if needed.
Oh yes, thank you for the quick reply. I will have a look on your examples when I'm at home....
lalo ·
nice stuff rl!
yeah 🙂
rl ·
Thanks Jorge, the parser now works as expected, I've updated the schematic. Now it's your turn to fix the bugs 😉
Tom7777 ·
I was planning on making some similar things when i have time to do so, thanks for the example rl 🙂
infuzion ·
Has anyone noticed (w _e?) that the loaded config in the Data:Text is double-spaced?
rl ·
infuzion wrote: Has anyone noticed (w _e?) that the loaded config in the Data:Text is double-spaced?
it's this error (see above):
when loading file thru "After Load": error: synthmaker puts extra chars in string (after save: line ending is 0x0d 0x0d 0x0d 0x0a)
infuzion ·
jorge wrote: The following will match 0 or more matched of either "aaa" or "bbb", I think it's what you need in your schematic:
Perhaps I don't understand Rules, but it seems the 0 of "0 or more" is really "exactly matching":
or is it just me?
rl ·
AFAIK it makes sense. The rule means
[0 ore more of (aa or bb)] but you have vv in your string. Should be True when you remove vv.
infuzion ·
rl wrote: AFAIK it makes sense. The rule means
[0 ore more of (aa or bb)] but you have vv in your string. Should be True when you remove vv.
Perhaps I'm thinking back in my Math-Logic classes, but I would assume "0 or more" means the search condition (in this case "aa or bb") is found (eg subset) at all, or not at all (the "0") the the search is True. The example I posted makes me believe the Star-Rule is really an intersection, not an union (that the 0 indicates to me).
But I got a D trying to prove that 1+1=2, so what do I know? 🙂
rl ·
now I'm not so sure, Maybe you are right. I did a little regular expression test :