Page 2 of 2

Re: best way to obtain global presets?

Posted: Tue Feb 04, 2020 10:32 pm
by trogluddite
I just had a look to see if I had any old parser examples in my old SM stuff that might help. With not much joy I'm afraid; I only found one! But here it is, in case it's any use to you - it's a just a simple parser for turning note names (e.g. "C#3") into their MIDI indexes...
Note to Int.osm
(2.09 KiB) Downloaded 1501 times

The main things to note, I think are...

- The parser 'Action' primitive is equivalent to a regular expression 'capture'. You can chain as many other parser prim's as you want to the bottom output, and if they ALL match, the String output is the sum total of everything that they find. The top connector passes along the rest of the string after the match.

- The 'Sequence' primitive is equivalent to a regex 'sub-expression'. Everything at the top output must match, and if it does, the rest of the string is passed to the bottom output.

- Things like matching repeats (+, *) and optional matches (?) go before the pattern that they match, not after as they would in a regex. Unless the multiple/optional match is the last thing in the string, you'll have to use an 'Action' or 'Sequence' to effectively make it a 'sub-expression'.

- The 'green' outputs for matched parts of Strings send a trigger every time that they are matched - so, for example, it is possible to collect the matches for a repeating part (+ or *) in an array by using the 'before match' trigger to set the index to zero and then incrementing by one for each match trigger.

- If you collect parser primitives into a module, make sure to have an output to pass through the remainder of the string. You can make a little collection of sub-expression matchers which will chain together that way.

Aside from that, I'm pretty rusty myself, so it will interesting to see what you discover!

(PS. To anyone who can't find the parser primitives in their toolbox: you need to turn on the "R&D components" option in the 'Advanced' options before they'll show up - they are included in a standard installation.)

Re: best way to obtain global presets?

Posted: Tue Feb 04, 2020 11:47 pm
by trogluddite
Oh, something else that playing with the above schematic has reminded me. There's a bug in the main 'CParser' primitive, where it doesn't always refresh itself when the rules are changed. If you don't get a match when you'd expect one, try deleting the link from the 'CParser' rule output to the first rule and reconnecting it - that usually forces it into seeing the new rules. I guess that's why it's an "R&D" component!

Re: best way to obtain global presets?

Posted: Wed Feb 05, 2020 11:06 pm
by deraudrl
trogluddite wrote:(PS. To anyone who can't find the parser primitives in their toolbox: you need to turn on the "R&D components" option in the 'Advanced' options before they'll show up - they are included in a standard installation.)
I suppose it's too much to ask that there's some documentation of these widgets hiding somewhere...

Re: best way to obtain global presets?

Posted: Thu Feb 06, 2020 12:10 am
by trogluddite
deraudrl wrote:I suppose it's too much to ask that there's some documentation of these widgets hiding somewhere...

I don't think there was ever any offical documentation for the R&D components, and most user-created examples and tutorials were likely lost with the SM forum and wiki (most, if not all, of the R&D components have been "in development" since the SM days!)

BTW: The R&D components are all tagged "Beta", so to find them all easily just make a toolbox category of that name. The only ones that are frequently spotted in the wild are the 'wave writers'; they're useful for recording audio clips without needing to code anything, and are bug-free AFAIK (as featured in Spogg's recent drum synths).

Re: best way to obtain global presets?

Posted: Sat Feb 08, 2020 3:51 pm
by wlangfor@uoguelph.ca
Damn, thanks, lots of information. I'll print to a pdf; cheers.

BTW trogg, will send you My latest commercial product schematics for your private use :) They're sick.

Re: best way to obtain global presets?

Posted: Sat Feb 08, 2020 4:32 pm
by trogluddite
No problem! And thanks for the schematic/plugin links - and for the heads-up (I wasn't paying attention to my PM inbox yet again - my e-mail insists on marking forum notifications as 'junk', even though I've repeatedly told it that they're not!)

Re: best way to obtain global presets?

Posted: Sat Feb 08, 2020 7:38 pm
by wlangfor@uoguelph.ca
trogluddite wrote:No problem! And thanks for the schematic/plugin links - and for the heads-up (I wasn't paying attention to my PM inbox yet again - my e-mail insists on marking forum notifications as 'junk', even though I've repeatedly told it that they're not!)


Well, like I've said before; You're often a source in My programming, if not always.