The documentation says:
Hint: grace notes do not have duration.
But the following tool,
local f = nwcut.loadFile()when called on a new staff with two grace notes, outputs
for i = 1, #f.Staff do
for j = 1, #f.Staff[i].Items do
local item = f.Staff[i].Items[j]
nwcut.warn(i ..'/'..j ..' --> '..(item:HasDuration() and 'true' or 'false')..'\n')
nwcut.status = nwcut.const.rc_Report
1/1 --> true
1/2 --> true
item:HasDuration() and not item.Opts.Dur.Graceinstead - I think this is what the documentation means ...
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?
There was a question about this in the General Forum; and I have felt the need for this also quite a few times. Of course, NWC does not have the concept of a "vertical selection", and it would be hard to define this in general, because there are no obvious "vertical lines" in NWC (and also not in music in general).
What my tool, therefore, does is to place the burden on the score writer: One has to add markers on each staff that delineate the segments. In practice, this can be done very quickly by putting the marker on the top score, copying it with Ctrl-C, and then repeating PgDn and Ctrl-V for all staffs (I do this with rehearsal markers and various dynamics for 2...4...8...20 staffs all the time). Of course, if one hits a "non-aligning object" (an extrem case is a multibar rest), the marker will - and all below - will suddenly land more or less offset to the left or right - that's just as it is. But markers near bars tend to align vertically nicely.
So ... the attachment contains the user tool and an example file. The user tool should be added to nwc2UserTool.ini with three lines, as follows (of course, you must replace the path so that it points to the directory where you store the user tool):
C Copy segments=14,php\php.exe C:\Private\MyMusic\MusicalHelpers\hmm_CopySegment.php copy
D Delete segments=14,php\php.exe C:\Private\MyMusic\MusicalHelpers\hmm_CopySegment.php delete
R Reset segments=14,php\php.exe C:\Private\MyMusic\MusicalHelpers\hmm_CopySegment.php reset
Usage is as follows:
The idea is that you can make the markers really stand out (see the example), so that you do not get confused afterwards what went where even if the segments do not longer line up well.
- C copies the segment; two texts .S and .E delineate the segment; .I is the point where the segment is copied to (only the first .I is "seen" by the tool). When the segment is copied, it will be marked with .O at the end (in the same font/color as .I).
The script is still a little buggy if the segment is copied to the left of its insertion point - the markers get confused
- D deletes the segment marked by .S and .E
- R removes all the markers (.S, .E, .I, .O)
Unfortunately, Ctrl-Z does not work over the boundary of a user tool (even though NWC recognizes that the score has changed) - if the copying creates something wrong, one has to go back to a saved version.
What do you say? Might this - or something along these lines - be a solution or at least acceptable crutch until NWC gets "vertical selections and copy/pastes" somewhen?
// Edit: Rewritten script in OO way ... now seems to be bug-free
"Grace chords" are not modified by adp_Parts, as line 530 is
elseif ($oType == "Rest" || !timeTaken($o)) // don't filter on rests or grace notesFor splitting my particells into orchestral voices, this is a small nuisance. I just changed the line to
elseif ($oType == "Rest") // don't filter on rests... so far it seems to do what I want. Does anyone know whether there is some problem with this change (e.g. wrong computation of durations? ... but I will never have grace rest chords, I promise)
The Parts user tool is helpful, but it leaves rest sequences like the following when a voice is completely deleted:
Is there an easy way (read: a tool) to rewrite these rest sequences (and, more generally, also sequences of identical notes and chords) to the shortest possible rest/note/chord?
(Additional "possible hiccup": Musically, it is not ok to span a note over a "beat boundary", e.g., the 4th and 5th eighth in a 4/4 measure - they must be written as two tied eights. But then again, in some rhythms - e.g. when the 4/4 measures are split into 3+3+2 eighths -, it is ok to write a single quarter note. I do not know which and how many additional parameters one would need to control this - a string of the form "2+2/4" for a standard 4/4 time signature or "3+3+2/8" with semantics "no note spanning the boundaries indicated by +" might be the most versatile ...
//Edit: No, this is not enough; one needs such a string for each subdivision: 1/1, 2/2, [none for /4], 3+3+2/8, 2/16 as a shortcut for the repeated group 2+2+2+2+2+2+2+2/16, meaning that no eights can start at an odd sixteenths; etc.
// Edit^2: I think this is about the 3rd or 4th time I invent this, isn't it?? - including the Edit^2 idea ... I should use "search" more often and not invent so many things ...).
Thanks for help!
On compound chords, an accidental is, IMHO, printed too far to the left - see attachment.