Problem with cross-staff colliding notes

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Problem with cross-staff colliding notes

Claire Meyer-2
Hi,

I'm trying to reproduce a piano score that has a lot of cross-staff notes, some of them colliding. There are 3 voices :
- one for the right hand on the upper staff,
- one for the left hand on the lower staff,
- and for the left hand on the upper staff.
That last voice is the cross-staffed one. Because the right hand overlaps a bit with the left, some collisions happen because the overlapping notes are written on the same staff.

In the snippet that I'm sharing, there are two problematic bars :
- on the first bar, I "solved" the problem (the pair of Fs). I tried looking at lilypond examples to see for something matching, found something, applied it and it worked, but I have no idea why (and I'd be grateful for an explanation).
- then for the second bar, there are two pairs of F, and I'd like the same thing as for the first bar, but have not been successful in any attempt to do so (admittedly because I didn't understand how I solved my problem the first time around).
- in the snippet that I provide, I also seem to have a weird treble clef, and I don't why. I don't have it in my full score, it happened when I trimmed my score to provide the snippet, so it's not a big deal to me, but if someone can explain, I'm grateful too.

The snippet is on lilybin : http://lilybin.com/7w0cet/2

Thanks to anyone who can help!
Claire

Reply | Threaded
Open this post in threaded view
|

RE: Problem with cross-staff colliding notes

Mark Stephen Mrotek

Claire,

 

Some suggestions.

Use only two voices, one in each staff.

The treble clef in the lower staff is a result of the “grace note bug.” A spacer grace note must be put in the lower staff aligned to the one in the upper staff.

If cross staff stems is necessary you can create a second voice in the upper staff and follow

http://lilypond.org/doc/v2.19/Documentation/notation/common-notation-for-keyboards

Attached is my setting of the piece.

 

Mark

 

 

From: lilypond-user [mailto:lilypond-user-bounces+carsonmark=[hidden email]] On Behalf Of Claire Meyer
Sent: Wednesday, August 26, 2020 11:42 AM
To: Lilypond-User Mailing List <[hidden email]>
Subject: Problem with cross-staff colliding notes

 

Hi,

 

I'm trying to reproduce a piano score that has a lot of cross-staff notes, some of them colliding. There are 3 voices :

- one for the right hand on the upper staff,

- one for the left hand on the lower staff,

- and for the left hand on the upper staff.

That last voice is the cross-staffed one. Because the right hand overlaps a bit with the left, some collisions happen because the overlapping notes are written on the same staff.

 

In the snippet that I'm sharing, there are two problematic bars :

- on the first bar, I "solved" the problem (the pair of Fs). I tried looking at lilypond examples to see for something matching, found something, applied it and it worked, but I have no idea why (and I'd be grateful for an explanation).

- then for the second bar, there are two pairs of F, and I'd like the same thing as for the first bar, but have not been successful in any attempt to do so (admittedly because I didn't understand how I solved my problem the first time around).

- in the snippet that I provide, I also seem to have a weird treble clef, and I don't why. I don't have it in my full score, it happened when I trimmed my score to provide the snippet, so it's not a big deal to me, but if someone can explain, I'm grateful too.

 

The snippet is on lilybin : http://lilybin.com/7w0cet/2

 

Thanks to anyone who can help!

Claire

 


Claire.ly (803 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Problem with cross-staff colliding notes

Claire Meyer-2
Mark,

Thank you very much. Well, yes, the cross-staff is necessary, so I've been trying to follow the examples in the documentation you sent, but either I'm missing something, either they just don't apply to my case, or it's what I've already used. The \change Staff and \autochange commands only apply to whole chords or single notes, not to partial chords (my case). And I have tried to apply them, believe me (hence why I'm replying so late). Which leaves me with the \crossStaff command, which is the one I already used, but it doesn't say anything about avoiding collisions, which is my problem. I must have missed the documentation part you wanted me to see or something, can you elaborate ?

Claire

On Thu, Aug 27, 2020 at 12:49 AM Mark Stephen Mrotek <[hidden email]> wrote:

