Time signature with alternate in parentheses: Difference between revisions
Appearance
Improved |
Improve more. |
||
| Line 1: | Line 1: | ||
In polymetric music, a composer may indicate beat structure by following one time signature with another in parenthesis, for example | In polymetric music, a composer may indicate beat structure by following one time signature with another in parenthesis, for example, ‘3/4 (6/8)’ indicating a 6/8 beat in a 3/4 measure, or ‘6/4 (6/8)’ indicating a 6/8 beat in a 6/4 measure. | ||
This snippet | This snippet provides a small Scheme wrapper around the <code>\compound-meter</code> markup function that can be used to override the <code>TimeSignature</code> stencil, displaying both a regular and an alternate time signature. | ||
<lilypond version="2.24"> | <lilypond version="2.24"> | ||
#(define ((time-parenthesized-time | #(define ((time-parenthesized-time t tp) grob) | ||
(let ((m1 (grob-interpret-markup | (let ((m1 (grob-interpret-markup | ||
grob | grob (markup #:compound-meter t))) | ||
(m2 (grob-interpret-markup | (m2 (grob-interpret-markup | ||
grob | grob (markup #:compound-meter tp)))) | ||
(ly:stencil-combine-at-edge | (ly:stencil-combine-at-edge | ||
m1 X RIGHT | m1 X RIGHT | ||
(parenthesize-stencil m2 0.1 0.4 0.4 0.1) | (parenthesize-stencil m2 0.1 0.4 0.4 0.1) | ||
0.3))) | 0.3))) | ||
\relative c' { | \relative c' { | ||
\once \override Staff.TimeSignature.stencil = | \once \override Staff.TimeSignature.stencil = | ||
#(time-parenthesized-time 3 4 6 8) | #(time-parenthesized-time '(3 4) '(6 8)) | ||
\time 3/4 b8 b8 gis8 gis4 gis8 | | \time 3/4 b8 b8 gis8 gis4 gis8 | | ||
\time 4/4 b4 | \once \override Staff.TimeSignature.stencil = | ||
#(time-parenthesized-time '(4 4) '(3 2 3 8)) | |||
\time 4/4 b4. b4 b4. | |||
} | } | ||
</lilypond> | </lilypond> | ||
Revision as of 04:10, 15 April 2026
In polymetric music, a composer may indicate beat structure by following one time signature with another in parenthesis, for example, ‘3/4 (6/8)’ indicating a 6/8 beat in a 3/4 measure, or ‘6/4 (6/8)’ indicating a 6/8 beat in a 6/4 measure.
This snippet provides a small Scheme wrapper around the \compound-meter markup function that can be used to override the TimeSignature stencil, displaying both a regular and an alternate time signature.
\version "2.24"
#(define ((time-parenthesized-time t tp) grob)
(let ((m1 (grob-interpret-markup
grob (markup #:compound-meter t)))
(m2 (grob-interpret-markup
grob (markup #:compound-meter tp))))
(ly:stencil-combine-at-edge
m1 X RIGHT
(parenthesize-stencil m2 0.1 0.4 0.4 0.1)
0.3)))
\relative c' {
\once \override Staff.TimeSignature.stencil =
#(time-parenthesized-time '(3 4) '(6 8))
\time 3/4 b8 b8 gis8 gis4 gis8 |
\once \override Staff.TimeSignature.stencil =
#(time-parenthesized-time '(4 4) '(3 2 3 8))
\time 4/4 b4. b4 b4.
}