Skip to main content

Topic: "Remove following rests of same length" user tool (0.1) (Read 527 times) previous topic - next topic

"Remove following rests of same length" user tool (0.1)
This is a companion user tool to the "Extend staff below with rests to cursor" user tool: If one adds new notation into the rest sequence, all elements behind are shoved back (as NWC does not have an overwrite mode). This tool allows the quick deletion of following rests of the same length as a selection.

Here is a short description:

This simple tool removes all rests and the "duration-less" objects between them after the selection for a duration that is equal to the selection's length.
This is helpful if you have added a stretch of notation in a run of rests, but actually did not want to move back everything behind your insertion; think of it as a remedy for NWC's missing "overwrite mode".
If the tool encounters an object with duration during its removal that is not a rest, it stops - it does not want to destroy parts of the score.
Finally, if the removed rests do not sum up to the exact length of the selection, the tool inserts a few small rests for compensation.

To install, download the attached lua file (wherever you want to store user tools), open some NWC score (e.g. a new one), go to "Tools --> User Tools", click "New" and add the following:
  • Group: Whatever you want to keep your user tools organized
  • Name: "Remove following rests of selection length"
  • Command: Browse to location where you saved the downloaded file
  • Input Type: File Text
  • Options: Returns File Text

I have also attached a weird test file to play around with this tool. For a first experiment, select the red notes (which are assumed to be a previous addition) and run the user tool - the following part of the staff should "move up" so that the bars, endings etc. again align nicely. Note that a new sixteenth rest had to be added after the red notes for this alignment.

H.M.
  • Last Edit: 2018-05-27 06:41 pm by hmmueller

Re: "Remove following rests of same length" user tool (0.1)
Reply #1
NWC does not have an overwrite mode
I'm confused. In 'Clip mode', NWC replaces the selection with STDOUT. In 'File mode', it replaces the entire song with STDOUT. In a sense, it only supports overwrite mode. But the User Tool can copy what it gets from STDIN and insert all or part of it in STDOUT so that both insert and overwrite are supported.

That said, reading a selection from one staff and properly applying it to another staff is difficult to impossible.
Registered user since 1996

Re: "Remove following rests of same length" user tool (0.1)
Reply #2
Quote
NWC does not have an overwrite mode
I'm confused. In 'Clip mode', NWC replaces ... replaces  ... In a sense, it only supports overwrite mode.
I am talking about NWC, as the user sees it: If you enter notes, rests and the like, there is only inserting - no overwriting=replacing of subsequent objects.

Here is a comparison with capella (a score editor widely used in Germany):
I want to write an arrangement for "Blue Spanish Eyes". In capella, the lower staff is extended automatically, and I can add notes anywhere in the "virtual rests" without disturbing the rest of the score:

Creating part of arrangement with capella 7

(In this forum, I can say that I hate capella for many things - its complex state model ("chord mode" vs. "insert mode"), its strict adherence to time signatures (in 4/4, each measure must have 4 quarters), its paper based layout (in the example, I have to enter a line break while writing the music!), its chaotic keyboard layout, its use of tricky, non-Windows-standard key assignment (left shift and right shift are two different things!) etc.etc. You might see in the animated gif that I am not really that fluent in using it ...).

Noteworthy, up to now, broke my (musical) flow of thought at these points, as I had to create a new staff and fill it up (and think whether I wanted to add previous clefs, keys etc. or just skip that to get quickly to the point of continuing to write music) or, in the latter case, to manually remove the right amount of rests later (I sometimes put in texts at both staffs so I could align them more quickly later - without scrolling to some far away point to check whether they would align correctly).

The user tools now create an - at least for me - acceptable workflow:

Creating part of arrangement with NWC

(I hope nobody says "But you should have written the score first [on paper?]" or "But you must think music from start to finish" or the like ;) )

What you are talking about, I think, is a more or less obscure technical decision about how user tools and the NWC core program exchange information - which is not relevant to the user, only to us writers of such things.

That said, reading a selection from one staff and properly applying it to another staff is difficult to impossible.
I am not sure I understand what you mean here - in these two tools, I do not need to do this (only use the CaretPosition on one staff to extend another staff; and the selection on a staff to modify part of the same staff). But I do not see why I could not use the selection of one staff for computing something which is done to another staff.

H.M.
  • Last Edit: 2018-05-28 07:25 am by hmmueller

Re: "Remove following rests of same length" user tool (0.1)
Reply #3
I am talking about NWC, as the user sees it
I am no longer confused.
Registered user since 1996

Re: "Remove following rests of same length" user tool (0.1)
Reply #4

