NoteWorthy Composer Forum

Forums => Tips & Tricks => Object Plugins => Topic started by: hmmueller on 2018-06-14 07:48 am

Title: CueStaff.hmm (0.6)
Post by: hmmueller on 2018-06-14 07:48 am
A cue staff object for NWC

Version 0.6 is a complete rewrite, which makes the object as feature-complete as I could imagine. This documentation has, on the whole, stayed as before, but many details have changed.

After @William Ashworth again mentioned cue staves in a posting (https://forum.noteworthycomposer.com/?topic=9741.msg69813#msg69813), I thought I'd try to implement a full object. The CueStaff object is not easy to use, but it can create acceptable (I think) cue staves for some cases. It must be said that this is a "tricky object" - it puts notes at places you might not have expected, and it tries to undercut NWC at some places to get the desired result. A native NWC cue staff feature would be much easier to use, and create much more consistent results. However, as long as we do not have such a feature in NWC, this is the nearest I came to supplying a comparable functionality via a plugin.

Let me start immediately with the limitations of the CueStaff plugin:


The features of the CueStaff object include:


Here are four examples that show what can be done with this object (their NWC scores are added as attachments):

CueStaffExperiment_RheinbergerOp150Nr3Gigue.pdf (http://www.hmmueller.de/NoteworthyComposer/CueStaffExperiment_RheinbergerOp150Nr3Gigue.pdf)
CueStaff_Chords.pdf (http://www.hmmueller.de/NoteworthyComposer/CueStaff_Chords.pdf)
CueStaff_Rests.pdf (http://www.hmmueller.de/NoteworthyComposer/CueStaff_Rests.pdf)
OverlaidCueSegment.pdf (http://www.hmmueller.de/NoteworthyComposer/OverlaidCueSegment.pdf)

The following text tries to explain the concepts behind this plugin, and how to use it.

The current implementation is feature-complete - I believe -, but the placement of some elements is certainly not perfect. I am open to all suggestions on how to create a better-looking score.

Concepts of cue staff drawing

The main concepts behind this object are:


In order to use this plugin, one must understand how notehead placement works. I'll explain this in a number of steps. The blue elements in this and the subsequent diagrams represent the source items, which are typically invisible in the resulting score (with the exception of stems); the red elements are the resulting items that are drawn by the user object. The examples show the creation of a cue staff of size 75% where the center lines are on the same height.
(I have added a zip of the images to the next posting, in case they are not reachable on my server)


In the first diagram, one sees the basic mapping of a source note:

(http://www.hmmueller.de/NoteworthyComposer/CueStaff1.PNG)

First, the position of a "virtual" cue notehead on the cue staff is computed; then, this notehead is moved away from the stem to the nearest valid position. The small gap between the stem's end and the notehead is filled by the plugin with an additional short line. One can see that the note stem is now typically too long - therefore, overriding the stem length with 6 or 5.5 is usually a good idea.

This mapping concept, however, leads to a problem: The possible note positions on the cue staff are denser than on the source staff - so, some cue staff positions apparently cannot be reached from source staff positions! The next diagram shows a five-note scale on the source staff - it ends up with two "holes" on the cue staff:

(http://www.hmmueller.de/NoteworthyComposer/CueStaff2.PNG)

The solution is an additional marker that allows a notehead to be mapped one step higher. In the next diagram, this marker is shown as a small blue arrow; for the plugin, one uses the "Tie Direction Downwards" selector of the note (remember that ties are not supported; so, the tie-direction information is "free" for being [mis]used for other purposes). One can see that it is now possible to create a five-note scale on the cue staff by using four different source notes with suitably chosen "shift" markers:

(http://www.hmmueller.de/NoteworthyComposer/CueStaff3.PNG)

The direction of a notehead shift is always away from the stem. The reason for this is of course that only then is it possible to add a small segment to complete the stem on the cue staff. However, this leads to the strange effect that merely flipping the stem direction on the source note alters the cue note's pitch, as can be seen in the following diagram:

(http://www.hmmueller.de/NoteworthyComposer/CueStaff4.PNG)

I found that I got used to this behavior quite quickly. One adjusts the note position of the note immediately afterwards (with Ctrl-Shift-Up or Ctrl-Shift-Down), and all is well.

Now, let us look at chords. Here, the rule is that, first, the "outermost" nodehead is mapped as described above (i.e., the highest note if the stem points downwards, and the lowest if the stem points upwards). Then, the intervals of the chord are faithfully replicated on the cue chord:

(http://www.hmmueller.de/NoteworthyComposer/CueStaff5.PNG)

Again, this will typically lead to overly long stems, so that their length must be overridden.

The stem-flipping effect is much larger for chords, as can be seen in the following example:

(http://www.hmmueller.de/NoteworthyComposer/CueStaff6.PNG)

Stem flipping changes the outermost note, and hence, the location of the whole chord on the cue staff varies considerably. Again, I found that moving the chord quickly to the right position is not a problem (of course, sometimes it is necessary to set the "Tie Direction" to "Downward" to place the chord on an otherwise unreachable position).

The rule for assignment of accidentals is: The actual positions of the noteheads on the grace companion are ignored; its noteheads are simply mapped one-by-one in order to the cue chord or note (this picture is wrong: The stems must point in the same direction; I'll repair it soon):

(http://www.hmmueller.de/NoteworthyComposer/CueStaff7.PNG)

Articulations (staccato, tenuto, etc.) are simply taken over from the grace companion to the resulting cue note or chord.

Last, one must understand how double stemmed chords (including rest chords) work. Like the accidentals and the articulations, they draw their information from the grace companion. The cue chord (with blank noteheads) only contains the noteheads for the shorter duration (and hence no second stem). The noteheads for the longer duration are copied over from the grace companion. The position of these noteheads is derived from the grace companion's position - this is the only case where its position is important. Rest chords work similarly: The cue chord is a (typically whole) blank notehead with a rest (with "Show Rest" unchecked); the noteheads are copied over from the grace companion.

When creating double stemmed chords or rest chords, ene must make sure that the stem directions of cue chord and grace companion agree, otherwise the results are disturbingly chaotic.


Practical considerations of cue staff writing

In practice, it is a good idea to follow these steps (a user tool might be useful to support the more mechanical steps - I have not yet written one):


For editing an existing cue staff, the following hints might help: An important NWC feature is the F11 button which toggles between

Additionally, there is a "Show Source" flag on the CueStaff objects, which will show the source staff lines and note/chords instead of the cue items. This is mostly useful when correcting chords, where one has to see the original intervals.

Finally, Alt-F V (Print Preview) is your friend if you want to align the cue staff clef and key signature correctly - I have found no other way than to repeatedly play with the spacers and the left overhang and check with Alt-F V, + and cursor keys whether the alignment is good enough. There is a "Show Width" flag on the CueStaff objects which shows the room used by the clef and key signatures; it might help to place them better.

In the end, however, all this is still a kludge: Native cue staff support in NWC would be much easier to use.

H.M.
Title: Re: CueStaff.test (0.4)
Post by: hmmueller on 2018-06-14 08:48 am
0.2 has - well - bug fixes.

This posting has now additional examples. One is an excerpt from a C.Ph.E.Bach score, others show how a cue staff runs over a complete or part of a score.

Also, this posting contains the zip file with the explanation images for the initial posting.

H.M.
Title: Re: CueStaff.test (0.3)
Post by: hmmueller on 2018-06-14 03:35 pm
Being on a short holiday, I sat in a Turkish cafe in Berlin for the last 6 hours and


The first resulted in version 0.3, with an additional example "OverlaidCueSegment", which shows how one can have different sizes of cue notes in a normal staff. Note placement has been completely rewritten and is now somewhat less buggy - but I still find stems that overshoot their noteheads, alas.

The self-experiment resulted in the insight that using this plugin is somewhat exhausting. I started to write Josef Rheinberger's Gigue for violin and organ (op.150 no.3). You can find the scanned score, as published by R.Forberg in Leipzig, at IMSLP (http://imslp.org) as the third piece in score number 269676; and there, you can see that the violin voice is set in a smaller staff - so I set out to write this staff with the CueStaff plugin. It took me quite a long time to reach only measure 44 (of 153) - it looks roughly as it should, but writing the graces for the accidentals; and moving up and down all the notes is heavy work. On the upside, ties do sort of work (with a single voice like the violin), if one selects the "Tie Direction" in a way that also the tie is bent the right way. I have attached the incomplete, patchy score for those really (really) interested, but ...

... on the whole,  I would recommend to use this plugin for longer staves only if you are in very great need to write smaller notes. Instead of using this contraption, try to argue that scores with different staff sizes are totally old-fashioned and of no use to the modern musician - your effort is better spent in such discussions, I'd say (even, or maybe because of, being the author of this).

So much for a nicely spent day!

H.M.
Title: Re: CueStaff.test (0.4)
Post by: hmmueller on 2018-06-15 10:10 am
The Turkish cafe was open again - albeit quite full on this Friday (the weekly Islamic prayer day).

I changed the logic of the "Tie Direction Downwards" flag - now, "Tie Direction Downwards" always means "away from the stem" (and therefore, "Tie Direction Upwards" is almost useless). One now always uses the keyboard shortcut "Alt-Enter Alt-T D" to move a note or chord to an unreachable position - and this improves the workflow quite a lot, because no more thinking is necessary.

I continued my Rheinberger experiment and have now completed the violin cue staff in a raw form - i.e., all notes, accidentals and articulations are now at their correct places (I have attached the NWC file and the resulting PDF - which shows, for demonstration purposes, both the source violin staff and the cue staff). However, double-stemmed chords are needed, even for this single-line (but not always!) violin voice. So, that's a missing feature.

There are some more problems and missing features, which are summarized at the head of the Lua source ...

... but I will now stop working on this plugin until someone (me included) really needs it and stumbles over the missing features and other pitfalls. For short stretches of cue notes, the plugin is certainly useable and maybe even useful. If anyone follows this development, let me know whether you have any comments or ideas.

H.M.
Title: Re: CueStaff.test (0.4)
Post by: Francis Beaumier on 2018-06-20 12:09 am
Thank you for this effort! I know it will come in handy one day.
Title: Re: CueStaff.test (0.6)
Post by: hmmueller on 2018-07-06 09:03 am
Here is version 0.6 - a complete rewrite which now can really do everything that is necessary ... ... I believe.
The Rheinberger example shows that one can now write a complete cue staff of a long piece in an (I hope) acceptable way.

This plugin has a few algorithms that try to imitate NWC algorithms: Placement of accidentals, placement of articulations, placement of dots, as well as notehead placement on the left or right side of a stem. The Chord and RestChord example scores in the initial posting show corresponding placements of NWC and the plugin - the plugin's algorithms are simpler, but for its limited uses better algorithms were not worth the effort.

Also, I have changed the name to .hmm, as I hope that this is a "quite final" version.

H.M.
Title: Re: CueStaff.hmm (0.6)
Post by: SEBC on 2018-12-24 02:24 pm
I am composing a choral piece with an optional oboe introduction. If the director chooses not to use the oboe, then I'd like the piano to play a combo of the notes that were distributed to the oboe plus the piano part. I was considering using a cue segment to show the combined piano part. Maybe it would be simpler to show the single line wind part instead in a cue segment.

Do you have any thoughts on this? Also, will it be possible to collapse that cue stave segment so that it doesn't take up room in the score when it is not needed?
Title: Re: CueStaff.hmm (0.6)
Post by: David Palmquist on 2018-12-26 09:19 am
IIRC, a typical piano score for a piano accompanying a soloist has three systems - top system showing the solo in concert pitch, and then the right and left hand systems.

Is there any reason not to do this for your piano part?   If the oboe solo is only a short intro, the piano sheet music need only have three systems for those bars, and then the top staff could be collapsed. 

To ensure any "top staff only" settings were preserved, the piano right hand staff could be collapsed instead of the oboe staff; and the right hand piano part would simply be notated on the oboe staff instead:


O   O   O   O   PR  PR  PR  PR
PR  PR  PR PR  collapse
PL  PL  PL PL  PL  PL  PL  PL
Title: Re: CueStaff.hmm (0.6)
Post by: SEBC on 2018-12-28 07:11 pm
The only problem I can see is that the wind intro is optional, and if that option is not used then the piano will play a more elaborate version of what they would have played with the wind instrument (incorporating the wind notes). I am not sure what is the best way to show these options.
Title: Re: CueStaff.hmm (0.6)
Post by: Rick G. on 2018-12-28 07:40 pm
If the director chooses not to use the oboe, then I'd like the piano to play a combo of the notes that were distributed to the oboe plus the piano part. Do you have any thoughts on this?
You might add the oboe part as a descant to the piano part.
Title: Re: CueStaff.hmm (0.6)
Post by: David Palmquist on 2018-12-29 01:33 pm

SEBC would like the pianist to play all the notes in the piano part PLUS, where the oboist is missing, the notes of the oboe solo with more piano notes as well.

I think the problem is presenting the pianist with sheet music that shows (a) what s/he will play if the oboist is soloing and (b) what s/he will play in the absence of the oboe soloist. 

I think I agree with Rick that the oboe part can be treated as a descant to the piano part but not being a pianist, I am not sure how is traditionally presented.  I think it might have to employ cue notes.

If I understand SEBC correctly, where there won't be an oboe soloist, the pianist will be asked to do more than just add the oboe notes to the piano part; the pianist's part will be rewritten to be more elaborate, maybe including the oboe "melody" or replacing it with something else.

So for instance, if the oboe simply has moving quarter and half notes and the accompanying piano intro is just half note and whole note chords, when the oboist is away, the piano part will have some, none, or all of the oboe notes, plus perhaps eighth notes and other ornamentation.

Maybe the simplest approach would be to write two versions of the first page of the piano part on the front and back of a single sheet of paper.  The first side would show the first page of the basic piano part beginning with the three system notation I described in my earlier suggestion.  The back side of the same piece of paper would show the music SEBC wants the pianist to play if there isn't an oboe soloist.

Appropriate text is needed near the top of the pages, essentially saying "play this page if there is an oboe solo"  and "play this page if there's no oboe solo."  You'd need to use prettier language, as long as the direction is clear.

If a back-to-back first page with single sided following pages creates difficulty for the pianist, the other option might be to simply print two versions of the piano part, one for when there is an oboe soloist and a more elaborate version when there isn't the soloist.