[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: vertical spacing of rests
From: |
Peter Selinger |
Subject: |
Re: vertical spacing of rests |
Date: |
Sun, 23 Aug 2015 15:41:23 -0300 (ADT) |
Klaus Blum wrote:
>
> A quick and dirty approach would be to remove the Rest_engraver from the
> second voice:
Yes, this works.
> If you look for an automatic solution that detects if both voices have the
> same rests, go for the merge-rests-engraver already mentioned by Harm.
> AFAIK the most recent version is here:
> https://github.com/openlilylib/openlilylib/tree/master/editorial-tools/merge-rests-engraver
The merge-rests-engraver solutions (written by Jay Anderson,
apparently) would clearly be the best solution to the problem, as it
solves the general case (i.e., when some rests are in common and some
are not). I hope that this will become a part of the standard library
in the future. It might even make sense to turn it on by default.
However, a significant problem with Jay's code is that it too doesn't
work correctly with dotted rests.
%----------------------------------------
\version "2.19.25"
\include "definition.ily"
\layout {
\context { \Staff \consists #merge-rests-engraver }
\context { \Staff \consists #merge-mmrests-engraver }
}
\new Staff <<
\new Voice {
\relative c'' {
\voiceOne
r c r d | r2. e4
d2. e4
}
}
\new Voice {
\relative c'' {
\voiceTwo
r4 a8 a8 r4 b8 b8 | r2. c4
c2. a4
}
}
>>
%----------------------------------------
Here, the definition.ily that I have included is the latest version
from the above github link. The output (see rests4.pdf) still shows
two dots for each of the merged dotted rests.
So it's the same problem in disguise. It seems that Jay's code, rather
than turning the redundant rests into spacers, prints them all on top
of each other, resulting in the multiple dots since the
Dot_column_engraver doesn't understand that the rests have been
merged.
My guess is that the part of the code that says
(for-each
(lambda (rest)
(ly:grob-set-property! rest 'Y-offset 0))
rests))))
should be changed: rather than just setting all the Y-offsets to 0,
all rests except the first one in the list should be disabled
completely, and preferably turned into spacers so that there will be
no dots associated with them.
But I don't know enough about internals to know how to do that.
-- Peter
rests4.pdf
Description: PDF document, version 1.4
- Re: vertical spacing of rests, (continued)
- Re: vertical spacing of rests, Peter Selinger, 2015/08/22
- Re: vertical spacing of rests, Klaus Blum, 2015/08/23
- Re: vertical spacing of rests, Thomas Morley, 2015/08/23
- Re: vertical spacing of rests, Peter Selinger, 2015/08/23
- Re: vertical spacing of rests, Thomas Morley, 2015/08/23
- Re: vertical spacing of rests, Peter Selinger, 2015/08/23
- Re: vertical spacing of rests, Paul Morris, 2015/08/23
- Re: vertical spacing of rests, Peter Selinger, 2015/08/23
- Re: vertical spacing of rests, David Kastrup, 2015/08/24
- Re: vertical spacing of rests, Thomas Morley, 2015/08/23
- Re: vertical spacing of rests,
Peter Selinger <=
Re: vertical spacing of rests, Michael Rivers, 2015/08/22
Re: vertical spacing of rests, David Kastrup, 2015/08/24
- Re: vertical spacing of rests, Ralph Palmer, 2015/08/24
- Re: vertical spacing of rests, Trevor Daniels, 2015/08/24
- Re: vertical spacing of rests, Peter Selinger, 2015/08/25
- Re: vertical spacing of rests, Trevor Daniels, 2015/08/25
- Re: vertical spacing of rests, Michael Gerdau, 2015/08/25
- Re: vertical spacing of rests, Phil Holmes, 2015/08/25
- Re: vertical spacing of rests, Peter Selinger, 2015/08/25