Skip to main content
Topic: Copy corresponding parts of multiple staffs (Read 7206 times) previous topic - next topic

Copy corresponding parts of multiple staffs

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):

Code: [Select · Download]
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:
  • 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)
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.

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?

Harald M.

// Edit: Rewritten script in OO way ... now seems to be bug-free  :D