Merge_rests_engraver bug with whole measure rest?

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

Merge_rests_engraver bug with whole measure rest?

jensgc
The example from the manual regarding merging of rests (http://lilypond.org/doc/v2.19/Documentation/notation/multiple-voices#merging-rests) show a strange difference between whole measure rests and smaller rests. The crotchet rest in bar one is placed in the middle of the staff whereas the whole note rest in bar two is placed at the top (similar to the placement of the \voiceOne rest in the unmerged staff). Is this intentional or a bug? I would think that the correct placement would be in the middle of the staff. 


(In the snippet below I've added a third staff showing the rest placement with a single voice in the staff. As expected lilypond places both rests vertically centered in this staff)


\version "2.19.83"
voiceA = \relative { d''4 r d2 | R1 | }
voiceB = \relative { fis'4 r g2 | R1 | }

\score {
<<
\new Staff \with {
instrumentName = "unmerged"
}
<<
\new Voice { \voiceOne \voiceA }
\new Voice { \voiceTwo \voiceB }
>>
\new Staff \with {
instrumentName = "merged"
\consists "Merge_rests_engraver"
\consists "Merge-mmrests-engraver"
}
<<
\new Voice { \voiceOne \voiceA }
\new Voice { \voiceTwo \voiceB }
>>
\new Staff \with {
instrumentName = "single"
}
\new Voice { \voiceA }
>>
}

--
Jens Gyldenkærne Jensen
Korshøj 226
3670 Veksø
tlf: 2087 3360
Reply | Threaded
Open this post in threaded view
|

Re: Merge_rests_engraver bug with whole measure rest?

Thomas Morley-2
Am Di., 10. Dez. 2019 um 10:42 Uhr schrieb Jens Gyldenkærne Jensen
<[hidden email]>:
>
> The example from the manual regarding merging of rests (http://lilypond.org/doc/v2.19/Documentation/notation/multiple-voices#merging-rests) show a strange difference between whole measure rests and smaller rests. The crotchet rest in bar one is placed in the middle of the staff whereas the whole note rest in bar two is placed at the top (similar to the placement of the \voiceOne rest in the unmerged staff). Is this intentional or a bug? I would think that the correct placement would be in the middle of the staff.

This is fixed in upcoming 2.21.0, probably in upcoming 2.20.0 as well.
Attached the image from the locally compiled 2.21.0 NR

Cheers,
  Harm

lily-8ec97855.png (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Merge_rests_engraver bug with whole measure rest?

jensgc
Excellent. Hope to see them released in a near future.

thx
Jens



Den tir. 10. dec. 2019 kl. 10.57 skrev Thomas Morley <[hidden email]>:
Am Di., 10. Dez. 2019 um 10:42 Uhr schrieb Jens Gyldenkærne Jensen
<[hidden email]>:
>
> The example from the manual regarding merging of rests (http://lilypond.org/doc/v2.19/Documentation/notation/multiple-voices#merging-rests) show a strange difference between whole measure rests and smaller rests. The crotchet rest in bar one is placed in the middle of the staff whereas the whole note rest in bar two is placed at the top (similar to the placement of the \voiceOne rest in the unmerged staff). Is this intentional or a bug? I would think that the correct placement would be in the middle of the staff.

This is fixed in upcoming 2.21.0, probably in upcoming 2.20.0 as well.
Attached the image from the locally compiled 2.21.0 NR

Cheers,
  Harm


--
Jens Gyldenkærne Jensen
Korshøj 226
3670 Veksø
tlf: 2087 3360
Reply | Threaded
Open this post in threaded view
|

Re: Merge_rests_engraver bug with whole measure rest?

Malte Meyn-3
In reply to this post by Thomas Morley-2


Am 10.12.19 um 10:57 schrieb Thomas Morley:
> Am Di., 10. Dez. 2019 um 10:42 Uhr schrieb Jens Gyldenkærne Jensen
> <[hidden email]>:
>>
>> The example from the manual regarding merging of rests (http://lilypond.org/doc/v2.19/Documentation/notation/multiple-voices#merging-rests) show a strange difference between whole measure rests and smaller rests. The crotchet rest in bar one is placed in the middle of the staff whereas the whole note rest in bar two is placed at the top (similar to the placement of the \voiceOne rest in the unmerged staff). Is this intentional or a bug? I would think that the correct placement would be in the middle of the staff.
>
> This is fixed in upcoming 2.21.0, probably in upcoming 2.20.0 as well.

I can confirm: 2.19.84/2.20.0 contains the fix.

Reply | Threaded
Open this post in threaded view
|

Re: Merge_rests_engraver bug with whole measure rest?

David Wright
In reply to this post by jensgc
On Tue 10 Dec 2019 at 11:25:02 (+0100), Jens Gyldenkærne Jensen wrote:

> Den tir. 10. dec. 2019 kl. 10.57 skrev Thomas Morley <[hidden email]>:
> > Am Di., 10. Dez. 2019 um 10:42 Uhr schrieb Jens Gyldenkærne Jensen <[hidden email]>:
> > >
> > > The example from the manual regarding merging of rests (
> > http://lilypond.org/doc/v2.19/Documentation/notation/multiple-voices#merging-rests)
> > show a strange difference between whole measure rests and smaller rests.
> > The crotchet rest in bar one is placed in the middle of the staff whereas
> > the whole note rest in bar two is placed at the top (similar to the
> > placement of the \voiceOne rest in the unmerged staff). Is this intentional
> > or a bug? I would think that the correct placement would be in the middle
> > of the staff.
> >
> > This is fixed in upcoming 2.21.0, probably in upcoming 2.20.0 as well.
> > Attached the image from the locally compiled 2.21.0 NR
>
> Excellent. Hope to see them released in a near future.

As a stopgap, you might be able to correct this for yourself, but I
can't be certain. When rest-merging was just a snippet (336), it
would IIRC place whole measure rests on the centre line, and I
changed a line in #(define merge-multi-measure-rests-on-Y-offset
to correct it, from "0)" to "1)". (At that time, it also had a bug
that printed both dots when it merged dotted crochet rests.)
More recent downloads seem to have corrected both these bugs,
so the "0)" value now works, and I still use the download, rather
than the built-in version.

AFAICT, the code that sets the rest positions is in
lilypond-2.19.83-1.linux-64/lilypond/usr/share/lilypond/current/scm/scheme-engravers.scm
in the lines following

  (define-public (Merge_rests_engraver context)
  "Engraver to merge rests in multiple voices on the same staff.

  This works by gathering all rests at a time step. If they are all of the same
  length and there are at least two they are moved to the correct location as
  if there were one voice."

but I'm not familiar enough with scheme to know precisely which line.
Perhaps others are. It might be as simple as changing one digit.

Cheers,
David.