Claire,

 

Some suggestions.

Use only two voices, one in each staff.

The treble clef in the lower staff is a result of the “grace note bug.” A spacer grace note must be put in the lower staff aligned to the one in the upper staff.

If cross staff stems is necessary you can create a second voice in the upper staff and follow

http://lilypond.org/doc/v2.19/Documentation/notation/common-notation-for-keyboards

Attached is my setting of the piece.

 

Mark

 

 

From: lilypond-user [mailto:[hidden email]=[hidden email]] On Behalf Of Claire Meyer
Sent: Wednesday, August 26, 2020 11:42 AM
To: Lilypond-User Mailing List <[hidden email]>
Subject: Problem with cross-staff colliding notes

 

Hi,

 

I'm trying to reproduce a piano score that has a lot of cross-staff notes, some of them colliding. There are 3 voices :

- one for the right hand on the upper staff,

- one for the left hand on the lower staff,

- and for the left hand on the upper staff.

That last voice is the cross-staffed one. Because the right hand overlaps a bit with the left, some collisions happen because the overlapping notes are written on the same staff.

 

In the snippet that I'm sharing, there are two problematic bars :

- on the first bar, I "solved" the problem (the pair of Fs). I tried looking at lilypond examples to see for something matching, found something, applied it and it worked, but I have no idea why (and I'd be grateful for an explanation).

- then for the second bar, there are two pairs of F, and I'd like the same thing as for the first bar, but have not been successful in any attempt to do so (admittedly because I didn't understand how I solved my problem the first time around).

- in the snippet that I provide, I also seem to have a weird treble clef, and I don't why. I don't have it in my full score, it happened when I trimmed my score to provide the snippet, so it's not a big deal to me, but if someone can explain, I'm grateful too.

 

The snippet is on lilybin : http://lilybin.com/7w0cet/2

 

Thanks to anyone who can help!

Claire

 

Reply | Threaded
Open this post in threaded view
|

RE: Problem with cross-staff colliding notes

Mark Stephen Mrotek

Claire,

 

Shall try somethings this morning and get back to you.

 

Mark

 

From: Claire Meyer [mailto:[hidden email]]
Sent: Thursday, August 27, 2020 9:40 AM
To: Mark Stephen Mrotek <[hidden email]>
Cc: Lilypond-User Mailing List <[hidden email]>
Subject: Re: Problem with cross-staff colliding notes

 

Mark,

 

Thank you very much. Well, yes, the cross-staff is necessary, so I've been trying to follow the examples in the documentation you sent, but either I'm missing something, either they just don't apply to my case, or it's what I've already used. The \change Staff and \autochange commands only apply to whole chords or single notes, not to partial chords (my case). And I have tried to apply them, believe me (hence why I'm replying so late). Which leaves me with the \crossStaff command, which is the one I already used, but it doesn't say anything about avoiding collisions, which is my problem. I must have missed the documentation part you wanted me to see or something, can you elaborate ?

 

Claire

 

On Thu, Aug 27, 2020 at 12:49 AM Mark Stephen Mrotek <[hidden email]> wrote:

Claire,

 

Some suggestions.

Use only two voices, one in each staff.

The treble clef in the lower staff is a result of the “grace note bug.” A spacer grace note must be put in the lower staff aligned to the one in the upper staff.

If cross staff stems is necessary you can create a second voice in the upper staff and follow

http://lilypond.org/doc/v2.19/Documentation/notation/common-notation-for-keyboards

Attached is my setting of the piece.

 

Mark

 

 

From: lilypond-user [mailto:[hidden email]=[hidden email]] On Behalf Of Claire Meyer
Sent: Wednesday, August 26, 2020 11:42 AM
To: Lilypond-User Mailing List <[hidden email]>
Subject: Problem with cross-staff colliding notes

 

Hi,

 

I'm trying to reproduce a piano score that has a lot of cross-staff notes, some of them colliding. There are 3 voices :

- one for the right hand on the upper staff,

- one for the left hand on the lower staff,

- and for the left hand on the upper staff.

