NoteWorthy Composer Forum

Forums => Tips & Tricks => User Tools => Topic started by: hmmueller on 2018-05-27 02:29 pm

Title: "Remove following rests of same length" user tool (0.1)
Post by: hmmueller on 2018-05-27 02:29 pm
This is a companion user tool to the "Extend staff below with rests to cursor (https://forum.noteworthycomposer.com/?topic=9760.0)" 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:

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.
Title: Re: "Remove following rests of same length" user tool (0.1)
Post by: Rick G. on 2018-05-27 08:18 pm
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.
Title: Re: "Remove following rests of same length" user tool (0.1)
Post by: hmmueller on 2018-05-28 06:49 am
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 (http://www.hmmueller.de/NoteworthyComposer/BSpE_capella7.gif)

(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 (http://www.hmmueller.de/NoteworthyComposer/BSpE_NWC.gif)

(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.
Title: Re: "Remove following rests of same length" user tool (0.1)
Post by: Rick G. on 2018-05-28 07:20 am
I am talking about NWC, as the user sees it
I am no longer confused.
Title: Re: "Remove following rests of same length" user tool (0.1)
Post by: hmmueller on 2018-05-28 07:25 am
:)
Title: Re: "Remove following rests of same length" user tool (0.1)
Post by: William Ashworth on 2018-05-28 03:07 pm
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.
Title: Re: "Remove following rests of same length" user tool (0.1)
Post by: hmmueller on 2018-05-28 05:25 pm
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:

Approach 2: Create new staff and fill it with invisible rests.
Consequences:

Approach 2.1: Add the rests manually.
Consequences:

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.

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.

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

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.
Title: Re: "Remove following rests of same length" user tool (0.1)
Post by: William Ashworth on 2018-05-28 10:03 pm
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.