[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Centered full-measure rest in 3/4?

From: Jacques Menu Muzhic
Subject: Re: Centered full-measure rest in 3/4?
Date: Thu, 8 Mar 2018 05:48:17 +0100

Hello Torsten,

Thanks for this quite interesting example of Lily’s capabilities!


Le 7 mars 2018 à 21:14, Torsten Hämmerle <address@hidden> a écrit :

Hi Karen,

We all know that your client's preferred solution is against the rules, but,
if she wants it that way, this is a good exercise. :)

Overriding the MultiMeasureRest stencil is not too easy, because the dots
are a case of their own and generally not used for whole-bar rests at all.

There are two things to be considered:

(1) LilyPond will only use semibreve (or longer) rest symbols, but we want
minim rests in this special case.
Solution: There's a property "usable-duration-logs" containing a list of
allowed duration-log values. We need to add a 1 there (for minim rests). If
we add a 2 and a 3, LilyPond will even use crotchet rests and quaver rests:

 \override MultiMeasureRest.usable-duration-logs = #'(-3 -2 -1 0 1 2 3)

(2) We still have a remaining problem: the missing dot. Dots are not a part
of ordinary whole-bar rests, and that's why we have to build our own
I've used the standard MultiMeasureRest.stencil and added the standard "dot"
stencil, just shifted up by 0.5 stave units. If you set dot-count to 3, you
will get three dots.

It's a bit inelegant that you'll have to explicitly set the number of dots
you want to have displayed, but, as a result, you can specify any rest you
want as a multi measure rest (whole-bar rest).

Here's a minimal example demonstrating the use of the new custom-mm-rest
stencil, even with dotted crotchet rests just for fun (knowing that they
should not be centered).

\version "2.18.2"

#(define (custom-mm-rest grob)
   (ly:multi-measure-rest::print grob) X RIGHT
   (ly:stencil-translate-axis (ly:dots::print grob) 0.5 Y) 0))

\new PianoStaff <<
  \new Staff \relative {
    \time 3/4
    <g' b d>2 <d g a>8-. q-. |
    <g b d>2 q4 |
    c,16 d e f g a b c g e c8 |
    \time 3/8
    c8 e g |
    f d b |
    c16 e g f d b |
  \new Staff \relative {
    \time 3/4
    \override MultiMeasureRest.stencil = #custom-mm-rest
    \override MultiMeasureRest.usable-duration-logs = #'(-3 -2 -1 0 1 2 3
    \override = #1
    \time 3/8

In short:
(1) set custom stencil
(2) extending the usable-duration-logs list by adding minim, crotchet,
quaver rests
(3) explicitly set the dot-count to 1 so that a dotted rest symbol will be
Voilà ! :)


All the best,

Sent from:

lilypond-user mailing list

reply via email to

[Prev in Thread] Current Thread [Next in Thread]