That last voice is the cross-staffed one. Because the right hand overlaps a bit with the left, some collisions happen because the overlapping notes are written on the same staff.

 

In the snippet that I'm sharing, there are two problematic bars :

- on the first bar, I "solved" the problem (the pair of Fs). I tried looking at lilypond examples to see for something matching, found something, applied it and it worked, but I have no idea why (and I'd be grateful for an explanation).

- then for the second bar, there are two pairs of F, and I'd like the same thing as for the first bar, but have not been successful in any attempt to do so (admittedly because I didn't understand how I solved my problem the first time around).

- in the snippet that I provide, I also seem to have a weird treble clef, and I don't why. I don't have it in my full score, it happened when I trimmed my score to provide the snippet, so it's not a big deal to me, but if someone can explain, I'm grateful too.

 

The snippet is on lilybin : http://lilybin.com/7w0cet/2

 

Thanks to anyone who can help!

Claire

 

Reply | Threaded
Open this post in threaded view
|

Re: Problem with cross-staff colliding notes

Thomas Morley-2
In reply to this post by Claire Meyer-2
Am Mi., 26. Aug. 2020 um 20:42 Uhr schrieb Claire Meyer
<[hidden email]>:

>
> Hi,
>
> I'm trying to reproduce a piano score that has a lot of cross-staff notes, some of them colliding. There are 3 voices :
> - one for the right hand on the upper staff,
> - one for the left hand on the lower staff,
> - and for the left hand on the upper staff.
> That last voice is the cross-staffed one. Because the right hand overlaps a bit with the left, some collisions happen because the overlapping notes are written on the same staff.
>
> In the snippet that I'm sharing, there are two problematic bars :
> - on the first bar, I "solved" the problem (the pair of Fs). I tried looking at lilypond examples to see for something matching, found something, applied it and it worked, but I have no idea why (and I'd be grateful for an explanation).
> - then for the second bar, there are two pairs of F, and I'd like the same thing as for the first bar, but have not been successful in any attempt to do so (admittedly because I didn't understand how I solved my problem the first time around).
> - in the snippet that I provide, I also seem to have a weird treble clef, and I don't why. I don't have it in my full score, it happened when I trimmed my score to provide the snippet, so it's not a big deal to me, but if someone can explain, I'm grateful too.
>
> The snippet is on lilybin : http://lilybin.com/7w0cet/2
>
> Thanks to anyone who can help!
> Claire
>

Hi Claire,

I don't understand what you mean with "colliding" notes.
Look at the output of below.
Equal notes in different Voices will be merged per default (first
case), unless it would lead to difficulties to distinguish durations,
thus in the second case they don't merge.
You can override default-behaviour, see the third case.

\new Staff
  <<
    \new Voice {
      \voiceOne
      b4 s b4 s
      b4 s2.
    }

    \new Voice {
      \voiceTwo
      b4 s b2
      \override NoteColumn.force-hshift = #1
      b4 s2.
    }
  >>

That said, what do you want?
- Always merging? Don't do so, see above
- Always two NoteHeads? Use the override as shown.

Though, I'd be fine with merging or not merging NoteHeads as of
LilyPond's default. But that's only me.

#####

To facilitate adjusting NoteColumns for cross-staff stems I once wrote pushNC

Use it instead of that adding of invisible Notes

