Metric modulation (proportional tempi): Difference between revisions

Created page with "This snippet shows how you can typeset a metric modulation as a rehearsal mark. (See [https://lists.gnu.org/archive/html/lilypond-user/2026-05/msg00194.html this thread on the mailing list].) Compare Metric modulation with tuplet. In the code below, the following commands enable you to to center the = glyph above the bar line. # <code>\general-align</code> commands set the center of the <code>myMetricModulation</code> markup to be the center of the equals sign (=)...."
 
I added links to Yoshiaki Onishi’s solution.
 
Line 1: Line 1:
This snippet shows how you can typeset a metric modulation as a rehearsal mark. (See [https://lists.gnu.org/archive/html/lilypond-user/2026-05/msg00194.html this thread on the mailing list].) Compare [[Metric modulation with tuplet]].
This snippet shows how you can '''typeset a metric modulation as a rehearsal mark'''. (See [https://lists.gnu.org/archive/html/lilypond-user/2026-05/msg00194.html this thread on the mailing list].)


In the code below, the following commands enable you to to center the = glyph above the bar line.
In the code below, the following commands enable you to '''center the = glyph above the bar line'''.
# <code>\general-align</code> commands set the center of the <code>myMetricModulation</code> markup to be the center of the equals sign (=). For more information, see [https://lilypond.org/doc/v2.26/Documentation/notation/text-markup-commands#markup-for-text-alignment A.1.2 Markup for text alignment] in the Notation Reference.
# <code>\general-align</code> commands set the center of the <code>myMetricModulation</code> markup to be the center of the equals sign (=). For more information, see [https://lilypond.org/doc/v2.26/Documentation/notation/text-markup-commands#markup-for-text-alignment A.1.2 Markup for text alignment] in the Notation Reference.
# <code>\put-adjacent</code> commands add elements to the sides of the equals sign without shifting it. See [https://lilypond.org/doc/v2.26/Documentation/notation/text-markup-commands#markup-for-text-alignment A.1.2 Markup for text alignment].
# <code>\put-adjacent</code> commands add elements to the sides of the equals sign without shifting it. See [https://lilypond.org/doc/v2.26/Documentation/notation/text-markup-commands#markup-for-text-alignment A.1.2 Markup for text alignment].
# Switching off <code>self-alignment-X</code> means that the 0 coordinate of the stencil gets used for alignment with the bar line, without any shifting. Without <code>\tweak self-alignment-X ##f</code>, <code>self-alignment-X = 0</code> would calculate a shift in order to align the center of the markup (rather than the equals sign) to its anchor point.
# Switching off <code>self-alignment-X</code> means that the 0 coordinate of the stencil gets used for alignment with the bar line, without any shifting. (If you do not include <code>\tweak self-alignment-X ##f</code>, then <code>self-alignment-X = 0</code> will calculate a shift in order to align the center of the markup, rather than the equals sign, to its anchor point.)


The music is from Tomás Luis de Victoria, “O magnum mysterium,” Tenor part ([https://ks15.imslp.org/files/imglnks/usimg/6/69/IMSLP106031-PMLP216234-TENOR.pdf PDF of source]).
The music on this page is from Tomás Luis de Victoria, “O magnum mysterium,” Tenor part ([https://ks15.imslp.org/files/imglnks/usimg/6/69/IMSLP106031-PMLP216234-TENOR.pdf PDF of source]).
 
'''Some other approaches to metric modulations:'''
# [[Metric modulation with tuplet]] shows a way to indicate a metric modulation that refers to a duration within a tuplet.
# Yoshiaki Onishi’s approaches use <code>\textEndMark</code> and <code>\textMark</code> and print left and right arrows (← →) on each side of the equation, following the example of the scores of composer Elliott Carter. For an explanation, search for “Metric Modulation Equation” in Onishi’s [https://github.com/yoshiakionishi/lilypond-snippets/blob/main/DOCUMENT/YO_SNIPPETS_COOKBOOK_MASTER.pdf LilyPond Contemporary Notation Cookbook]; for the code, see [https://github.com/yoshiakionishi/lilypond-snippets/blob/main/DOCUMENT/metricModulationRegularFlag.ly metricModulationRegularFlag.ly] and [https://github.com/yoshiakionishi/lilypond-snippets/blob/main/DOCUMENT/metricmodulationStraightFlag.ly metricmodulationStraightFlag.ly]. His commands support tuplet note values.


<lilypond version="2.26">
<lilypond version="2.26">