518
Ha - you got me! ... yes, I considered it for a second, but I have not yet "interned" (in my mind) the Lua patterns (too much experience with the "big" regexps of C# etc.), so I am a little too cautious there. But right after uploading the script, I thought that the following much simpler code should work:
['%%1/8%%'] = 'H',
['%%ppp%%'] = 'P',
...
for k, v in pairs(replacements) do
text = string.gsub(text, k, v)
end
If you read this - do you have any complaints? - if not, I'll simply replace 0.6 (no functional change).
... I just did it 
H.M.
519
What do you think?
As Lawrie points out, the dynamic signs are in the StaffSymbols font, so you could just find them there ...
... however, in version 0.6 I have added a number of abbreviations for quite a few characters from that font: Just select font StaffSymbols, and then use e.g. %ppp% or %f% or %cclef% or %#% etc. For all symbols, look into the help text. If you want some more symbols added, just tell me (including the abbreviation name you think is helpful).
XTextExamples.nwctxt (attached to the primary posting) contains some examples for this, e.g. the "sempre pp" xtext.
A technical remark and question: The code simply replaces the abbreviations with single letters, as defined in a table with entries like
['%1/8%'] = 'H',
['%ppp%'] = 'P',
Thus, for %ppp%, the character P is substituted, which has hex code 0x50. However, when I look into the CharMap of the standard StaffSymbols font NWC2STDA, the ppp symbol has character code 0xf050. Yet, my code works ... but I am not really sure why; and whether there might be circumstances when it does not work. Could someone tell me what's going on here? - thanks!
H.M.
524
Calling nwcItem:Get('ControllerName') on
|User|EnvelopeMaestro.hmm|Pos:-6.5|Class:StaffSig|Bottom:-6|Top:-1|ShowLocation:below|MinValue:60|Pen:dash|PenWidth:0.7|Controller:71|ShowAs:Blend|ControllerName:"Select by number"
yields '"Select by number"' - i.e., a string including the double apostrophes. As these are added by the serialization to the nwc or nwctxt file only for strings with spaces (the string '7:Volume', e.g., is serialized without double apostrophes), I would have expected that this "implementation detail" is not shown when calling :Get().
Also, an embedded \" is returned exactly like that in the string: as two characters, a backslash and a double apostrophe.
Altogether, right now I would have to do some postprocessing on :Get()'s result to get the actual value, wouldn't I?
H.M.
542
My setup for this very important tool is as follows: For each useful combination of parameters, I have a separate line in the nwc2UserTools.ini file, as follows (the HMM is just the section for my convenience tools):
[HMM]
1 Remove Top NoSingle=2,php\php.exe scripts\adp_Parts.php remove top nosingle
2 Remove Top=2,php\php.exe scripts\adp_Parts.php remove top
3 Retain Top=2,php\php.exe scripts\adp_Parts.php retain top
4 Retain Bottom=2,php\php.exe scripts\adp_Parts.php retain bottom
5 Remove Bottom=2,php\php.exe scripts\adp_Parts.php remove bottom
6 Remove Bottom NoSingle=2,php\php.exe scripts\adp_Parts.php remove bottom nosingle
When composing, this looks as follows:
<Image Link>
- The top staff shows a segment newly composed in "chord notation"
- The three staffs below were created from it, by first copying in the upper staff (or a piece of it), then selecting (highlighting) some segment, and then execute suitable user tools; e.g. for the middle staff "Remove Top" and "Retain Top" (or "Remove Bottom")
I have written huge scores (25 staffs; and some 100s of measures) with this method.
Good luck!
H.M.
P.S. Editing nwc2UserTools.ini requires Windows admin rights, otherwise you see/edit a local copy of the file, and NWC does not see the added tools. I have been stung by this a few times ...
P.P.S. Ahem ... the image is a little bit of a fake; and so the voices do not correspond perfectly. But you get the idea, I hope ...