SynthMaker

skinnable user-interface with Text Load and Parser

Archive · 2005 17 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 :

# succeds: lindner@lux1:~> echo aabb | grep "aa*\|bb*" aabb

# also succeds: lindner@lux1:~> echo aabb | grep "bb*\|aa*" aabb

# surprisingly also succeds ( but indeed: ZERO or more) lindner@lux1:~> echo aavv | grep "bb*\|aa*" aavv

# but did I write the right regular expression? Maybe it's: lindner@lux1:~> echo aavv | grep "\(bb\|aa\)*" aavv

now I'm totally confused: does the example implement

\(bb\|aa\)*

0 ore more of ( aa or bb ) or

bb*\|aa*

(0 or more of bb) or (0 or more of aa) ??? H e l p - Jorge, I need an explanation!!!

jorge ·

rl, you were right with:

rl wrote: The rule means [0 ore more of (aa or bb)] but you have vv in your string. Should be True when you remove vv.

rl ·

..then your schematic can be expressed by the regular expression:

\(bb\|aa\)*

and everything makes sense.

Wrote something here? To have a post removed or your name hidden, write to [email protected].

Before your first post

A few rules keep this a friendly place. You agree to them once.

Shown next to what you post, here and in the app. It doesn’t have to be your real name: 3–24 lower-case letters, digits or _ (capitals become lower case, spaces become _).

    Then your post goes up straight away.

    Delete this reply?

    Open it in SynthMaker?

    It goes on the track you’re editing there, in place of that track’s sound, and into My sounds. Your other tracks stay as they are.

    Want to keep that track’s sound? Start a new song in SynthMaker first (Song › New song), then open this.

    Report this reply?

    Only the developer reads reports. The person isn’t told who reported them.

    What’s wrong with it?

    Block this person?

    You won’t see their posts and replies here any more. They aren’t told, and you can unblock them at any time.

    People you’ve blocked

    Their posts and replies are hidden from you. Unblock someone to see them again.

    The community rules

    A few rules keep this a friendly place. Everyone agrees to them once, before their first post.