Re: "Remove following rests of same length" user tool (0.1)
Reply #5
I understand why people want to use invisible rests to fill out the layered staff - it looks tidier in the editor. But you don't need to. Just copy the primary staff into the new layer and mute all the notes up to the place you are working. The finished score will look the same.

Re: "Remove following rests of same length" user tool (0.1)
Reply #6
Just copy the primary staff into the new layer and ...
Hm ... I wanted to start writing that "this is not really correct" - but (a) this is not good etiquette, making for a thoughtful discussion; and (b) there is an underlying question behind such statements which I would like to discuss in another thread.

In the main, I would say that different approaches to accomplish something come with a package of implicit advantages and disavantages, or - better - consequences. A user should be able to select the right approach for her or him based on these consequences - which, therefore, should be spelt out explicitly. I think of a format like the following:

------------

Problem: Far into a staff, you find that you need to introduce a layered staff because a certain layout of notation elements cannot be created in NWC on a single staff (an example would be a chord with noteheads of three different durations; but there are more common examples). But how do you fill up the layered staff up to the point where you are going to edit it?

In the following approaches to solve this problem, you create the new layered staff manually. If you want faithful playback, you have to change the MIDI channel of the new staff to the same channel as the original staff. You activate the "Layer with Next Staff" on the original staff only after you have fully created the new staff.

Approach 1: Create new staff, copy all of the elements in the original staff to the new staff, mute all of them; and start editing the new staff as necessary. As long as the copied elements remain exactly the same, a printout of the score will look like the single staff.
Consequences:
  • If you want faithful playback, you have to set the delays of fermatas or breath marks to zero on the new staff.
  • Also, you might want to remove tempo markers on the copied staff so that you do not have to hunt them down later.
  • If you create a changing score (i.e., you arrange or compose), which you want to print later, you probably want to set all the copied items to Visibility=Never, so that you do not have to change them on both staffs. Alternatively, you can keep both staffs in sync, which is more work.
  • When the staffs are layered in the editor, and you do not have a changing score, you do not see any grey items that might be distracting.

Approach 2: Create new staff and fill it with invisible rests.
Consequences:
  • For a changing score (arranging or composing), this is usually preferable, as you can change the original notation without being distracted by the - possibly out-of-sync - copy on the layered staff.
  • When the staffs are layered in the editor, you will see the "invisible" rests in light grey under the active elements, which might be distracting.

Approach 2.1: Add the rests manually.
Consequences:
  • This can be a lot of work.
  • You will still have to copy keys and clefs; if you want faithful playback, also instrument changes should be copied.

Approach 2.2: Use the adp_parts user tool: Copy the staff (as in approach 1), mark the segment to be replaced with rests, then call adp_parts with option Prompt 3 set to nosingle multiple times until all notes and chords have been replaced with rests (using Ctrl-Alt-F8 or Alt-T E - "Repeat Last User Tool" - is efficient from the second call onwards). Finally, set the visibiliy of the (still selected) segment to Never.
  • This will typically create quite "fine-grained" rests.
  • Like with approach 1, you have to set the delays of fermatas or breath marks to zero on the new staff if you want faithful playback.
  • All the notation elements that are not replaced with rests will remain in the new staff; you might want to remove them so they do not contradict the ones on the original staff.

Approach 2.3: Use the "Extend staff below with rests to cursor" user tool: Put the new staff immediately below the active staff, place the cursor at the position up to which the new staff should be filled with rests, and start the tool.
  • This will typically create quite "coarse-grained" rests - e.g., half, maybe quarter rests in typical measures.
  • Notation elements necessary only on one staff, like dynamics or tempo changes, are not copied over; others, like clefs, keys, bars and flow control items (like segnos and endings), are copied over.
  • If you want to have faithful playback, you must still check for MPCs that might have an effect on the audible segments of the new staff.

------------

Whew - it seems it is not that easy to describe such answers ... still: I'd like to share all the knowledge there is about NWC in some form like that, one day.

// Edit: I no longer think of a format like the (above) - this is typical textual wasteland ...

H.M.
  • Last Edit: 2018-05-28 07:32 pm by hmmueller

Re: "Remove following rests of same length" user tool (0.1)
Reply #7
Well, It's probably largely a matter of workflow. I can see the interest in user tools like this one if you're likely to change what comes before the layered section. I'm almost always composing new music, and I usually just kludge anything that needs extra layers (it doesn't matter what a kludge looks like, as long as it sounds right as I put the rest of the piece together). I don't bother correcting the kludge until I'm preparing scores and parts for performers, so I'm unlikely to change anything after I create a new layer. My process is usually simply to copy the whole primary staff to the new layer, select all, and mute all the notes in one blow. Then I go to the spots that need layering to look right and deal with them individually. Quick and dirty, I confess, but the printed music looks fine.