pushNC =
\once \override NoteColumn.X-offset =
  #(lambda (grob)
    (let* ((p-c (ly:grob-parent grob X))
           (p-c-elts (ly:grob-object p-c 'elements))
           (stems
             (if (ly:grob-array? p-c-elts)
                 (filter
                   (lambda (elt)(grob::has-interface elt 'stem-interface))
                   (ly:grob-array->list p-c-elts))
                 #f))
           (stems-x-exts
             (if stems
                 (map
                   (lambda (stem)
                     (ly:grob-extent
                       stem
                       (ly:grob-common-refpoint grob stem X)
                       X))
                   stems)
                 '()))
           (sane-ext
             (filter interval-sane? stems-x-exts))
           (cars (map car sane-ext)))
    (if (pair? cars)
        (abs (- (apply max cars)  (apply min cars)))
        0)))

lowerv = \relative c' {
    \grace s8
    \stemDown
    r4
    \pushNC aes2
    aes4
    r4 aes4 aes2
}

Cheers,
  Harm

Reply | Threaded
Open this post in threaded view
|

Re: Problem with cross-staff colliding notes

Claire Meyer-2
Hi Harm,

Thank you very much, it solves all my problems at once, much appreciated! It tells me how to engrave my last bar, and why I had to do what I did for my first bar :)

I was indeed confusing merged notes for collisionning ones; I wasn't aware of the concept / term / mechanics behind.

Have a good day,
Claire


On Thu, Aug 27, 2020 at 10:52 PM Thomas Morley <[hidden email]> wrote:
Am Mi., 26. Aug. 2020 um 20:42 Uhr schrieb Claire Meyer
<[hidden email]>:
>
> Hi,
>
> I'm trying to reproduce a piano score that has a lot of cross-staff notes, some of them colliding. There are 3 voices :
> - one for the right hand on the upper staff,
> - one for the left hand on the lower staff,
> - and for the left hand on the upper staff.
> That last voice is the cross-staffed one. Because the right hand overlaps a bit with the left, some collisions happen because the overlapping notes are written on the same staff.
>
> In the snippet that I'm sharing, there are two problematic bars :
> - on the first bar, I "solved" the problem (the pair of Fs). I tried looking at lilypond examples to see for something matching, found something, applied it and it worked, but I have no idea why (and I'd be grateful for an explanation).
> - then for the second bar, there are two pairs of F, and I'd like the same thing as for the first bar, but have not been successful in any attempt to do so (admittedly because I didn't understand how I solved my problem the first time around).
> - in the snippet that I provide, I also seem to have a weird treble clef, and I don't why. I don't have it in my full score, it happened when I trimmed my score to provide the snippet, so it's not a big deal to me, but if someone can explain, I'm grateful too.
>
> The snippet is on lilybin : http://lilybin.com/7w0cet/2
>
> Thanks to anyone who can help!
> Claire
>

Hi Claire,

I don't understand what you mean with "colliding" notes.
Look at the output of below.
Equal notes in different Voices will be merged per default (first
case), unless it would lead to difficulties to distinguish durations,
thus in the second case they don't merge.
You can override default-behaviour, see the third case.

\new Staff
  <<
    \new Voice {
      \voiceOne
      b4 s b4 s
      b4 s2.
    }

    \new Voice {
      \voiceTwo
      b4 s b2
      \override NoteColumn.force-hshift = #1
      b4 s2.
    }
  >>

That said, what do you want?
- Always merging? Don't do so, see above
- Always two NoteHeads? Use the override as shown.

Though, I'd be fine with merging or not merging NoteHeads as of
LilyPond's default. But that's only me.

#####

To facilitate adjusting NoteColumns for cross-staff stems I once wrote pushNC

Use it instead of that adding of invisible Notes

pushNC =
\once \override NoteColumn.X-offset =
  #(lambda (grob)
    (let* ((p-c (ly:grob-parent grob X))
           (p-c-elts (ly:grob-object p-c 'elements))
           (stems
             (if (ly:grob-array? p-c-elts)
                 (filter
                   (lambda (elt)(grob::has-interface elt 'stem-interface))
                   (ly:grob-array->list p-c-elts))
                 #f))
           (stems-x-exts
             (if stems
                 (map
                   (lambda (stem)
                     (ly:grob-extent
                       stem
                       (ly:grob-common-refpoint grob stem X)
                       X))
                   stems)
                 '()))
           (sane-ext
             (filter interval-sane? stems-x-exts))
           (cars (map car sane-ext)))
    (if (pair? cars)
        (abs (- (apply max cars)  (apply min cars)))
        0)))

lowerv = \relative c' {
    \grace s8
    \stemDown
    r4
    \pushNC aes2
    aes4
    r4 aes4 aes2
}

Cheers,
  Harm