<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.lilypond.community/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Lemzwerg</id>
	<title>LilyPond wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.lilypond.community/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Lemzwerg"/>
	<link rel="alternate" type="text/html" href="https://wiki.lilypond.community/wiki/Special:Contributions/Lemzwerg"/>
	<updated>2026-08-02T03:12:19Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.44.2</generator>
	<entry>
		<id>https://wiki.lilypond.community/index.php?title=Table_of_contents_section_command&amp;diff=6613</id>
		<title>Table of contents section command</title>
		<link rel="alternate" type="text/html" href="https://wiki.lilypond.community/index.php?title=Table_of_contents_section_command&amp;diff=6613"/>
		<updated>2026-07-19T04:24:41Z</updated>

		<summary type="html">&lt;p&gt;Lemzwerg: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;If you have several pieces in several files, you might want to build a book from that. Assume you have a master file which includes the pieces:&lt;br /&gt;
&lt;br /&gt;
 \include &amp;quot;tune1.ly&amp;quot;&lt;br /&gt;
 \include &amp;quot;tune2.ly&amp;quot;&lt;br /&gt;
&lt;br /&gt;
In your piece-files you might have &amp;lt;code&amp;gt;\tocItem&amp;lt;/code&amp;gt; commands to build the table of contents.&lt;br /&gt;
&lt;br /&gt;
With the following snippet, you can replace those &amp;lt;code&amp;gt;\tocItem&amp;lt;/code&amp;gt; commands with &amp;lt;code&amp;gt;#(set-toc-section! &amp;quot;&#039;&#039;section&#039;&#039;&amp;quot;)&amp;lt;/code&amp;gt; in the master file:&lt;br /&gt;
&lt;br /&gt;
 #(set-toc-section! &amp;quot;tunes&amp;quot;)&lt;br /&gt;
 \include &amp;quot;tune1.ly&amp;quot;&lt;br /&gt;
 \include &amp;quot;tune2.ly&amp;quot;&lt;br /&gt;
 #(set-toc-section! &amp;quot;parts&amp;quot;)&lt;br /&gt;
 \include &amp;quot;part1.ly&amp;quot;&lt;br /&gt;
 \include &amp;quot;part2.ly&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Now every section is introduced with a section line in the table of contents only if the section title was set before. If you reorder the parts (includes), the sections will still appear in the right place. This is meant for compiling a collection of pieces, which also compile themselves. For a complete opus with pieces, see [[Ready-to-use LilyPond macros: advanced layout and titles, using a special stylesheet]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lilypond version=&amp;quot;2.24&amp;quot; full&amp;gt;&lt;br /&gt;
% define toc-section commands&lt;br /&gt;
#(begin &lt;br /&gt;
  (define-public (set-toc-section! text) #f)&lt;br /&gt;
  (define-public (get-toc-section text) #f)&lt;br /&gt;
  (let ((toc-section #f))&lt;br /&gt;
       (set! set-toc-section! (lambda (text)(set! toc-section text)))&lt;br /&gt;
       (set! get-toc-section (lambda ()(begin toc-section)))))&lt;br /&gt;
&lt;br /&gt;
% define section-aware piece-toc-item-command&lt;br /&gt;
piece = #(define-music-function (text) (markup?)&lt;br /&gt;
  (begin &lt;br /&gt;
    (if (get-toc-section)&lt;br /&gt;
        (add-toc-item! &#039;tocCollMarkup (get-toc-section)))&lt;br /&gt;
    (set-toc-section! #f)&lt;br /&gt;
    (add-toc-item! &#039;tocPartMarkup text)))&lt;br /&gt;
&lt;br /&gt;
\paper {&lt;br /&gt;
  % A small paper size for demonstration purposes.&lt;br /&gt;
  #(set-paper-size &#039;(cons (* 100 mm) (* 50 mm)))&lt;br /&gt;
&lt;br /&gt;
  % this will not know the page number!&lt;br /&gt;
  tocCollMarkup = \markup { \fill-line {&lt;br /&gt;
    \bold \fromproperty #&#039;toc:text \vspace #1 \null } }&lt;br /&gt;
  tocPartMarkup = \markup { \fill-line {&lt;br /&gt;
    \concat { \hspace #2 \fromproperty #&#039;toc:text }&lt;br /&gt;
              \vspace #0 \fromproperty #&#039;toc:page } }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
% some music pieces ...&lt;br /&gt;
\bookpart {&lt;br /&gt;
  \markuplist {&lt;br /&gt;
    \override-lines #&#039;(baseline-skip . 2.3)&lt;br /&gt;
    \table-of-contents&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
#(set-toc-section! &amp;quot;section 1&amp;quot;)&lt;br /&gt;
\bookpart {&lt;br /&gt;
  \piece \markup { &amp;quot;piece 1&amp;quot; }&lt;br /&gt;
  \score {&lt;br /&gt;
    \relative c&#039; {      &lt;br /&gt;
      c d e f g&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
\bookpart {&lt;br /&gt;
  \piece \markup { &amp;quot;piece 2&amp;quot; }&lt;br /&gt;
  \score {&lt;br /&gt;
    \relative c&#039; {&lt;br /&gt;
      c d e f&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
#(set-toc-section! &amp;quot;section 2&amp;quot;)&lt;br /&gt;
\bookpart {&lt;br /&gt;
  \piece \markup { &amp;quot;piece 1&amp;quot; }&lt;br /&gt;
  \score {&lt;br /&gt;
    \relative c&#039; {&lt;br /&gt;
      c d e f&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
\bookpart {&lt;br /&gt;
  \piece \markup { &amp;quot;piece 2&amp;quot; }&lt;br /&gt;
  \score {&lt;br /&gt;
    \relative c&#039; {&lt;br /&gt;
      c d e f&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lilypond&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Titles]]&lt;br /&gt;
[[Category:Paper and layout]]&lt;br /&gt;
[[Category:Snippet]]&lt;/div&gt;</summary>
		<author><name>Lemzwerg</name></author>
	</entry>
	<entry>
		<id>https://wiki.lilypond.community/index.php?title=Figured_bass_centered_horizontally_on_note_heads&amp;diff=6606</id>
		<title>Figured bass centered horizontally on note heads</title>
		<link rel="alternate" type="text/html" href="https://wiki.lilypond.community/index.php?title=Figured_bass_centered_horizontally_on_note_heads&amp;diff=6606"/>
		<updated>2026-07-13T15:49:35Z</updated>

		<summary type="html">&lt;p&gt;Lemzwerg: Lemzwerg moved page Figured bass centered on whole notes to Figured bass centered horizontally on note heads without leaving a redirect&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Due to [https://gitlab.com/lilypond/lilypond/-/work_items/3172 LilyPond issue #3172], the horizontal alignment of bass figures attached to whole notes is flawed. Below you can find a solution (contributed by [https://lists.gnu.org/archive/html/lilypond-user/2026-06/msg00250.html Tina Petzel]) that works around this problem,&lt;br /&gt;
&lt;br /&gt;
* providing a replacement function &amp;lt;code&amp;gt;c-format-bass-figure&amp;lt;/code&amp;gt; for the &amp;lt;code&amp;gt;figuredBassFormatter&amp;lt;/code&amp;gt; property to center the base digit,&lt;br /&gt;
* creating a small engraver called &amp;lt;code&amp;gt;figures-to-note-column-engraver&amp;lt;/code&amp;gt; that changes the X&amp;amp;nbsp;parent of bass figures to &amp;lt;code&amp;gt;NoteColumn&amp;lt;/code&amp;gt; grobs, and&lt;br /&gt;
* setting some bass figure properties to center-align them with main note heads.&lt;br /&gt;
&lt;br /&gt;
A convenience macro &amp;lt;code&amp;gt;\CenteredFiguredBass&amp;lt;/code&amp;gt; is defined to do these tasks.&lt;br /&gt;
&lt;br /&gt;
There are limitations, though.  It is necessary that &amp;lt;code&amp;gt;figures-to-note-column-engraver&amp;lt;/code&amp;gt; lives in a context that is an ancestor of both &amp;lt;code&amp;gt;Rhythmic_column_engraver&amp;lt;/code&amp;gt; (typically part of &amp;lt;code&amp;gt;Voice&amp;lt;/code&amp;gt;) and &amp;lt;code&amp;gt;Figured_bass_engraver&amp;lt;/code&amp;gt;.  Examples:&lt;br /&gt;
&lt;br /&gt;
 \new Staff \with { \CenteredFiguredBass }&lt;br /&gt;
 &amp;lt;&amp;lt;&lt;br /&gt;
   { bass music }&lt;br /&gt;
   \figuremode { figured bass }&lt;br /&gt;
 &amp;gt;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 \new StaffGroup \with { \CenteredFiguredBass }&lt;br /&gt;
 &amp;lt;&amp;lt;&lt;br /&gt;
   \new Staff { ... }&lt;br /&gt;
   \new FiguredBass { ... }&lt;br /&gt;
 &amp;gt;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the rare case that you have multiple voices in the bass staff you might want to move the &amp;lt;code&amp;gt;Figured_bass_engraver&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;Voice&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lilypond version=&amp;quot;2.26&amp;quot;&amp;gt;&lt;br /&gt;
#(set-global-staff-size 26)&lt;br /&gt;
&lt;br /&gt;
#(define-public (c-format-bass-figure figure event context)&lt;br /&gt;
   (let* (;; User properties controlling the figured bass layout.&lt;br /&gt;
          (figbass-alist&lt;br /&gt;
           (ly:context-property context &#039;figuredBassPlusStrokedAlist))&lt;br /&gt;
          (alt-dir&lt;br /&gt;
           (ly:context-property context &#039;figuredBassAlterationDirection))&lt;br /&gt;
          (plus-dir&lt;br /&gt;
           (ly:context-property context &#039;figuredBassPlusDirection))&lt;br /&gt;
          (augmented (ly:event-property event &#039;augmented))&lt;br /&gt;
          (number-one (make-number-markup &amp;quot;1&amp;quot;))&lt;br /&gt;
&lt;br /&gt;
          ;; The digit(s), horizontally positioned, or #f.&lt;br /&gt;
          (fig-markup&lt;br /&gt;
           (if (number? figure)&lt;br /&gt;
               (make-center-align-markup&lt;br /&gt;
		(cond&lt;br /&gt;
                 ((eq? #t (ly:event-property event &#039;diminished))&lt;br /&gt;
                  (make-slashed-digit-markup figure))&lt;br /&gt;
                 ((eq? #t (ly:event-property event &#039;augmented-slash))&lt;br /&gt;
                  ;; Use specially stroked digit if available and wanted.&lt;br /&gt;
                     (or (and-let* (((&amp;lt;= 6 figure 9))&lt;br /&gt;
                                    (glyph (assv-ref figbass-alist figure)))&lt;br /&gt;
			   (make-musicglyph-markup glyph))&lt;br /&gt;
			 (make-backslashed-digit-markup figure)))&lt;br /&gt;
                 ((eq? #t augmented)&lt;br /&gt;
                  ;; Use special digit with plus if available and wanted.&lt;br /&gt;
                  (or (and-let* (((&amp;gt;= 5 figure 2))&lt;br /&gt;
                                 ((eqv? plus-dir RIGHT))&lt;br /&gt;
                                 (glyph (assv-ref figbass-alist figure)))&lt;br /&gt;
			(set! augmented #f)&lt;br /&gt;
			(make-musicglyph-markup glyph))&lt;br /&gt;
                      (make-number-markup (number-&amp;gt;string figure 10))))&lt;br /&gt;
                 (else (make-number-markup (number-&amp;gt;string figure 10)))))&lt;br /&gt;
               #f))&lt;br /&gt;
&lt;br /&gt;
          (alt (ly:event-property event &#039;alteration))&lt;br /&gt;
          (alt-bracket (ly:event-property event &#039;alteration-bracket #f))&lt;br /&gt;
          ;; The alteration, probably bracketed but not positioned yet,&lt;br /&gt;
          ;; or #f.&lt;br /&gt;
          (alt-markup&lt;br /&gt;
           (if (number? alt)&lt;br /&gt;
               (let* ((acc (assoc-get alt (@@ (lily) figbass-accidental-alist)))&lt;br /&gt;
                      (acc-markup&lt;br /&gt;
                       (if acc&lt;br /&gt;
                           (make-number-markup (ly:wide-char-&amp;gt;utf-8 acc))&lt;br /&gt;
                           (begin&lt;br /&gt;
                             (ly:warning&lt;br /&gt;
                              (G_ &amp;quot;no accidental glyph found for alteration ~a&amp;quot;)&lt;br /&gt;
                              alt)&lt;br /&gt;
                             ;; fallback&lt;br /&gt;
			     &amp;quot;?&amp;quot;))))&lt;br /&gt;
                 (if alt-bracket&lt;br /&gt;
                     (make-bracket-markup acc-markup)&lt;br /&gt;
                     acc-markup))&lt;br /&gt;
               #f))&lt;br /&gt;
&lt;br /&gt;
          (plus-markup (if (eq? #t augmented)&lt;br /&gt;
                           (make-number-markup &amp;quot;+&amp;quot;)&lt;br /&gt;
                           #f)))&lt;br /&gt;
&lt;br /&gt;
     (if (and (not alt-markup) alt-bracket)&lt;br /&gt;
         (ly:programming-error&lt;br /&gt;
          &amp;quot;Cannot put brackets around non-existent bass figure alteration.&amp;quot;))&lt;br /&gt;
&lt;br /&gt;
     ;; We treat a solitary alteration similarly to digits.&lt;br /&gt;
     (if (and (not fig-markup) alt-markup)&lt;br /&gt;
         (begin&lt;br /&gt;
           (set! fig-markup&lt;br /&gt;
                 (make-center-align-markup alt-markup))&lt;br /&gt;
           (set! alt-markup #f)))&lt;br /&gt;
&lt;br /&gt;
     ;; We treat a solitary plus similarly to digits (but enlarged).&lt;br /&gt;
     (if (and (not fig-markup) plus-markup)&lt;br /&gt;
         (begin&lt;br /&gt;
           (set! fig-markup&lt;br /&gt;
                 (make-align-on-other-markup&lt;br /&gt;
                  Y&lt;br /&gt;
                  CENTER number-one&lt;br /&gt;
                  CENTER&lt;br /&gt;
		  (make-center-align-markup&lt;br /&gt;
		   (make-fontsize-markup 3 plus-markup))))&lt;br /&gt;
           (set! plus-markup #f)))&lt;br /&gt;
&lt;br /&gt;
     ;; The alteration gets attached either to the left or the right of&lt;br /&gt;
     ;; the digit(s).&lt;br /&gt;
     (if alt-markup&lt;br /&gt;
         (set! fig-markup&lt;br /&gt;
               (make-put-adjacent-markup&lt;br /&gt;
		X (if (number? alt-dir)&lt;br /&gt;
                      alt-dir&lt;br /&gt;
                      LEFT)&lt;br /&gt;
		fig-markup&lt;br /&gt;
		(make-pad-x-markup 0.1 alt-markup))))&lt;br /&gt;
&lt;br /&gt;
     ;; Ditto for the plus mark.&lt;br /&gt;
     (if plus-markup&lt;br /&gt;
         (set! fig-markup&lt;br /&gt;
               (if fig-markup&lt;br /&gt;
                   (make-put-adjacent-markup&lt;br /&gt;
                    X (if (number? plus-dir)&lt;br /&gt;
                          plus-dir&lt;br /&gt;
                          LEFT)&lt;br /&gt;
                    fig-markup plus-markup)&lt;br /&gt;
                   plus-markup)))&lt;br /&gt;
&lt;br /&gt;
     (if (markup? fig-markup)&lt;br /&gt;
         (make-fontsize-markup -5 fig-markup)&lt;br /&gt;
         (make-null-markup))))&lt;br /&gt;
&lt;br /&gt;
#(define (figures-to-note-column-engraver context)&lt;br /&gt;
   (let ((figs &#039;()) (nc #f))&lt;br /&gt;
     (make-engraver&lt;br /&gt;
      (acknowledgers&lt;br /&gt;
       ((bass-figure-interface engraver grob source)&lt;br /&gt;
        (set! figs (cons grob figs)))&lt;br /&gt;
       ((note-column-interface engraver grob source)&lt;br /&gt;
        (set! nc grob)))&lt;br /&gt;
      ((process-acknowledged engraver)&lt;br /&gt;
       (if nc&lt;br /&gt;
           (for-each&lt;br /&gt;
            (lambda (g)&lt;br /&gt;
              (ly:grob-set-parent! g X nc))&lt;br /&gt;
            figs))&lt;br /&gt;
       (set! nc #f)&lt;br /&gt;
       (set! figs &#039;())))))&lt;br /&gt;
&lt;br /&gt;
CenteredFiguredBass = \with {&lt;br /&gt;
  \consists #figures-to-note-column-engraver&lt;br /&gt;
  \override BassFigure.X-align-on-main-noteheads = ##t&lt;br /&gt;
  \override BassFigure.parent-alignment-X = #CENTER&lt;br /&gt;
  \override BassFigure.X-offset =&lt;br /&gt;
    #ly:self-alignment-interface::aligned-on-x-parent&lt;br /&gt;
  figuredBassFormatter = #c-format-bass-figure&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
%%%%%%%%%%%%%%%%%%%%%%%%%%%&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
\new Staff \with { \CenteredFiguredBass }&lt;br /&gt;
&amp;lt;&amp;lt;&lt;br /&gt;
  { c&#039;1 4 8 8 }&lt;br /&gt;
  \figuremode {&lt;br /&gt;
    \override Staff.BassFigureAlignment.stacking-dir = #DOWN&lt;br /&gt;
    &amp;lt;15- 7+ 6/ 4\+ 3- _+ _\+&amp;gt;1 4 8 8&lt;br /&gt;
  }&lt;br /&gt;
&amp;gt;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
\new StaffGroup \with { \CenteredFiguredBass }&lt;br /&gt;
&amp;lt;&amp;lt;&lt;br /&gt;
  % To make the figured bass stuff appear in the source file&lt;br /&gt;
  % before the music we have to initialize the `Staff` context&lt;br /&gt;
  % first (and fill it later).&lt;br /&gt;
  \new Staff = &amp;quot;mystaff&amp;quot;&lt;br /&gt;
  \figuremode {&lt;br /&gt;
    \override Staff.BassFigureAlignment.stacking-dir = #UP&lt;br /&gt;
    % Work around issue #6552, fixing bracket positions.&lt;br /&gt;
    \override Staff.BassFigureAlignmentPositioning&lt;br /&gt;
                   .outside-staff-priority = ##f&lt;br /&gt;
    &amp;lt;3 [5 7]&amp;gt;8&lt;br /&gt;
      &amp;lt;3\+ [5/] 7/ [9 11]&amp;gt;&lt;br /&gt;
    &amp;lt;3+ 5- 7!&amp;gt;&lt;br /&gt;
      &amp;lt;3 _! 5 _- 7&amp;gt;&lt;br /&gt;
    &amp;lt;3 _\+ 5 _ 7&amp;gt;&lt;br /&gt;
      &amp;lt;3 6/ &amp;gt;&lt;br /&gt;
    &amp;lt;3 6\\ &amp;gt;&lt;br /&gt;
      &amp;lt;6&amp;gt; |&lt;br /&gt;
    &amp;lt;3 [5 7]&amp;gt;1&lt;br /&gt;
  }&lt;br /&gt;
  \context Staff = &amp;quot;mystaff&amp;quot; {&lt;br /&gt;
    \clef bass&lt;br /&gt;
    c4 c c&#039;8 c c16 c c c | c1&lt;br /&gt;
  }&lt;br /&gt;
&amp;gt;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
\new StaffGroup \with { \CenteredFiguredBass }&lt;br /&gt;
&amp;lt;&amp;lt;&lt;br /&gt;
  \new Staff = &amp;quot;mystaff&amp;quot; {&lt;br /&gt;
    \clef bass&lt;br /&gt;
    c4 c f,8 c c16 c c c | c1&lt;br /&gt;
  }&lt;br /&gt;
  \figuremode {&lt;br /&gt;
    \override Staff.BassFigureAlignment.stacking-dir = #UP&lt;br /&gt;
    \override Staff.BassFigureAlignmentPositioning.direction = #DOWN&lt;br /&gt;
    % Work around issue #6552, fixing bracket positions.&lt;br /&gt;
    \override Staff.BassFigureAlignmentPositioning&lt;br /&gt;
                   .outside-staff-priority = ##f&lt;br /&gt;
    &amp;lt;3 [5 7]&amp;gt;8&lt;br /&gt;
      &amp;lt;3\+ [5/] 7/ [9 11]&amp;gt;&lt;br /&gt;
    &amp;lt;3+ 5- 7!&amp;gt;&lt;br /&gt;
      &amp;lt;3 _! 5 _- 7&amp;gt;&lt;br /&gt;
    &amp;lt;3 _\+ 5 _ 7&amp;gt;&lt;br /&gt;
      &amp;lt;3 6/ &amp;gt;&lt;br /&gt;
    &amp;lt;3 6\\ &amp;gt;&lt;br /&gt;
      &amp;lt;6&amp;gt; |&lt;br /&gt;
    &amp;lt;3 [5 7]&amp;gt;1&lt;br /&gt;
  }&lt;br /&gt;
&amp;gt;&amp;gt;&lt;br /&gt;
&amp;lt;/lilypond&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Ancient notation]]&lt;br /&gt;
[[Category:Chords]]&lt;br /&gt;
[[Category:Workaround]]&lt;br /&gt;
[[Category:Snippet]]&lt;/div&gt;</summary>
		<author><name>Lemzwerg</name></author>
	</entry>
	<entry>
		<id>https://wiki.lilypond.community/index.php?title=Figured_bass_centered_horizontally_on_note_heads&amp;diff=6605</id>
		<title>Figured bass centered horizontally on note heads</title>
		<link rel="alternate" type="text/html" href="https://wiki.lilypond.community/index.php?title=Figured_bass_centered_horizontally_on_note_heads&amp;diff=6605"/>
		<updated>2026-07-13T15:48:49Z</updated>

		<summary type="html">&lt;p&gt;Lemzwerg: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Due to [https://gitlab.com/lilypond/lilypond/-/work_items/3172 LilyPond issue #3172], the horizontal alignment of bass figures attached to whole notes is flawed. Below you can find a solution (contributed by [https://lists.gnu.org/archive/html/lilypond-user/2026-06/msg00250.html Tina Petzel]) that works around this problem,&lt;br /&gt;
&lt;br /&gt;
* providing a replacement function &amp;lt;code&amp;gt;c-format-bass-figure&amp;lt;/code&amp;gt; for the &amp;lt;code&amp;gt;figuredBassFormatter&amp;lt;/code&amp;gt; property to center the base digit,&lt;br /&gt;
* creating a small engraver called &amp;lt;code&amp;gt;figures-to-note-column-engraver&amp;lt;/code&amp;gt; that changes the X&amp;amp;nbsp;parent of bass figures to &amp;lt;code&amp;gt;NoteColumn&amp;lt;/code&amp;gt; grobs, and&lt;br /&gt;
* setting some bass figure properties to center-align them with main note heads.&lt;br /&gt;
&lt;br /&gt;
A convenience macro &amp;lt;code&amp;gt;\CenteredFiguredBass&amp;lt;/code&amp;gt; is defined to do these tasks.&lt;br /&gt;
&lt;br /&gt;
There are limitations, though.  It is necessary that &amp;lt;code&amp;gt;figures-to-note-column-engraver&amp;lt;/code&amp;gt; lives in a context that is an ancestor of both &amp;lt;code&amp;gt;Rhythmic_column_engraver&amp;lt;/code&amp;gt; (typically part of &amp;lt;code&amp;gt;Voice&amp;lt;/code&amp;gt;) and &amp;lt;code&amp;gt;Figured_bass_engraver&amp;lt;/code&amp;gt;.  Examples:&lt;br /&gt;
&lt;br /&gt;
 \new Staff \with { \CenteredFiguredBass }&lt;br /&gt;
 &amp;lt;&amp;lt;&lt;br /&gt;
   { bass music }&lt;br /&gt;
   \figuremode { figured bass }&lt;br /&gt;
 &amp;gt;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 \new StaffGroup \with { \CenteredFiguredBass }&lt;br /&gt;
 &amp;lt;&amp;lt;&lt;br /&gt;
   \new Staff { ... }&lt;br /&gt;
   \new FiguredBass { ... }&lt;br /&gt;
 &amp;gt;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the rare case that you have multiple voices in the bass staff you might want to move the &amp;lt;code&amp;gt;Figured_bass_engraver&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;Voice&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lilypond version=&amp;quot;2.26&amp;quot;&amp;gt;&lt;br /&gt;
#(set-global-staff-size 26)&lt;br /&gt;
&lt;br /&gt;
#(define-public (c-format-bass-figure figure event context)&lt;br /&gt;
   (let* (;; User properties controlling the figured bass layout.&lt;br /&gt;
          (figbass-alist&lt;br /&gt;
           (ly:context-property context &#039;figuredBassPlusStrokedAlist))&lt;br /&gt;
          (alt-dir&lt;br /&gt;
           (ly:context-property context &#039;figuredBassAlterationDirection))&lt;br /&gt;
          (plus-dir&lt;br /&gt;
           (ly:context-property context &#039;figuredBassPlusDirection))&lt;br /&gt;
          (augmented (ly:event-property event &#039;augmented))&lt;br /&gt;
          (number-one (make-number-markup &amp;quot;1&amp;quot;))&lt;br /&gt;
&lt;br /&gt;
          ;; The digit(s), horizontally positioned, or #f.&lt;br /&gt;
          (fig-markup&lt;br /&gt;
           (if (number? figure)&lt;br /&gt;
               (make-center-align-markup&lt;br /&gt;
		(cond&lt;br /&gt;
                 ((eq? #t (ly:event-property event &#039;diminished))&lt;br /&gt;
                  (make-slashed-digit-markup figure))&lt;br /&gt;
                 ((eq? #t (ly:event-property event &#039;augmented-slash))&lt;br /&gt;
                  ;; Use specially stroked digit if available and wanted.&lt;br /&gt;
                     (or (and-let* (((&amp;lt;= 6 figure 9))&lt;br /&gt;
                                    (glyph (assv-ref figbass-alist figure)))&lt;br /&gt;
			   (make-musicglyph-markup glyph))&lt;br /&gt;
			 (make-backslashed-digit-markup figure)))&lt;br /&gt;
                 ((eq? #t augmented)&lt;br /&gt;
                  ;; Use special digit with plus if available and wanted.&lt;br /&gt;
                  (or (and-let* (((&amp;gt;= 5 figure 2))&lt;br /&gt;
                                 ((eqv? plus-dir RIGHT))&lt;br /&gt;
                                 (glyph (assv-ref figbass-alist figure)))&lt;br /&gt;
			(set! augmented #f)&lt;br /&gt;
			(make-musicglyph-markup glyph))&lt;br /&gt;
                      (make-number-markup (number-&amp;gt;string figure 10))))&lt;br /&gt;
                 (else (make-number-markup (number-&amp;gt;string figure 10)))))&lt;br /&gt;
               #f))&lt;br /&gt;
&lt;br /&gt;
          (alt (ly:event-property event &#039;alteration))&lt;br /&gt;
          (alt-bracket (ly:event-property event &#039;alteration-bracket #f))&lt;br /&gt;
          ;; The alteration, probably bracketed but not positioned yet,&lt;br /&gt;
          ;; or #f.&lt;br /&gt;
          (alt-markup&lt;br /&gt;
           (if (number? alt)&lt;br /&gt;
               (let* ((acc (assoc-get alt (@@ (lily) figbass-accidental-alist)))&lt;br /&gt;
                      (acc-markup&lt;br /&gt;
                       (if acc&lt;br /&gt;
                           (make-number-markup (ly:wide-char-&amp;gt;utf-8 acc))&lt;br /&gt;
                           (begin&lt;br /&gt;
                             (ly:warning&lt;br /&gt;
                              (G_ &amp;quot;no accidental glyph found for alteration ~a&amp;quot;)&lt;br /&gt;
                              alt)&lt;br /&gt;
                             ;; fallback&lt;br /&gt;
			     &amp;quot;?&amp;quot;))))&lt;br /&gt;
                 (if alt-bracket&lt;br /&gt;
                     (make-bracket-markup acc-markup)&lt;br /&gt;
                     acc-markup))&lt;br /&gt;
               #f))&lt;br /&gt;
&lt;br /&gt;
          (plus-markup (if (eq? #t augmented)&lt;br /&gt;
                           (make-number-markup &amp;quot;+&amp;quot;)&lt;br /&gt;
                           #f)))&lt;br /&gt;
&lt;br /&gt;
     (if (and (not alt-markup) alt-bracket)&lt;br /&gt;
         (ly:programming-error&lt;br /&gt;
          &amp;quot;Cannot put brackets around non-existent bass figure alteration.&amp;quot;))&lt;br /&gt;
&lt;br /&gt;
     ;; We treat a solitary alteration similarly to digits.&lt;br /&gt;
     (if (and (not fig-markup) alt-markup)&lt;br /&gt;
         (begin&lt;br /&gt;
           (set! fig-markup&lt;br /&gt;
                 (make-center-align-markup alt-markup))&lt;br /&gt;
           (set! alt-markup #f)))&lt;br /&gt;
&lt;br /&gt;
     ;; We treat a solitary plus similarly to digits (but enlarged).&lt;br /&gt;
     (if (and (not fig-markup) plus-markup)&lt;br /&gt;
         (begin&lt;br /&gt;
           (set! fig-markup&lt;br /&gt;
                 (make-align-on-other-markup&lt;br /&gt;
                  Y&lt;br /&gt;
                  CENTER number-one&lt;br /&gt;
                  CENTER&lt;br /&gt;
		  (make-center-align-markup&lt;br /&gt;
		   (make-fontsize-markup 3 plus-markup))))&lt;br /&gt;
           (set! plus-markup #f)))&lt;br /&gt;
&lt;br /&gt;
     ;; The alteration gets attached either to the left or the right of&lt;br /&gt;
     ;; the digit(s).&lt;br /&gt;
     (if alt-markup&lt;br /&gt;
         (set! fig-markup&lt;br /&gt;
               (make-put-adjacent-markup&lt;br /&gt;
		X (if (number? alt-dir)&lt;br /&gt;
                      alt-dir&lt;br /&gt;
                      LEFT)&lt;br /&gt;
		fig-markup&lt;br /&gt;
		(make-pad-x-markup 0.1 alt-markup))))&lt;br /&gt;
&lt;br /&gt;
     ;; Ditto for the plus mark.&lt;br /&gt;
     (if plus-markup&lt;br /&gt;
         (set! fig-markup&lt;br /&gt;
               (if fig-markup&lt;br /&gt;
                   (make-put-adjacent-markup&lt;br /&gt;
                    X (if (number? plus-dir)&lt;br /&gt;
                          plus-dir&lt;br /&gt;
                          LEFT)&lt;br /&gt;
                    fig-markup plus-markup)&lt;br /&gt;
                   plus-markup)))&lt;br /&gt;
&lt;br /&gt;
     (if (markup? fig-markup)&lt;br /&gt;
         (make-fontsize-markup -5 fig-markup)&lt;br /&gt;
         (make-null-markup))))&lt;br /&gt;
&lt;br /&gt;
#(define (figures-to-note-column-engraver context)&lt;br /&gt;
   (let ((figs &#039;()) (nc #f))&lt;br /&gt;
     (make-engraver&lt;br /&gt;
      (acknowledgers&lt;br /&gt;
       ((bass-figure-interface engraver grob source)&lt;br /&gt;
        (set! figs (cons grob figs)))&lt;br /&gt;
       ((note-column-interface engraver grob source)&lt;br /&gt;
        (set! nc grob)))&lt;br /&gt;
      ((process-acknowledged engraver)&lt;br /&gt;
       (if nc&lt;br /&gt;
           (for-each&lt;br /&gt;
            (lambda (g)&lt;br /&gt;
              (ly:grob-set-parent! g X nc))&lt;br /&gt;
            figs))&lt;br /&gt;
       (set! nc #f)&lt;br /&gt;
       (set! figs &#039;())))))&lt;br /&gt;
&lt;br /&gt;
CenteredFiguredBass = \with {&lt;br /&gt;
  \consists #figures-to-note-column-engraver&lt;br /&gt;
  \override BassFigure.X-align-on-main-noteheads = ##t&lt;br /&gt;
  \override BassFigure.parent-alignment-X = #CENTER&lt;br /&gt;
  \override BassFigure.X-offset =&lt;br /&gt;
    #ly:self-alignment-interface::aligned-on-x-parent&lt;br /&gt;
  figuredBassFormatter = #c-format-bass-figure&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
%%%%%%%%%%%%%%%%%%%%%%%%%%%&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
\new Staff \with { \CenteredFiguredBass }&lt;br /&gt;
&amp;lt;&amp;lt;&lt;br /&gt;
  { c&#039;1 4 8 8 }&lt;br /&gt;
  \figuremode {&lt;br /&gt;
    \override Staff.BassFigureAlignment.stacking-dir = #DOWN&lt;br /&gt;
    &amp;lt;15- 7+ 6/ 4\+ 3- _+ _\+&amp;gt;1 4 8 8&lt;br /&gt;
  }&lt;br /&gt;
&amp;gt;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
\new StaffGroup \with { \CenteredFiguredBass }&lt;br /&gt;
&amp;lt;&amp;lt;&lt;br /&gt;
  % To make the figured bass stuff appear in the source file&lt;br /&gt;
  % before the music we have to initialize the `Staff` context&lt;br /&gt;
  % first (and fill it later).&lt;br /&gt;
  \new Staff = &amp;quot;mystaff&amp;quot;&lt;br /&gt;
  \figuremode {&lt;br /&gt;
    \override Staff.BassFigureAlignment.stacking-dir = #UP&lt;br /&gt;
    % Work around issue #6552, fixing bracket positions.&lt;br /&gt;
    \override Staff.BassFigureAlignmentPositioning&lt;br /&gt;
                   .outside-staff-priority = ##f&lt;br /&gt;
    &amp;lt;3 [5 7]&amp;gt;8&lt;br /&gt;
      &amp;lt;3\+ [5/] 7/ [9 11]&amp;gt;&lt;br /&gt;
    &amp;lt;3+ 5- 7!&amp;gt;&lt;br /&gt;
      &amp;lt;3 _! 5 _- 7&amp;gt;&lt;br /&gt;
    &amp;lt;3 _\+ 5 _ 7&amp;gt;&lt;br /&gt;
      &amp;lt;3 6/ &amp;gt;&lt;br /&gt;
    &amp;lt;3 6\\ &amp;gt;&lt;br /&gt;
      &amp;lt;6&amp;gt; |&lt;br /&gt;
    &amp;lt;3 [5 7]&amp;gt;1&lt;br /&gt;
  }&lt;br /&gt;
  \context Staff = &amp;quot;mystaff&amp;quot; {&lt;br /&gt;
    \clef bass&lt;br /&gt;
    c4 c c&#039;8 c c16 c c c | c1&lt;br /&gt;
  }&lt;br /&gt;
&amp;gt;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
\new StaffGroup \with { \CenteredFiguredBass }&lt;br /&gt;
&amp;lt;&amp;lt;&lt;br /&gt;
  \new Staff = &amp;quot;mystaff&amp;quot; {&lt;br /&gt;
    \clef bass&lt;br /&gt;
    c4 c f,8 c c16 c c c | c1&lt;br /&gt;
  }&lt;br /&gt;
  \figuremode {&lt;br /&gt;
    \override Staff.BassFigureAlignment.stacking-dir = #UP&lt;br /&gt;
    \override Staff.BassFigureAlignmentPositioning.direction = #DOWN&lt;br /&gt;
    % Work around issue #6552, fixing bracket positions.&lt;br /&gt;
    \override Staff.BassFigureAlignmentPositioning&lt;br /&gt;
                   .outside-staff-priority = ##f&lt;br /&gt;
    &amp;lt;3 [5 7]&amp;gt;8&lt;br /&gt;
      &amp;lt;3\+ [5/] 7/ [9 11]&amp;gt;&lt;br /&gt;
    &amp;lt;3+ 5- 7!&amp;gt;&lt;br /&gt;
      &amp;lt;3 _! 5 _- 7&amp;gt;&lt;br /&gt;
    &amp;lt;3 _\+ 5 _ 7&amp;gt;&lt;br /&gt;
      &amp;lt;3 6/ &amp;gt;&lt;br /&gt;
    &amp;lt;3 6\\ &amp;gt;&lt;br /&gt;
      &amp;lt;6&amp;gt; |&lt;br /&gt;
    &amp;lt;3 [5 7]&amp;gt;1&lt;br /&gt;
  }&lt;br /&gt;
&amp;gt;&amp;gt;&lt;br /&gt;
&amp;lt;/lilypond&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Ancient notation]]&lt;br /&gt;
[[Category:Chords]]&lt;br /&gt;
[[Category:Workaround]]&lt;br /&gt;
[[Category:Snippet]]&lt;/div&gt;</summary>
		<author><name>Lemzwerg</name></author>
	</entry>
	<entry>
		<id>https://wiki.lilypond.community/index.php?title=Figured_bass_centered_horizontally_on_note_heads&amp;diff=6603</id>
		<title>Figured bass centered horizontally on note heads</title>
		<link rel="alternate" type="text/html" href="https://wiki.lilypond.community/index.php?title=Figured_bass_centered_horizontally_on_note_heads&amp;diff=6603"/>
		<updated>2026-07-12T19:14:20Z</updated>

		<summary type="html">&lt;p&gt;Lemzwerg: Created page with &amp;quot;Due to [https://gitlab.com/lilypond/lilypond/-/work_items/3172 LilyPond issue #3172], bass figures are currently not centered automatically on whole notes. Below you can find a solution (contributed by [https://lists.gnu.org/archive/html/lilypond-user/2026-06/msg00250.html Tina Petzel]) that works around this issue by  * providing a replacement function &amp;lt;code&amp;gt;c-format-bass-figure&amp;lt;/code&amp;gt; for the &amp;lt;code&amp;gt;figuredBassFormatter&amp;lt;/code&amp;gt; property to center the base digit, * creati...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Due to [https://gitlab.com/lilypond/lilypond/-/work_items/3172 LilyPond issue #3172], bass figures are currently not centered automatically on whole notes. Below you can find a solution (contributed by [https://lists.gnu.org/archive/html/lilypond-user/2026-06/msg00250.html Tina Petzel]) that works around this issue by&lt;br /&gt;
&lt;br /&gt;
* providing a replacement function &amp;lt;code&amp;gt;c-format-bass-figure&amp;lt;/code&amp;gt; for the &amp;lt;code&amp;gt;figuredBassFormatter&amp;lt;/code&amp;gt; property to center the base digit,&lt;br /&gt;
* creating a small engraver called &amp;lt;code&amp;gt;figures-to-note-column-engraver&amp;lt;/code&amp;gt; that changes the X&amp;amp;nbsp;parent of bass figures to &amp;lt;code&amp;gt;NoteColumn&amp;lt;/code&amp;gt; grobs, and&lt;br /&gt;
* setting some bass figure properties to center-align them with main note heads.&lt;br /&gt;
&lt;br /&gt;
A convenience macro &amp;lt;code&amp;gt;\CenteredFiguredBass&amp;lt;/code&amp;gt; is defined to do these tasks.&lt;br /&gt;
&lt;br /&gt;
There are limitations, though.  It is necessary that &amp;lt;code&amp;gt;figures-to-note-column-engraver&amp;lt;/code&amp;gt; lives in a context that is an ancestor of both &amp;lt;code&amp;gt;Rhythmic_column_engraver&amp;lt;/code&amp;gt; (typically part of &amp;lt;code&amp;gt;Voice&amp;lt;/code&amp;gt;) and &amp;lt;code&amp;gt;Figured_bass_engraver&amp;lt;/code&amp;gt;.  Examples:&lt;br /&gt;
&lt;br /&gt;
 \new Staff \with { \CenteredFiguredBass }&lt;br /&gt;
 &amp;lt;&amp;lt;&lt;br /&gt;
   { bass music }&lt;br /&gt;
   \figuremode { figured bass }&lt;br /&gt;
 &amp;gt;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 \new StaffGroup \with { \CenteredFiguredBass }&lt;br /&gt;
 &amp;lt;&amp;lt;&lt;br /&gt;
   \new Staff { ... }&lt;br /&gt;
   \new FiguredBass { ... }&lt;br /&gt;
 &amp;gt;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the rare case that you have multiple voices in the bass staff you might want to move the &amp;lt;code&amp;gt;Figured_bass_engraver&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;Voice&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lilypond version=&amp;quot;2.26&amp;quot;&amp;gt;&lt;br /&gt;
#(set-global-staff-size 26)&lt;br /&gt;
&lt;br /&gt;
#(define-public (c-format-bass-figure figure event context)&lt;br /&gt;
   (let* (;; User properties controlling the figured bass layout.&lt;br /&gt;
          (figbass-alist&lt;br /&gt;
           (ly:context-property context &#039;figuredBassPlusStrokedAlist))&lt;br /&gt;
          (alt-dir&lt;br /&gt;
           (ly:context-property context &#039;figuredBassAlterationDirection))&lt;br /&gt;
          (plus-dir&lt;br /&gt;
           (ly:context-property context &#039;figuredBassPlusDirection))&lt;br /&gt;
          (augmented (ly:event-property event &#039;augmented))&lt;br /&gt;
          (number-one (make-number-markup &amp;quot;1&amp;quot;))&lt;br /&gt;
&lt;br /&gt;
          ;; The digit(s), horizontally positioned, or #f.&lt;br /&gt;
          (fig-markup&lt;br /&gt;
           (if (number? figure)&lt;br /&gt;
               (make-center-align-markup&lt;br /&gt;
		(cond&lt;br /&gt;
                 ((eq? #t (ly:event-property event &#039;diminished))&lt;br /&gt;
                  (make-slashed-digit-markup figure))&lt;br /&gt;
                 ((eq? #t (ly:event-property event &#039;augmented-slash))&lt;br /&gt;
                  ;; Use specially stroked digit if available and wanted.&lt;br /&gt;
                     (or (and-let* (((&amp;lt;= 6 figure 9))&lt;br /&gt;
                                    (glyph (assv-ref figbass-alist figure)))&lt;br /&gt;
			   (make-musicglyph-markup glyph))&lt;br /&gt;
			 (make-backslashed-digit-markup figure)))&lt;br /&gt;
                 ((eq? #t augmented)&lt;br /&gt;
                  ;; Use special digit with plus if available and wanted.&lt;br /&gt;
                  (or (and-let* (((&amp;gt;= 5 figure 2))&lt;br /&gt;
                                 ((eqv? plus-dir RIGHT))&lt;br /&gt;
                                 (glyph (assv-ref figbass-alist figure)))&lt;br /&gt;
			(set! augmented #f)&lt;br /&gt;
			(make-musicglyph-markup glyph))&lt;br /&gt;
                      (make-number-markup (number-&amp;gt;string figure 10))))&lt;br /&gt;
                 (else (make-number-markup (number-&amp;gt;string figure 10)))))&lt;br /&gt;
               #f))&lt;br /&gt;
&lt;br /&gt;
          (alt (ly:event-property event &#039;alteration))&lt;br /&gt;
          (alt-bracket (ly:event-property event &#039;alteration-bracket #f))&lt;br /&gt;
          ;; The alteration, probably bracketed but not positioned yet,&lt;br /&gt;
          ;; or #f.&lt;br /&gt;
          (alt-markup&lt;br /&gt;
           (if (number? alt)&lt;br /&gt;
               (let* ((acc (assoc-get alt (@@ (lily) figbass-accidental-alist)))&lt;br /&gt;
                      (acc-markup&lt;br /&gt;
                       (if acc&lt;br /&gt;
                           (make-number-markup (ly:wide-char-&amp;gt;utf-8 acc))&lt;br /&gt;
                           (begin&lt;br /&gt;
                             (ly:warning&lt;br /&gt;
                              (G_ &amp;quot;no accidental glyph found for alteration ~a&amp;quot;)&lt;br /&gt;
                              alt)&lt;br /&gt;
                             ;; fallback&lt;br /&gt;
			     &amp;quot;?&amp;quot;))))&lt;br /&gt;
                 (if alt-bracket&lt;br /&gt;
                     (make-bracket-markup acc-markup)&lt;br /&gt;
                     acc-markup))&lt;br /&gt;
               #f))&lt;br /&gt;
&lt;br /&gt;
          (plus-markup (if (eq? #t augmented)&lt;br /&gt;
                           (make-number-markup &amp;quot;+&amp;quot;)&lt;br /&gt;
                           #f)))&lt;br /&gt;
&lt;br /&gt;
     (if (and (not alt-markup) alt-bracket)&lt;br /&gt;
         (ly:programming-error&lt;br /&gt;
          &amp;quot;Cannot put brackets around non-existent bass figure alteration.&amp;quot;))&lt;br /&gt;
&lt;br /&gt;
     ;; We treat a solitary alteration similarly to digits.&lt;br /&gt;
     (if (and (not fig-markup) alt-markup)&lt;br /&gt;
         (begin&lt;br /&gt;
           (set! fig-markup&lt;br /&gt;
                 (make-center-align-markup alt-markup))&lt;br /&gt;
           (set! alt-markup #f)))&lt;br /&gt;
&lt;br /&gt;
     ;; We treat a solitary plus similarly to digits (but enlarged).&lt;br /&gt;
     (if (and (not fig-markup) plus-markup)&lt;br /&gt;
         (begin&lt;br /&gt;
           (set! fig-markup&lt;br /&gt;
                 (make-align-on-other-markup&lt;br /&gt;
                  Y&lt;br /&gt;
                  CENTER number-one&lt;br /&gt;
                  CENTER&lt;br /&gt;
		  (make-center-align-markup&lt;br /&gt;
		   (make-fontsize-markup 3 plus-markup))))&lt;br /&gt;
           (set! plus-markup #f)))&lt;br /&gt;
&lt;br /&gt;
     ;; The alteration gets attached either to the left or the right of&lt;br /&gt;
     ;; the digit(s).&lt;br /&gt;
     (if alt-markup&lt;br /&gt;
         (set! fig-markup&lt;br /&gt;
               (make-put-adjacent-markup&lt;br /&gt;
		X (if (number? alt-dir)&lt;br /&gt;
                      alt-dir&lt;br /&gt;
                      LEFT)&lt;br /&gt;
		fig-markup&lt;br /&gt;
		(make-pad-x-markup 0.1 alt-markup))))&lt;br /&gt;
&lt;br /&gt;
     ;; Ditto for the plus mark.&lt;br /&gt;
     (if plus-markup&lt;br /&gt;
         (set! fig-markup&lt;br /&gt;
               (if fig-markup&lt;br /&gt;
                   (make-put-adjacent-markup&lt;br /&gt;
                    X (if (number? plus-dir)&lt;br /&gt;
                          plus-dir&lt;br /&gt;
                          LEFT)&lt;br /&gt;
                    fig-markup plus-markup)&lt;br /&gt;
                   plus-markup)))&lt;br /&gt;
&lt;br /&gt;
     (if (markup? fig-markup)&lt;br /&gt;
         (make-fontsize-markup -5 fig-markup)&lt;br /&gt;
         (make-null-markup))))&lt;br /&gt;
&lt;br /&gt;
#(define (figures-to-note-column-engraver context)&lt;br /&gt;
   (let ((figs &#039;()) (nc #f))&lt;br /&gt;
     (make-engraver&lt;br /&gt;
      (acknowledgers&lt;br /&gt;
       ((bass-figure-interface engraver grob source)&lt;br /&gt;
        (set! figs (cons grob figs)))&lt;br /&gt;
       ((note-column-interface engraver grob source)&lt;br /&gt;
        (set! nc grob)))&lt;br /&gt;
      ((process-acknowledged engraver)&lt;br /&gt;
       (if nc&lt;br /&gt;
           (for-each&lt;br /&gt;
            (lambda (g)&lt;br /&gt;
              (ly:grob-set-parent! g X nc))&lt;br /&gt;
            figs))&lt;br /&gt;
       (set! nc #f)&lt;br /&gt;
       (set! figs &#039;())))))&lt;br /&gt;
&lt;br /&gt;
CenteredFiguredBass = \with {&lt;br /&gt;
  \consists #figures-to-note-column-engraver&lt;br /&gt;
  \override BassFigure.X-align-on-main-noteheads = ##t&lt;br /&gt;
  \override BassFigure.parent-alignment-X = #CENTER&lt;br /&gt;
  \override BassFigure.X-offset =&lt;br /&gt;
    #ly:self-alignment-interface::aligned-on-x-parent&lt;br /&gt;
  figuredBassFormatter = #c-format-bass-figure&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
%%%%%%%%%%%%%%%%%%%%%%%%%%%&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
\new Staff \with { \CenteredFiguredBass }&lt;br /&gt;
&amp;lt;&amp;lt;&lt;br /&gt;
  { c&#039;1 4 8 8 }&lt;br /&gt;
  \figuremode {&lt;br /&gt;
    \override Staff.BassFigureAlignment.stacking-dir = #DOWN&lt;br /&gt;
    &amp;lt;15- 7+ 6/ 4\+ 3- _+ _\+&amp;gt;1 4 8 8&lt;br /&gt;
  }&lt;br /&gt;
&amp;gt;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
\new StaffGroup \with { \CenteredFiguredBass }&lt;br /&gt;
&amp;lt;&amp;lt;&lt;br /&gt;
  % To make the figured bass stuff appear in the source file&lt;br /&gt;
  % before the music we have to initialize the `Staff` context&lt;br /&gt;
  % first (and fill it later).&lt;br /&gt;
  \new Staff = &amp;quot;mystaff&amp;quot;&lt;br /&gt;
  \figuremode {&lt;br /&gt;
    \override Staff.BassFigureAlignment.stacking-dir = #UP&lt;br /&gt;
    % Work around issue #6552, fixing bracket positions.&lt;br /&gt;
    \override Staff.BassFigureAlignmentPositioning&lt;br /&gt;
                   .outside-staff-priority = ##f&lt;br /&gt;
    &amp;lt;3 [5 7]&amp;gt;8&lt;br /&gt;
      &amp;lt;3\+ [5/] 7/ [9 11]&amp;gt;&lt;br /&gt;
    &amp;lt;3+ 5- 7!&amp;gt;&lt;br /&gt;
      &amp;lt;3 _! 5 _- 7&amp;gt;&lt;br /&gt;
    &amp;lt;3 _\+ 5 _ 7&amp;gt;&lt;br /&gt;
      &amp;lt;3 6/ &amp;gt;&lt;br /&gt;
    &amp;lt;3 6\\ &amp;gt;&lt;br /&gt;
      &amp;lt;6&amp;gt; |&lt;br /&gt;
    &amp;lt;3 [5 7]&amp;gt;1&lt;br /&gt;
  }&lt;br /&gt;
  \context Staff = &amp;quot;mystaff&amp;quot; {&lt;br /&gt;
    \clef bass&lt;br /&gt;
    c4 c c&#039;8 c c16 c c c | c1&lt;br /&gt;
  }&lt;br /&gt;
&amp;gt;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
\new StaffGroup \with { \CenteredFiguredBass }&lt;br /&gt;
&amp;lt;&amp;lt;&lt;br /&gt;
  \new Staff = &amp;quot;mystaff&amp;quot; {&lt;br /&gt;
    \clef bass&lt;br /&gt;
    c4 c f,8 c c16 c c c | c1&lt;br /&gt;
  }&lt;br /&gt;
  \figuremode {&lt;br /&gt;
    \override Staff.BassFigureAlignment.stacking-dir = #UP&lt;br /&gt;
    \override Staff.BassFigureAlignmentPositioning.direction = #DOWN&lt;br /&gt;
    % Work around issue #6552, fixing bracket positions.&lt;br /&gt;
    \override Staff.BassFigureAlignmentPositioning&lt;br /&gt;
                   .outside-staff-priority = ##f&lt;br /&gt;
    &amp;lt;3 [5 7]&amp;gt;8&lt;br /&gt;
      &amp;lt;3\+ [5/] 7/ [9 11]&amp;gt;&lt;br /&gt;
    &amp;lt;3+ 5- 7!&amp;gt;&lt;br /&gt;
      &amp;lt;3 _! 5 _- 7&amp;gt;&lt;br /&gt;
    &amp;lt;3 _\+ 5 _ 7&amp;gt;&lt;br /&gt;
      &amp;lt;3 6/ &amp;gt;&lt;br /&gt;
    &amp;lt;3 6\\ &amp;gt;&lt;br /&gt;
      &amp;lt;6&amp;gt; |&lt;br /&gt;
    &amp;lt;3 [5 7]&amp;gt;1&lt;br /&gt;
  }&lt;br /&gt;
&amp;gt;&amp;gt;&lt;br /&gt;
&amp;lt;/lilypond&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Ancient notation]]&lt;br /&gt;
[[Category:Chords]]&lt;br /&gt;
[[Category:Workaround]]&lt;br /&gt;
[[Category:Snippet]]&lt;/div&gt;</summary>
		<author><name>Lemzwerg</name></author>
	</entry>
	<entry>
		<id>https://wiki.lilypond.community/index.php?title=Basic_Roman_numeral_and_figured_bass_analysis&amp;diff=6602</id>
		<title>Basic Roman numeral and figured bass analysis</title>
		<link rel="alternate" type="text/html" href="https://wiki.lilypond.community/index.php?title=Basic_Roman_numeral_and_figured_bass_analysis&amp;diff=6602"/>
		<updated>2026-07-12T11:58:18Z</updated>

		<summary type="html">&lt;p&gt;Lemzwerg: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;If you need to create some basic roman numeral and figured bass analysis within the body of a score, you can create a staff with the standard engravers removed and add markup to spaces.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lilypond version=&amp;quot;2.24&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;&amp;lt;&lt;br /&gt;
  \new Staff \relative c&#039; {&lt;br /&gt;
    &amp;lt;c e g&amp;gt;2 &amp;lt;c f a&amp;gt; | &amp;lt;c e g&amp;gt; &amp;lt;b d g&amp;gt; | &amp;lt;c e g&amp;gt;1 |&lt;br /&gt;
  }&lt;br /&gt;
  &lt;br /&gt;
  \new Staff \with {&lt;br /&gt;
      \remove &amp;quot;Staff_symbol_engraver&amp;quot;&lt;br /&gt;
      \remove &amp;quot;Time_signature_engraver&amp;quot;&lt;br /&gt;
      \remove &amp;quot;Clef_engraver&amp;quot;&lt;br /&gt;
    } {&lt;br /&gt;
      s2^\markup { \halign #2 C: I }&lt;br /&gt;
      s^\markup { \super \column { 6 \vspace #-0.4 4 } } |&lt;br /&gt;
      s^\markup { \super \column { 5 \vspace #-0.4 3 } }&lt;br /&gt;
      s^\markup { \lower #1 &amp;quot;V&amp;quot; \super \column { 6 \vspace #-0.5 3 } } |&lt;br /&gt;
      s1^\markup &amp;quot;I&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
&amp;gt;&amp;gt;&lt;br /&gt;
&amp;lt;/lilypond&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Text]]&lt;br /&gt;
[[Category:Specific notation]]&lt;br /&gt;
[[Category:Chords]]&lt;br /&gt;
[[Category:Snippet]]&lt;/div&gt;</summary>
		<author><name>Lemzwerg</name></author>
	</entry>
	<entry>
		<id>https://wiki.lilypond.community/index.php?title=Figured_bass_with_alternate_baroque_notation&amp;diff=6601</id>
		<title>Figured bass with alternate baroque notation</title>
		<link rel="alternate" type="text/html" href="https://wiki.lilypond.community/index.php?title=Figured_bass_with_alternate_baroque_notation&amp;diff=6601"/>
		<updated>2026-07-12T11:51:39Z</updated>

		<summary type="html">&lt;p&gt;Lemzwerg: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Most renaissance and baroque scores use specific symbols for bass figures, particularly for augmented sixths with a backslash striking only the upper part of the number six (or sometimes the number nine), and “plus” symbols integrated with the number four (and sometimes the numbers two or five as well; this notation may also be used for integrating flat and natural accidentals).&lt;br /&gt;
&lt;br /&gt;
Here is a way to obtain such symbols in the printed output whilst keeping the usual syntax for figured bass entry. This is done not with native MetaFont glyphs, but by combining PostScript code (using Scheme syntax so that SVG output is supported) and additional stencils in markup definitions.&lt;br /&gt;
&lt;br /&gt;
Note that LilyPond version 2.24 natively supports the first five symbols (i.e., the ones with an added slash); see snippet [[Adjusting figured bass alteration glyphs]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lilypond version=&amp;quot;2.24&amp;quot;&amp;gt;&lt;br /&gt;
%% Glyph definitions:&lt;br /&gt;
&lt;br /&gt;
openedSix = \markup&lt;br /&gt;
\scale #&#039;(.0045 . .0045)&lt;br /&gt;
\override #&#039;(filled . #t) \path #0&lt;br /&gt;
#&#039;(&lt;br /&gt;
    (moveto 117.5 192)&lt;br /&gt;
    (curveto 82.25 192 80 164.25 80 126)&lt;br /&gt;
    (lineto 80 85.5)&lt;br /&gt;
    (curveto 80 47.25 82.25 19.5 117.5 19.5)&lt;br /&gt;
    (curveto 159.5 19.5 161 57 161 105.75)&lt;br /&gt;
    (curveto 161 154.5 159.5 192 117.5 192)&lt;br /&gt;
    (closepath)&lt;br /&gt;
    (moveto 80 201.75)&lt;br /&gt;
    (curveto 92 207 104 211.5 117.5 211.5)&lt;br /&gt;
    (curveto 194.75 211.5 247.25 177.75 247.25 105.75)&lt;br /&gt;
    (curveto 247.25 33.75 194.75 0 117.5 0)&lt;br /&gt;
    (curveto 75.125 0 42.688 23.25 20.844 58.312)&lt;br /&gt;
    (curveto -16.164 111.789 -2.754 186.469 52.051 249.164)&lt;br /&gt;
    (curveto 79.453 280.512 117.207 308.863 164.184 330.07)&lt;br /&gt;
    (curveto 211.156 351.281 266.695 381.359 285.328 352.68)&lt;br /&gt;
    (curveto 225.148 344.094 166.652 307.07 129.25 276.117)&lt;br /&gt;
    (curveto 91.852 245.164 79.973 217.148 80 201.75)&lt;br /&gt;
    (closepath))&lt;br /&gt;
&lt;br /&gt;
elongatedTwo = \markup \combine&lt;br /&gt;
\scale #&#039;(.0045 . .0045)&lt;br /&gt;
\override #&#039;(filled . #t) \path #0&lt;br /&gt;
#&#039;(&lt;br /&gt;
    (moveto 19.5 6.879)&lt;br /&gt;
    (curveto 19.5 6.879 4.566 -11.469 0 10.5)&lt;br /&gt;
    (curveto 13.371 124.34 175.5 132.75 175.5 266.25)&lt;br /&gt;
    (curveto 175.5 309.75 163.5 355.5 126 355.5)&lt;br /&gt;
    (curveto 105 355.5 84.75 345.75 84.75 327)&lt;br /&gt;
    (curveto 84.75 306.75 111 297 111 276.75)&lt;br /&gt;
    (curveto 111 249 87.75 226.5 60 226.5)&lt;br /&gt;
    (curveto 32.25 226.5 9.75 249 9.75 276.75)&lt;br /&gt;
    (curveto 9.75 334.5 64.5 375 126 375)&lt;br /&gt;
    (curveto 198.75 375 269.289 332.98 267.75 266.25)&lt;br /&gt;
    (curveto 265.629 174.344 163.785 139.562 93.676 91.652)&lt;br /&gt;
    (curveto 55.66 65.676 19.5 6.879 19.5 6.879)&lt;br /&gt;
    (closepath))&lt;br /&gt;
\translate #&#039;(.12 . 0) \override #&#039;(thickness . 2.2) \draw-line #&#039;(1.6 . 0)&lt;br /&gt;
&lt;br /&gt;
elongatedFive = \markup  \combine&lt;br /&gt;
\scale #&#039;(.0045 . .0045)&lt;br /&gt;
\override #&#039;(filled . #t) \path #0&lt;br /&gt;
#&#039;(&lt;br /&gt;
    (moveto 48 361.164)&lt;br /&gt;
    (lineto 48 210.75)&lt;br /&gt;
    (curveto 69 231.75 97.5 240.75 126.75 240.75)&lt;br /&gt;
    (curveto 213.75 240.75 267 202.5 267 120)&lt;br /&gt;
    (curveto 267 48.75 198 0 122.25 0)&lt;br /&gt;
    (curveto 60 0 0 31.5 0 87)&lt;br /&gt;
    (curveto 0 113.25 21.75 135 48 135)&lt;br /&gt;
    (curveto 74.25 135 96 113.25 96 87)&lt;br /&gt;
    (curveto 96 69 66.75 65.25 66.75 47.25)&lt;br /&gt;
    (curveto 66.75 24 95.25 19.5 122.25 19.5)&lt;br /&gt;
    (curveto 164.25 19.5 175.5 71.25 175.5 120)&lt;br /&gt;
    (curveto 175.5 165.75 166.5 216.75 126.75 216.75)&lt;br /&gt;
    (curveto 95.25 216.75 63.75 210 45.75 185.25)&lt;br /&gt;
    (curveto 43.5 181.5 39.75 180 36 180)&lt;br /&gt;
    (curveto 30 180 23.25 184.5 23.25 192)&lt;br /&gt;
    (lineto 23.25 361.5)&lt;br /&gt;
    (curveto 23.25 374.117 47.941 375.473 48 361.164)&lt;br /&gt;
    (closepath))&lt;br /&gt;
\translate #&#039;(.22 . 1.58) \override #&#039;(thickness . 2) \draw-line #&#039;(1.6 . 0)&lt;br /&gt;
&lt;br /&gt;
%% Some notations defined as markup/glyph combinations:&lt;br /&gt;
&lt;br /&gt;
plusTwo = \markup \combine \elongatedTwo&lt;br /&gt;
\translate #&#039;(1.35 . .35) \override #&#039;(thickness . 1.8) \draw-line #&#039;(0 . -.7)&lt;br /&gt;
&lt;br /&gt;
dimTwo = \markup \combine \elongatedTwo&lt;br /&gt;
\translate #&#039;(1.3 . -.8) \scale #&#039;(.7 . .7) \flat&lt;br /&gt;
&lt;br /&gt;
natTwo = \markup \combine \combine \elongatedTwo&lt;br /&gt;
\translate #&#039;(1.34 . .35) \override #&#039;(thickness . 1.4) \draw-line #&#039;(0 . -1.75)&lt;br /&gt;
\translate #&#039;(1.3 . -.9) \scale #&#039;(.7 . .7) \natural&lt;br /&gt;
&lt;br /&gt;
elongatedFour = \markup \combine&lt;br /&gt;
\scale #&#039;(.8 . .8) \number 4&lt;br /&gt;
\translate #&#039;(.08 . .48) \override #&#039;(thickness . 1.8) \draw-line #&#039;(2 . 0)&lt;br /&gt;
&lt;br /&gt;
plusFour = \markup \combine \elongatedFour&lt;br /&gt;
\translate #&#039;(1.7 . .84) \override #&#039;(thickness . 1.8) \draw-line #&#039;(0 . -.7)&lt;br /&gt;
&lt;br /&gt;
dimFour = \markup \combine \elongatedFour&lt;br /&gt;
\translate #&#039;(1.7 . -.4) \scale #&#039;(.7 . .7) \flat&lt;br /&gt;
&lt;br /&gt;
natFour = \markup \combine \combine \elongatedFour&lt;br /&gt;
\translate #&#039;(1.73 . .84) \override #&#039;(thickness . 1.4) \draw-line #&#039;(0 . -1.75)&lt;br /&gt;
\translate #&#039;(1.7 . -.4) \scale #&#039;(.7 . .7) \natural&lt;br /&gt;
&lt;br /&gt;
plusFive = \markup \combine \elongatedFive&lt;br /&gt;
\translate #&#039;(1.45 . 1.94) \override #&#039;(thickness . 1.8) \draw-line #&#039;(0 . -.7)&lt;br /&gt;
&lt;br /&gt;
dimFive = \markup \combine \elongatedFive&lt;br /&gt;
\translate #&#039;(1.4 . .9) \scale #&#039;(.6 . .6) \flat&lt;br /&gt;
&lt;br /&gt;
natFive = \markup \combine \combine \elongatedFive&lt;br /&gt;
\translate #&#039;(1.43 . 1.94) \override #&#039;(thickness . 1.4) \draw-line #&#039;(0 . -1.55)&lt;br /&gt;
\translate #&#039;(1.4 . .8) \scale #&#039;(.6 . .6) \natural&lt;br /&gt;
&lt;br /&gt;
slashedSix = \markup \combine \openedSix&lt;br /&gt;
\translate #&#039;(.5 . 1.6) \override #&#039;(thickness . 1.2) \draw-line #&#039;(.8 . -0.35)&lt;br /&gt;
&lt;br /&gt;
elongatedSix = \markup \combine \openedSix&lt;br /&gt;
\translate #&#039;(1.1 . 1.6) \override #&#039;(thickness . .8) \draw-line #&#039;(.6 . .13)&lt;br /&gt;
&lt;br /&gt;
dimSix = \markup \combine \elongatedSix&lt;br /&gt;
\translate #&#039;(1.4 . .9) \scale #&#039;(.6 . .6) \flat&lt;br /&gt;
&lt;br /&gt;
natSix = \markup \combine \combine \elongatedSix&lt;br /&gt;
\translate #&#039;(1.42 . 2.1) \override #&#039;(thickness . 1.4) \draw-line #&#039;(0 . -1.6)&lt;br /&gt;
\translate #&#039;(1.4 . .9) \scale #&#039;(.6 . .6) \natural&lt;br /&gt;
&lt;br /&gt;
slashedNine = \markup \rotate #180 \slashedSix&lt;br /&gt;
&lt;br /&gt;
%% Formatter function:&lt;br /&gt;
&lt;br /&gt;
#(define-public (vv-format-bass-figure figure event context)&lt;br /&gt;
   (let ((fig (ly:event-property event &#039;figure))&lt;br /&gt;
         (slash (eq? #t (ly:event-property event &#039;augmented-slash)))&lt;br /&gt;
         (aug (eq? #t (ly:event-property event &#039;augmented)))&lt;br /&gt;
         (alt (ly:event-property event &#039;alteration)))&lt;br /&gt;
     (cond&lt;br /&gt;
      (slash (case figure&lt;br /&gt;
               ((6) slashedSix)&lt;br /&gt;
               ((9) slashedNine)&lt;br /&gt;
               (else (format-bass-figure figure event context))))&lt;br /&gt;
      ; limitation: numbers that are both slashed _and_ augmented&lt;br /&gt;
      ; will be disregarded. (From a musical point of view,&lt;br /&gt;
      ; this shouldn’t be much of a problem.)&lt;br /&gt;
      ((and aug&lt;br /&gt;
            (eq? (ly:context-property context &#039;figuredBassPlusDirection)&lt;br /&gt;
                 RIGHT))&lt;br /&gt;
       (case figure&lt;br /&gt;
         ((2) plusTwo)&lt;br /&gt;
         ((4) plusFour)&lt;br /&gt;
         ((5) plusFive)&lt;br /&gt;
         (else (format-bass-figure figure event context))))&lt;br /&gt;
      ; This could be made optional.&lt;br /&gt;
      ((and (not (null? alt))&lt;br /&gt;
            (eq? (ly:context-property context &#039;figuredBassAlterationDirection) &lt;br /&gt;
                 RIGHT))&lt;br /&gt;
       (cond&lt;br /&gt;
        ((= alt FLAT)&lt;br /&gt;
         (case figure&lt;br /&gt;
           ((2) dimTwo)&lt;br /&gt;
           ((4) dimFour)&lt;br /&gt;
           ((5) dimFive)&lt;br /&gt;
           ((6) dimSix)&lt;br /&gt;
           (else (format-bass-figure figure event context))))&lt;br /&gt;
        ((= alt NATURAL)&lt;br /&gt;
         (case figure&lt;br /&gt;
           ((2) natTwo)&lt;br /&gt;
           ((4) natFour)&lt;br /&gt;
           ((5) natFive)&lt;br /&gt;
           ((6) natSix)&lt;br /&gt;
           (else (format-bass-figure figure event context))))&lt;br /&gt;
        (else (format-bass-figure figure event context))))&lt;br /&gt;
      ; anything that is not explicitely being looked for&lt;br /&gt;
      ; will be handled by the default existing formatter.&lt;br /&gt;
      (else (format-bass-figure figure event context)))))&lt;br /&gt;
&lt;br /&gt;
%% Inclusion of the new formatter:&lt;br /&gt;
&lt;br /&gt;
\layout {&lt;br /&gt;
  \context {&lt;br /&gt;
    \Score&lt;br /&gt;
    figuredBassFormatter = #vv-format-bass-figure&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
%% A simple example:&lt;br /&gt;
&lt;br /&gt;
\figures {&lt;br /&gt;
  &amp;lt;6\\&amp;gt; &amp;lt;9\\&amp;gt;&lt;br /&gt;
  % Modified glyphs are used only when&lt;br /&gt;
  % plus signs are printed on the right.&lt;br /&gt;
  \set figuredBassPlusDirection = #RIGHT&lt;br /&gt;
  &amp;lt;2\+&amp;gt; &amp;lt;4\+&amp;gt; &amp;lt;5\+&amp;gt;&lt;br /&gt;
  \set figuredBassAlterationDirection = #RIGHT&lt;br /&gt;
  &amp;lt;2-&amp;gt; &amp;lt;4-&amp;gt; &amp;lt;5-&amp;gt; &amp;lt;6-&amp;gt;&lt;br /&gt;
  &amp;lt;2!&amp;gt; &amp;lt;4!&amp;gt; &amp;lt;5!&amp;gt; &amp;lt;6!&amp;gt;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lilypond&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Ancient notation]]&lt;br /&gt;
[[Category:Chords]]&lt;br /&gt;
[[Category:Ancient notation]]&lt;br /&gt;
[[Category:Workaround]]&lt;br /&gt;
[[Category:Symbols and glyphs]]&lt;br /&gt;
[[Category:Snippet]]&lt;/div&gt;</summary>
		<author><name>Lemzwerg</name></author>
	</entry>
	<entry>
		<id>https://wiki.lilypond.community/index.php?title=Colored_arrows_(2)&amp;diff=6598</id>
		<title>Colored arrows (2)</title>
		<link rel="alternate" type="text/html" href="https://wiki.lilypond.community/index.php?title=Colored_arrows_(2)&amp;diff=6598"/>
		<updated>2026-07-09T04:54:32Z</updated>

		<summary type="html">&lt;p&gt;Lemzwerg: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This snippet demonstrates drawing colored arrows in a score, e.g., for analysis purposes. These arrows adapt to layout changes, because they are made of spanners between (invisible) note heads. If you need arrows with a fixed length and angle, you might prefer the snippet [[Colored arrows]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lilypond version=&amp;quot;2.24&amp;quot;&amp;gt;&lt;br /&gt;
forwardArrow =&lt;br /&gt;
#(define-music-function (color) (color?)&lt;br /&gt;
   #{&lt;br /&gt;
     % Cross-staff arrows are made using the VoiceFollower.  To have&lt;br /&gt;
     % the arrow behind the staff, choose a value below 0 for the&lt;br /&gt;
     % layer.  If you want the arrows to cover the notes, choose a&lt;br /&gt;
     % value of 2 or more.&lt;br /&gt;
     \once \override VoiceFollower.layer = -5&lt;br /&gt;
&lt;br /&gt;
     \once \override VoiceFollower.thickness = 5   % line thickness&lt;br /&gt;
     \once \override VoiceFollower.color = #color&lt;br /&gt;
&lt;br /&gt;
     % Padding can be adjusted to move arrow ends closer to the&lt;br /&gt;
     % notes.&lt;br /&gt;
     \once \override VoiceFollower.bound-details.left.padding = 2&lt;br /&gt;
     \once \override VoiceFollower.bound-details.right.padding = 2&lt;br /&gt;
&lt;br /&gt;
     \once \override VoiceFollower.bound-details.right.arrow = ##t&lt;br /&gt;
     \once \override VoiceFollower.arrow-width = 1&lt;br /&gt;
     \once \override VoiceFollower.arrow-length = 2&lt;br /&gt;
     % ##f prevents line breaks within an arrow.&lt;br /&gt;
     \once \override VoiceFollower.breakable = ##t&lt;br /&gt;
&lt;br /&gt;
     % Arrows within the same staff use the Glissando spanner, so&lt;br /&gt;
     % we repeat setting the above properties for this grob.&lt;br /&gt;
     \once \override Glissando.layer = -5&lt;br /&gt;
     \once \override Glissando.thickness = 5&lt;br /&gt;
     \once \override Glissando.color = #color&lt;br /&gt;
     \once \override Glissando.bound-details.left.padding = 2&lt;br /&gt;
     \once \override Glissando.bound-details.right.padding = 2&lt;br /&gt;
     \once \override Glissando.bound-details.right.arrow = ##t&lt;br /&gt;
     \once \override Glissando.arrow-width = 1&lt;br /&gt;
     \once \override Glissando.arrow-length = 2&lt;br /&gt;
     \once \override Glissando.breakable = ##t&lt;br /&gt;
   #})&lt;br /&gt;
&lt;br /&gt;
backwardArrow =&lt;br /&gt;
#(define-music-function (color) (color?)&lt;br /&gt;
   #{&lt;br /&gt;
     \once \override VoiceFollower.layer = -5&lt;br /&gt;
     \once \override VoiceFollower.thickness = 5&lt;br /&gt;
     \once \override VoiceFollower.color = #color&lt;br /&gt;
     \once \override VoiceFollower.bound-details.left.padding = 2&lt;br /&gt;
     \once \override VoiceFollower.bound-details.right.padding = 2&lt;br /&gt;
     \once \override VoiceFollower.bound-details.left.arrow = ##t&lt;br /&gt;
     \once \override VoiceFollower.arrow-width = 1&lt;br /&gt;
     \once \override VoiceFollower.arrow-length = 2&lt;br /&gt;
     \once \override VoiceFollower.breakable = ##t&lt;br /&gt;
&lt;br /&gt;
     \once \override Glissando.layer = -5&lt;br /&gt;
     \once \override Glissando.thickness = 5&lt;br /&gt;
     \once \override Glissando.color = #color&lt;br /&gt;
     \once \override Glissando.bound-details.left.padding = 2&lt;br /&gt;
     \once \override Glissando.bound-details.right.padding = 2&lt;br /&gt;
     \once \override Glissando.bound-details.left.arrow = ##t&lt;br /&gt;
     \once \override Glissando.arrow-width = 1&lt;br /&gt;
     \once \override Glissando.arrow-length = 2&lt;br /&gt;
     \once \override Glissando.breakable = ##t&lt;br /&gt;
   #})&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
\relative c&#039; {&lt;br /&gt;
  &amp;lt;&amp;lt;&lt;br /&gt;
    % Usage: Place the arrow function call before the note, and the&lt;br /&gt;
    % glissando statement after the note.&lt;br /&gt;
    \new Staff = upper {&lt;br /&gt;
      c4 d e \backwardArrow #blue c \glissando |&lt;br /&gt;
      R1*5 |&lt;br /&gt;
      c4 d e c |&lt;br /&gt;
      e1 |&lt;br /&gt;
      d1 |&lt;br /&gt;
      c1 |&lt;br /&gt;
    }&lt;br /&gt;
    \new Staff = middle {&lt;br /&gt;
      R1 |&lt;br /&gt;
      c4 d e c |&lt;br /&gt;
      e8 d e f g f e c |&lt;br /&gt;
      d8 c d e f e f d |&lt;br /&gt;
      c1 |&lt;br /&gt;
      R1*5&lt;br /&gt;
    }&lt;br /&gt;
    \new Staff = lower &amp;lt;&amp;lt;&lt;br /&gt;
      \new Voice {&lt;br /&gt;
        \oneVoice&lt;br /&gt;
        R1*2 |&lt;br /&gt;
        c4 d e \forwardArrow #blue c\glissando |&lt;br /&gt;
        R1 |&lt;br /&gt;
        c4 d e c |&lt;br /&gt;
        d4 c b2 |&lt;br /&gt;
        R1*4&lt;br /&gt;
      }&lt;br /&gt;
      \new Voice {&lt;br /&gt;
        \override NoteColumn.ignore-collision = ##t &lt;br /&gt;
&lt;br /&gt;
        % For cross-staff arrows we use an additional voice with&lt;br /&gt;
        % hidden notes.  To make these notes visible, uncomment the&lt;br /&gt;
        % following lines&lt;br /&gt;
        %&lt;br /&gt;
        %   \override NoteHead.color = #cyan&lt;br /&gt;
        %   \override NoteHead.layer = #2&lt;br /&gt;
        %&lt;br /&gt;
        % and remove the following &amp;quot;\hideNotes&amp;quot; line.&lt;br /&gt;
        \hideNotes&lt;br /&gt;
&lt;br /&gt;
        \set Voice.followVoice = ##t&lt;br /&gt;
        \change Staff = &amp;quot;upper&amp;quot; c4 s2. |&lt;br /&gt;
        % Place the arrow function call immediately before the staff&lt;br /&gt;
        % change.&lt;br /&gt;
        \backwardArrow #green \change Staff = middle c4 s2. |&lt;br /&gt;
        \forwardArrow #red \change Staff = lower c4 s2. |&lt;br /&gt;
        s1 |&lt;br /&gt;
        c4 s2. | \break&lt;br /&gt;
        s1 |&lt;br /&gt;
        \forwardArrow #red \change Staff = upper c4 s2. |&lt;br /&gt;
      }&lt;br /&gt;
    &amp;gt;&amp;gt;&lt;br /&gt;
  &amp;gt;&amp;gt;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lilypond&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Connecting notes]]&lt;br /&gt;
[[Category:Editorial annotations]]&lt;br /&gt;
[[Category:Tweaks and overrides]]&lt;br /&gt;
[[Category:Snippet]]&lt;/div&gt;</summary>
		<author><name>Lemzwerg</name></author>
	</entry>
	<entry>
		<id>https://wiki.lilypond.community/index.php?title=LSR_1029&amp;diff=6597</id>
		<title>LSR 1029</title>
		<link rel="alternate" type="text/html" href="https://wiki.lilypond.community/index.php?title=LSR_1029&amp;diff=6597"/>
		<updated>2026-07-09T04:50:13Z</updated>

		<summary type="html">&lt;p&gt;Lemzwerg: Changed redirect target from Easily enter music expressions in markup to Easily enter music expressions in markup (obsolete in 2.23)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Easily enter music expressions in markup (obsolete in 2.23)]]&lt;/div&gt;</summary>
		<author><name>Lemzwerg</name></author>
	</entry>
	<entry>
		<id>https://wiki.lilypond.community/index.php?title=LSR_835&amp;diff=6596</id>
		<title>LSR 835</title>
		<link rel="alternate" type="text/html" href="https://wiki.lilypond.community/index.php?title=LSR_835&amp;diff=6596"/>
		<updated>2026-07-09T04:48:51Z</updated>

		<summary type="html">&lt;p&gt;Lemzwerg: Changed redirect target from Compound time signatures to Complex time signatures&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Complex time signatures]]&lt;/div&gt;</summary>
		<author><name>Lemzwerg</name></author>
	</entry>
	<entry>
		<id>https://wiki.lilypond.community/index.php?title=LSR_961&amp;diff=6595</id>
		<title>LSR 961</title>
		<link rel="alternate" type="text/html" href="https://wiki.lilypond.community/index.php?title=LSR_961&amp;diff=6595"/>
		<updated>2026-07-09T04:46:56Z</updated>

		<summary type="html">&lt;p&gt;Lemzwerg: Changed redirect target from Colored arrow to Colored arrows&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Colored arrows]]&lt;/div&gt;</summary>
		<author><name>Lemzwerg</name></author>
	</entry>
	<entry>
		<id>https://wiki.lilypond.community/index.php?title=LSR_962&amp;diff=6594</id>
		<title>LSR 962</title>
		<link rel="alternate" type="text/html" href="https://wiki.lilypond.community/index.php?title=LSR_962&amp;diff=6594"/>
		<updated>2026-07-09T04:46:18Z</updated>

		<summary type="html">&lt;p&gt;Lemzwerg: Changed redirect target from Colored arrows (alternative method) to Colored arrows (2)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Colored arrows (2)]]&lt;/div&gt;</summary>
		<author><name>Lemzwerg</name></author>
	</entry>
	<entry>
		<id>https://wiki.lilypond.community/index.php?title=Colored_arrows&amp;diff=6593</id>
		<title>Colored arrows</title>
		<link rel="alternate" type="text/html" href="https://wiki.lilypond.community/index.php?title=Colored_arrows&amp;diff=6593"/>
		<updated>2026-07-09T04:45:59Z</updated>

		<summary type="html">&lt;p&gt;Lemzwerg: Lemzwerg moved page Colored arrow to Colored arrows without leaving a redirect&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This snippet demonstrates drawing colored arrows in a score, e.g., for analysis purposes. These arrows have a fixed length and angle. If you prefer arrows that adapt to layout changes, check snippet [[Colored arrows (2)]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lilypond version=&amp;quot;2.24&amp;quot;&amp;gt;&lt;br /&gt;
#(define-markup-command (Arrow layout props color angle length moveX moveY) &lt;br /&gt;
   (color? number? number? number? number?)&lt;br /&gt;
   (interpret-markup layout props&lt;br /&gt;
     #{&lt;br /&gt;
       \markup {&lt;br /&gt;
         \with-dimensions #&#039;(0 . 0) #&#039;(0 . 0)&lt;br /&gt;
         \translate #(cons moveX moveY)&lt;br /&gt;
         \rotate #angle&lt;br /&gt;
         \override #&#039;(thickness . 5)    % line thickness&lt;br /&gt;
         \fontsize #10                  % arrow-head size&lt;br /&gt;
         \with-dimensions #&#039;(0 . 0) #&#039;(0 . 0)&lt;br /&gt;
         \with-color $color&lt;br /&gt;
         \translate #(cons 0 (- 0 length))&lt;br /&gt;
         \combine&lt;br /&gt;
         \draw-line #(cons 0 length)    % can be replaced by \draw-dashed-line or \draw-dotted-line&lt;br /&gt;
         \translate-scaled #&#039;(0 . -0.5) % might have to be adjusted if line thickness is changed&lt;br /&gt;
         \with-color $color &lt;br /&gt;
         \arrow-head #Y #DOWN ##t       % ##t - filled arrow-head, ##f - empty arrow-head&lt;br /&gt;
       }&lt;br /&gt;
     #}))&lt;br /&gt;
&lt;br /&gt;
{&amp;lt;&amp;lt;&lt;br /&gt;
  \new Staff {R1*3} &lt;br /&gt;
  \new Staff {&lt;br /&gt;
    e&#039;1-\tweak layer #-1 -\markup {\Arrow #green #138 #16 #2 #2 }&lt;br /&gt;
    e&#039;1-\tweak layer #-1 -\markup {\Arrow #cyan #255 #14 #-1 #2 }&lt;br /&gt;
    e&#039;1-\tweak layer #2  -\markup {\Arrow #red #172 #11 #1 #2 }&lt;br /&gt;
    % To have the arrow behind the staff, choose a value below 0 for the layer. &lt;br /&gt;
    % If you want the arrows to cover the notes, choose a value of 2 or more.&lt;br /&gt;
  }&lt;br /&gt;
&amp;gt;&amp;gt;}&lt;br /&gt;
&amp;lt;/lilypond&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Education]]&lt;br /&gt;
[[Category:Editorial annotations]]&lt;br /&gt;
[[Category:Tweaks and overrides]]&lt;br /&gt;
[[Category:Specific notation]]&lt;br /&gt;
[[Category:Syntax and expressions]]&lt;br /&gt;
[[Category:Snippet]]&lt;/div&gt;</summary>
		<author><name>Lemzwerg</name></author>
	</entry>
	<entry>
		<id>https://wiki.lilypond.community/index.php?title=Colored_arrows&amp;diff=6592</id>
		<title>Colored arrows</title>
		<link rel="alternate" type="text/html" href="https://wiki.lilypond.community/index.php?title=Colored_arrows&amp;diff=6592"/>
		<updated>2026-07-09T04:45:45Z</updated>

		<summary type="html">&lt;p&gt;Lemzwerg: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This snippet demonstrates drawing colored arrows in a score, e.g., for analysis purposes. These arrows have a fixed length and angle. If you prefer arrows that adapt to layout changes, check snippet [[Colored arrows (2)]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lilypond version=&amp;quot;2.24&amp;quot;&amp;gt;&lt;br /&gt;
#(define-markup-command (Arrow layout props color angle length moveX moveY) &lt;br /&gt;
   (color? number? number? number? number?)&lt;br /&gt;
   (interpret-markup layout props&lt;br /&gt;
     #{&lt;br /&gt;
       \markup {&lt;br /&gt;
         \with-dimensions #&#039;(0 . 0) #&#039;(0 . 0)&lt;br /&gt;
         \translate #(cons moveX moveY)&lt;br /&gt;
         \rotate #angle&lt;br /&gt;
         \override #&#039;(thickness . 5)    % line thickness&lt;br /&gt;
         \fontsize #10                  % arrow-head size&lt;br /&gt;
         \with-dimensions #&#039;(0 . 0) #&#039;(0 . 0)&lt;br /&gt;
         \with-color $color&lt;br /&gt;
         \translate #(cons 0 (- 0 length))&lt;br /&gt;
         \combine&lt;br /&gt;
         \draw-line #(cons 0 length)    % can be replaced by \draw-dashed-line or \draw-dotted-line&lt;br /&gt;
         \translate-scaled #&#039;(0 . -0.5) % might have to be adjusted if line thickness is changed&lt;br /&gt;
         \with-color $color &lt;br /&gt;
         \arrow-head #Y #DOWN ##t       % ##t - filled arrow-head, ##f - empty arrow-head&lt;br /&gt;
       }&lt;br /&gt;
     #}))&lt;br /&gt;
&lt;br /&gt;
{&amp;lt;&amp;lt;&lt;br /&gt;
  \new Staff {R1*3} &lt;br /&gt;
  \new Staff {&lt;br /&gt;
    e&#039;1-\tweak layer #-1 -\markup {\Arrow #green #138 #16 #2 #2 }&lt;br /&gt;
    e&#039;1-\tweak layer #-1 -\markup {\Arrow #cyan #255 #14 #-1 #2 }&lt;br /&gt;
    e&#039;1-\tweak layer #2  -\markup {\Arrow #red #172 #11 #1 #2 }&lt;br /&gt;
    % To have the arrow behind the staff, choose a value below 0 for the layer. &lt;br /&gt;
    % If you want the arrows to cover the notes, choose a value of 2 or more.&lt;br /&gt;
  }&lt;br /&gt;
&amp;gt;&amp;gt;}&lt;br /&gt;
&amp;lt;/lilypond&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Education]]&lt;br /&gt;
[[Category:Editorial annotations]]&lt;br /&gt;
[[Category:Tweaks and overrides]]&lt;br /&gt;
[[Category:Specific notation]]&lt;br /&gt;
[[Category:Syntax and expressions]]&lt;br /&gt;
[[Category:Snippet]]&lt;/div&gt;</summary>
		<author><name>Lemzwerg</name></author>
	</entry>
	<entry>
		<id>https://wiki.lilypond.community/index.php?title=Colored_arrows_(2)&amp;diff=6591</id>
		<title>Colored arrows (2)</title>
		<link rel="alternate" type="text/html" href="https://wiki.lilypond.community/index.php?title=Colored_arrows_(2)&amp;diff=6591"/>
		<updated>2026-07-09T04:44:34Z</updated>

		<summary type="html">&lt;p&gt;Lemzwerg: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This snippet demonstrates drawing colored arrows in a score, e.g., for analysis purposes. These arrows adapt to layout changes, because they are made of spanners between (invisible) note heads. If you need arrows with a fixed length and angle, you might prefer the snippet [[Colored arrows]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lilypond version=&amp;quot;2.24&amp;quot;&amp;gt;&lt;br /&gt;
forwardArrow =&lt;br /&gt;
#(define-music-function (color) (color?)&lt;br /&gt;
   #{&lt;br /&gt;
     % Cross-staff arrows are made using the VoiceFollower.  To have&lt;br /&gt;
     % the arrow behind the staff, choose a value below 0 for the&lt;br /&gt;
     % layer.  If you want the arrows to cover the notes, choose a&lt;br /&gt;
     % value of 2 or more.&lt;br /&gt;
     \once \override VoiceFollower.layer = -5&lt;br /&gt;
&lt;br /&gt;
     \once \override VoiceFollower.thickness = 5   % line thickness&lt;br /&gt;
     \once \override VoiceFollower.color = #color&lt;br /&gt;
&lt;br /&gt;
     % Padding can be adjusted to move arrow ends closer to the&lt;br /&gt;
     % notes.&lt;br /&gt;
     \once \override VoiceFollower.bound-details.left.padding = 2&lt;br /&gt;
     \once \override VoiceFollower.bound-details.right.padding = 2&lt;br /&gt;
&lt;br /&gt;
     \once \override VoiceFollower.bound-details.right.arrow = ##t&lt;br /&gt;
     \once \override VoiceFollower.arrow-width = 1&lt;br /&gt;
     \once \override VoiceFollower.arrow-length = 2&lt;br /&gt;
     % ##f prevents line breaks within an arrow.&lt;br /&gt;
     \once \override VoiceFollower.breakable = ##t&lt;br /&gt;
&lt;br /&gt;
     % Arrows within the same staff use the Glissando spanner, so&lt;br /&gt;
     % we repeat setting the above properties for this grob.&lt;br /&gt;
     \once \override Glissando.layer = -5&lt;br /&gt;
     \once \override Glissando.thickness = 5&lt;br /&gt;
     \once \override Glissando.color = #color&lt;br /&gt;
     \once \override Glissando.bound-details.left.padding = 2&lt;br /&gt;
     \once \override Glissando.bound-details.right.padding = 2&lt;br /&gt;
     \once \override Glissando.bound-details.right.arrow = ##t&lt;br /&gt;
     \once \override Glissando.arrow-width = 1&lt;br /&gt;
     \once \override Glissando.arrow-length = 2&lt;br /&gt;
     \once \override Glissando.breakable = ##t&lt;br /&gt;
   #})&lt;br /&gt;
&lt;br /&gt;
backwardArrow =&lt;br /&gt;
#(define-music-function (color) (color?)&lt;br /&gt;
   #{&lt;br /&gt;
     \once \override VoiceFollower.layer = -5&lt;br /&gt;
     \once \override VoiceFollower.thickness = 5&lt;br /&gt;
     \once \override VoiceFollower.color = #color&lt;br /&gt;
     \once \override VoiceFollower.bound-details.left.padding = 2&lt;br /&gt;
     \once \override VoiceFollower.bound-details.right.padding = 2&lt;br /&gt;
     \once \override VoiceFollower.bound-details.left.arrow = ##t&lt;br /&gt;
     \once \override VoiceFollower.arrow-width = 1&lt;br /&gt;
     \once \override VoiceFollower.arrow-length = 2&lt;br /&gt;
     \once \override VoiceFollower.breakable = ##t&lt;br /&gt;
&lt;br /&gt;
     \once \override Glissando.layer = -5&lt;br /&gt;
     \once \override Glissando.thickness = 5&lt;br /&gt;
     \once \override Glissando.color = #color&lt;br /&gt;
     \once \override Glissando.bound-details.left.padding = 2&lt;br /&gt;
     \once \override Glissando.bound-details.right.padding = 2&lt;br /&gt;
     \once \override Glissando.bound-details.left.arrow = ##t&lt;br /&gt;
     \once \override Glissando.arrow-width = 1&lt;br /&gt;
     \once \override Glissando.arrow-length = 2&lt;br /&gt;
     \once \override Glissando.breakable = ##t&lt;br /&gt;
   #})&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
\relative c&#039; {&lt;br /&gt;
  &amp;lt;&amp;lt;&lt;br /&gt;
    % Usage: Place the arrow function call before the note, and the&lt;br /&gt;
    % glissando statement after the note.&lt;br /&gt;
    \new Staff = upper {&lt;br /&gt;
      c4 d e \backwardArrow #blue c \glissando |&lt;br /&gt;
      R1*5 |&lt;br /&gt;
      c4 d e c |&lt;br /&gt;
      e1 |&lt;br /&gt;
      d1 |&lt;br /&gt;
      c1 |&lt;br /&gt;
    }&lt;br /&gt;
    \new Staff = middle {&lt;br /&gt;
      R1 |&lt;br /&gt;
      c4 d e c |&lt;br /&gt;
      e8 d e f g f e c |&lt;br /&gt;
      d8 c d e f e f d |&lt;br /&gt;
      c1 |&lt;br /&gt;
      R1*5&lt;br /&gt;
    }&lt;br /&gt;
    \new Staff = lower &amp;lt;&amp;lt;&lt;br /&gt;
      \new Voice {&lt;br /&gt;
        \oneVoice&lt;br /&gt;
        R1*2 |&lt;br /&gt;
        c4 d e \forwardArrow #blue c\glissando |&lt;br /&gt;
        R1 |&lt;br /&gt;
        c4 d e c |&lt;br /&gt;
        d4 c b2 |&lt;br /&gt;
        R1*4&lt;br /&gt;
      }&lt;br /&gt;
      \new Voice {&lt;br /&gt;
        \override NoteColumn.ignore-collision = ##t &lt;br /&gt;
&lt;br /&gt;
        % For cross-staff arrows we use an additional voice with&lt;br /&gt;
        % hidden notes.  To make these notes visible, uncomment the&lt;br /&gt;
        % following lines&lt;br /&gt;
        %&lt;br /&gt;
        %   \override NoteHead.color = #cyan&lt;br /&gt;
        %   \override NoteHead.layer = #2&lt;br /&gt;
        %&lt;br /&gt;
        % and remove the following &amp;quot;\hideNotes&amp;quot; line.&lt;br /&gt;
        \hideNotes&lt;br /&gt;
&lt;br /&gt;
        \set Voice.followVoice = ##t&lt;br /&gt;
        \change Staff = &amp;quot;upper&amp;quot; c4 s2. |&lt;br /&gt;
        % Place the arrow function call immediately before the staff&lt;br /&gt;
        % change.&lt;br /&gt;
        \backwardArrow #green \change Staff = middle c4 s2. |&lt;br /&gt;
        \forwardArrow #red \change Staff = lower c4 s2. |&lt;br /&gt;
        s1 |&lt;br /&gt;
        c4 s2. | \break&lt;br /&gt;
        s1 |&lt;br /&gt;
        \forwardArrow #red \change Staff = upper c4 s2. |&lt;br /&gt;
      }&lt;br /&gt;
    &amp;gt;&amp;gt;&lt;br /&gt;
  &amp;gt;&amp;gt;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lilypond&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Editorial annotations]]&lt;br /&gt;
[[Category:Breaks]]&lt;br /&gt;
[[Category:Paper and layout]]&lt;br /&gt;
[[Category:Tweaks and overrides]]&lt;br /&gt;
[[Category:Connecting notes]]&lt;br /&gt;
[[Category:Specific notation]]&lt;br /&gt;
[[Category:Snippet]]&lt;/div&gt;</summary>
		<author><name>Lemzwerg</name></author>
	</entry>
	<entry>
		<id>https://wiki.lilypond.community/index.php?title=Colored_arrows_(2)&amp;diff=6590</id>
		<title>Colored arrows (2)</title>
		<link rel="alternate" type="text/html" href="https://wiki.lilypond.community/index.php?title=Colored_arrows_(2)&amp;diff=6590"/>
		<updated>2026-07-09T04:44:03Z</updated>

		<summary type="html">&lt;p&gt;Lemzwerg: Lemzwerg moved page Colored arrow (2) to Colored arrows (2) without leaving a redirect&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This snippet demonstrates drawing colored arrows in a score, e.g., for analysis purposes. These arrows adapt to layout changes, because they are made of spanners between (invisible) note heads. If you need arrows with a fixed length and angle, you might prefer the snippet [[Colored arrow]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lilypond version=&amp;quot;2.24&amp;quot;&amp;gt;&lt;br /&gt;
forwardArrow =&lt;br /&gt;
#(define-music-function (color) (color?)&lt;br /&gt;
   #{&lt;br /&gt;
     % Cross-staff arrows are made using the VoiceFollower.  To have&lt;br /&gt;
     % the arrow behind the staff, choose a value below 0 for the&lt;br /&gt;
     % layer.  If you want the arrows to cover the notes, choose a&lt;br /&gt;
     % value of 2 or more.&lt;br /&gt;
     \once \override VoiceFollower.layer = -5&lt;br /&gt;
&lt;br /&gt;
     \once \override VoiceFollower.thickness = 5   % line thickness&lt;br /&gt;
     \once \override VoiceFollower.color = #color&lt;br /&gt;
&lt;br /&gt;
     % Padding can be adjusted to move arrow ends closer to the&lt;br /&gt;
     % notes.&lt;br /&gt;
     \once \override VoiceFollower.bound-details.left.padding = 2&lt;br /&gt;
     \once \override VoiceFollower.bound-details.right.padding = 2&lt;br /&gt;
&lt;br /&gt;
     \once \override VoiceFollower.bound-details.right.arrow = ##t&lt;br /&gt;
     \once \override VoiceFollower.arrow-width = 1&lt;br /&gt;
     \once \override VoiceFollower.arrow-length = 2&lt;br /&gt;
     % ##f prevents line breaks within an arrow.&lt;br /&gt;
     \once \override VoiceFollower.breakable = ##t&lt;br /&gt;
&lt;br /&gt;
     % Arrows within the same staff use the Glissando spanner, so&lt;br /&gt;
     % we repeat setting the above properties for this grob.&lt;br /&gt;
     \once \override Glissando.layer = -5&lt;br /&gt;
     \once \override Glissando.thickness = 5&lt;br /&gt;
     \once \override Glissando.color = #color&lt;br /&gt;
     \once \override Glissando.bound-details.left.padding = 2&lt;br /&gt;
     \once \override Glissando.bound-details.right.padding = 2&lt;br /&gt;
     \once \override Glissando.bound-details.right.arrow = ##t&lt;br /&gt;
     \once \override Glissando.arrow-width = 1&lt;br /&gt;
     \once \override Glissando.arrow-length = 2&lt;br /&gt;
     \once \override Glissando.breakable = ##t&lt;br /&gt;
   #})&lt;br /&gt;
&lt;br /&gt;
backwardArrow =&lt;br /&gt;
#(define-music-function (color) (color?)&lt;br /&gt;
   #{&lt;br /&gt;
     \once \override VoiceFollower.layer = -5&lt;br /&gt;
     \once \override VoiceFollower.thickness = 5&lt;br /&gt;
     \once \override VoiceFollower.color = #color&lt;br /&gt;
     \once \override VoiceFollower.bound-details.left.padding = 2&lt;br /&gt;
     \once \override VoiceFollower.bound-details.right.padding = 2&lt;br /&gt;
     \once \override VoiceFollower.bound-details.left.arrow = ##t&lt;br /&gt;
     \once \override VoiceFollower.arrow-width = 1&lt;br /&gt;
     \once \override VoiceFollower.arrow-length = 2&lt;br /&gt;
     \once \override VoiceFollower.breakable = ##t&lt;br /&gt;
&lt;br /&gt;
     \once \override Glissando.layer = -5&lt;br /&gt;
     \once \override Glissando.thickness = 5&lt;br /&gt;
     \once \override Glissando.color = #color&lt;br /&gt;
     \once \override Glissando.bound-details.left.padding = 2&lt;br /&gt;
     \once \override Glissando.bound-details.right.padding = 2&lt;br /&gt;
     \once \override Glissando.bound-details.left.arrow = ##t&lt;br /&gt;
     \once \override Glissando.arrow-width = 1&lt;br /&gt;
     \once \override Glissando.arrow-length = 2&lt;br /&gt;
     \once \override Glissando.breakable = ##t&lt;br /&gt;
   #})&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
\relative c&#039; {&lt;br /&gt;
  &amp;lt;&amp;lt;&lt;br /&gt;
    % Usage: Place the arrow function call before the note, and the&lt;br /&gt;
    % glissando statement after the note.&lt;br /&gt;
    \new Staff = upper {&lt;br /&gt;
      c4 d e \backwardArrow #blue c \glissando |&lt;br /&gt;
      R1*5 |&lt;br /&gt;
      c4 d e c |&lt;br /&gt;
      e1 |&lt;br /&gt;
      d1 |&lt;br /&gt;
      c1 |&lt;br /&gt;
    }&lt;br /&gt;
    \new Staff = middle {&lt;br /&gt;
      R1 |&lt;br /&gt;
      c4 d e c |&lt;br /&gt;
      e8 d e f g f e c |&lt;br /&gt;
      d8 c d e f e f d |&lt;br /&gt;
      c1 |&lt;br /&gt;
      R1*5&lt;br /&gt;
    }&lt;br /&gt;
    \new Staff = lower &amp;lt;&amp;lt;&lt;br /&gt;
      \new Voice {&lt;br /&gt;
        \oneVoice&lt;br /&gt;
        R1*2 |&lt;br /&gt;
        c4 d e \forwardArrow #blue c\glissando |&lt;br /&gt;
        R1 |&lt;br /&gt;
        c4 d e c |&lt;br /&gt;
        d4 c b2 |&lt;br /&gt;
        R1*4&lt;br /&gt;
      }&lt;br /&gt;
      \new Voice {&lt;br /&gt;
        \override NoteColumn.ignore-collision = ##t &lt;br /&gt;
&lt;br /&gt;
        % For cross-staff arrows we use an additional voice with&lt;br /&gt;
        % hidden notes.  To make these notes visible, uncomment the&lt;br /&gt;
        % following lines&lt;br /&gt;
        %&lt;br /&gt;
        %   \override NoteHead.color = #cyan&lt;br /&gt;
        %   \override NoteHead.layer = #2&lt;br /&gt;
        %&lt;br /&gt;
        % and remove the following &amp;quot;\hideNotes&amp;quot; line.&lt;br /&gt;
        \hideNotes&lt;br /&gt;
&lt;br /&gt;
        \set Voice.followVoice = ##t&lt;br /&gt;
        \change Staff = &amp;quot;upper&amp;quot; c4 s2. |&lt;br /&gt;
        % Place the arrow function call immediately before the staff&lt;br /&gt;
        % change.&lt;br /&gt;
        \backwardArrow #green \change Staff = middle c4 s2. |&lt;br /&gt;
        \forwardArrow #red \change Staff = lower c4 s2. |&lt;br /&gt;
        s1 |&lt;br /&gt;
        c4 s2. | \break&lt;br /&gt;
        s1 |&lt;br /&gt;
        \forwardArrow #red \change Staff = upper c4 s2. |&lt;br /&gt;
      }&lt;br /&gt;
    &amp;gt;&amp;gt;&lt;br /&gt;
  &amp;gt;&amp;gt;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lilypond&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Editorial annotations]]&lt;br /&gt;
[[Category:Breaks]]&lt;br /&gt;
[[Category:Paper and layout]]&lt;br /&gt;
[[Category:Tweaks and overrides]]&lt;br /&gt;
[[Category:Connecting notes]]&lt;br /&gt;
[[Category:Specific notation]]&lt;br /&gt;
[[Category:Snippet]]&lt;/div&gt;</summary>
		<author><name>Lemzwerg</name></author>
	</entry>
	<entry>
		<id>https://wiki.lilypond.community/index.php?title=Colored_arrows_(2)&amp;diff=6589</id>
		<title>Colored arrows (2)</title>
		<link rel="alternate" type="text/html" href="https://wiki.lilypond.community/index.php?title=Colored_arrows_(2)&amp;diff=6589"/>
		<updated>2026-07-09T04:42:57Z</updated>

		<summary type="html">&lt;p&gt;Lemzwerg: Fix and improve.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This snippet demonstrates drawing colored arrows in a score, e.g., for analysis purposes. These arrows adapt to layout changes, because they are made of spanners between (invisible) note heads. If you need arrows with a fixed length and angle, you might prefer the snippet [[Colored arrow]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lilypond version=&amp;quot;2.24&amp;quot;&amp;gt;&lt;br /&gt;
forwardArrow =&lt;br /&gt;
#(define-music-function (color) (color?)&lt;br /&gt;
   #{&lt;br /&gt;
     % Cross-staff arrows are made using the VoiceFollower.  To have&lt;br /&gt;
     % the arrow behind the staff, choose a value below 0 for the&lt;br /&gt;
     % layer.  If you want the arrows to cover the notes, choose a&lt;br /&gt;
     % value of 2 or more.&lt;br /&gt;
     \once \override VoiceFollower.layer = -5&lt;br /&gt;
&lt;br /&gt;
     \once \override VoiceFollower.thickness = 5   % line thickness&lt;br /&gt;
     \once \override VoiceFollower.color = #color&lt;br /&gt;
&lt;br /&gt;
     % Padding can be adjusted to move arrow ends closer to the&lt;br /&gt;
     % notes.&lt;br /&gt;
     \once \override VoiceFollower.bound-details.left.padding = 2&lt;br /&gt;
     \once \override VoiceFollower.bound-details.right.padding = 2&lt;br /&gt;
&lt;br /&gt;
     \once \override VoiceFollower.bound-details.right.arrow = ##t&lt;br /&gt;
     \once \override VoiceFollower.arrow-width = 1&lt;br /&gt;
     \once \override VoiceFollower.arrow-length = 2&lt;br /&gt;
     % ##f prevents line breaks within an arrow.&lt;br /&gt;
     \once \override VoiceFollower.breakable = ##t&lt;br /&gt;
&lt;br /&gt;
     % Arrows within the same staff use the Glissando spanner, so&lt;br /&gt;
     % we repeat setting the above properties for this grob.&lt;br /&gt;
     \once \override Glissando.layer = -5&lt;br /&gt;
     \once \override Glissando.thickness = 5&lt;br /&gt;
     \once \override Glissando.color = #color&lt;br /&gt;
     \once \override Glissando.bound-details.left.padding = 2&lt;br /&gt;
     \once \override Glissando.bound-details.right.padding = 2&lt;br /&gt;
     \once \override Glissando.bound-details.right.arrow = ##t&lt;br /&gt;
     \once \override Glissando.arrow-width = 1&lt;br /&gt;
     \once \override Glissando.arrow-length = 2&lt;br /&gt;
     \once \override Glissando.breakable = ##t&lt;br /&gt;
   #})&lt;br /&gt;
&lt;br /&gt;
backwardArrow =&lt;br /&gt;
#(define-music-function (color) (color?)&lt;br /&gt;
   #{&lt;br /&gt;
     \once \override VoiceFollower.layer = -5&lt;br /&gt;
     \once \override VoiceFollower.thickness = 5&lt;br /&gt;
     \once \override VoiceFollower.color = #color&lt;br /&gt;
     \once \override VoiceFollower.bound-details.left.padding = 2&lt;br /&gt;
     \once \override VoiceFollower.bound-details.right.padding = 2&lt;br /&gt;
     \once \override VoiceFollower.bound-details.left.arrow = ##t&lt;br /&gt;
     \once \override VoiceFollower.arrow-width = 1&lt;br /&gt;
     \once \override VoiceFollower.arrow-length = 2&lt;br /&gt;
     \once \override VoiceFollower.breakable = ##t&lt;br /&gt;
&lt;br /&gt;
     \once \override Glissando.layer = -5&lt;br /&gt;
     \once \override Glissando.thickness = 5&lt;br /&gt;
     \once \override Glissando.color = #color&lt;br /&gt;
     \once \override Glissando.bound-details.left.padding = 2&lt;br /&gt;
     \once \override Glissando.bound-details.right.padding = 2&lt;br /&gt;
     \once \override Glissando.bound-details.left.arrow = ##t&lt;br /&gt;
     \once \override Glissando.arrow-width = 1&lt;br /&gt;
     \once \override Glissando.arrow-length = 2&lt;br /&gt;
     \once \override Glissando.breakable = ##t&lt;br /&gt;
   #})&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
\relative c&#039; {&lt;br /&gt;
  &amp;lt;&amp;lt;&lt;br /&gt;
    % Usage: Place the arrow function call before the note, and the&lt;br /&gt;
    % glissando statement after the note.&lt;br /&gt;
    \new Staff = upper {&lt;br /&gt;
      c4 d e \backwardArrow #blue c \glissando |&lt;br /&gt;
      R1*5 |&lt;br /&gt;
      c4 d e c |&lt;br /&gt;
      e1 |&lt;br /&gt;
      d1 |&lt;br /&gt;
      c1 |&lt;br /&gt;
    }&lt;br /&gt;
    \new Staff = middle {&lt;br /&gt;
      R1 |&lt;br /&gt;
      c4 d e c |&lt;br /&gt;
      e8 d e f g f e c |&lt;br /&gt;
      d8 c d e f e f d |&lt;br /&gt;
      c1 |&lt;br /&gt;
      R1*5&lt;br /&gt;
    }&lt;br /&gt;
    \new Staff = lower &amp;lt;&amp;lt;&lt;br /&gt;
      \new Voice {&lt;br /&gt;
        \oneVoice&lt;br /&gt;
        R1*2 |&lt;br /&gt;
        c4 d e \forwardArrow #blue c\glissando |&lt;br /&gt;
        R1 |&lt;br /&gt;
        c4 d e c |&lt;br /&gt;
        d4 c b2 |&lt;br /&gt;
        R1*4&lt;br /&gt;
      }&lt;br /&gt;
      \new Voice {&lt;br /&gt;
        \override NoteColumn.ignore-collision = ##t &lt;br /&gt;
&lt;br /&gt;
        % For cross-staff arrows we use an additional voice with&lt;br /&gt;
        % hidden notes.  To make these notes visible, uncomment the&lt;br /&gt;
        % following lines&lt;br /&gt;
        %&lt;br /&gt;
        %   \override NoteHead.color = #cyan&lt;br /&gt;
        %   \override NoteHead.layer = #2&lt;br /&gt;
        %&lt;br /&gt;
        % and remove the following &amp;quot;\hideNotes&amp;quot; line.&lt;br /&gt;
        \hideNotes&lt;br /&gt;
&lt;br /&gt;
        \set Voice.followVoice = ##t&lt;br /&gt;
        \change Staff = &amp;quot;upper&amp;quot; c4 s2. |&lt;br /&gt;
        % Place the arrow function call immediately before the staff&lt;br /&gt;
        % change.&lt;br /&gt;
        \backwardArrow #green \change Staff = middle c4 s2. |&lt;br /&gt;
        \forwardArrow #red \change Staff = lower c4 s2. |&lt;br /&gt;
        s1 |&lt;br /&gt;
        c4 s2. | \break&lt;br /&gt;
        s1 |&lt;br /&gt;
        \forwardArrow #red \change Staff = upper c4 s2. |&lt;br /&gt;
      }&lt;br /&gt;
    &amp;gt;&amp;gt;&lt;br /&gt;
  &amp;gt;&amp;gt;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lilypond&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Editorial annotations]]&lt;br /&gt;
[[Category:Breaks]]&lt;br /&gt;
[[Category:Paper and layout]]&lt;br /&gt;
[[Category:Tweaks and overrides]]&lt;br /&gt;
[[Category:Connecting notes]]&lt;br /&gt;
[[Category:Specific notation]]&lt;br /&gt;
[[Category:Snippet]]&lt;/div&gt;</summary>
		<author><name>Lemzwerg</name></author>
	</entry>
	<entry>
		<id>https://wiki.lilypond.community/index.php?title=Horizontally_aligning_stanza_numbers_of_different_staves&amp;diff=6588</id>
		<title>Horizontally aligning stanza numbers of different staves</title>
		<link rel="alternate" type="text/html" href="https://wiki.lilypond.community/index.php?title=Horizontally_aligning_stanza_numbers_of_different_staves&amp;diff=6588"/>
		<updated>2026-06-26T15:39:11Z</updated>

		<summary type="html">&lt;p&gt;Lemzwerg: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;It can happen that stanza numbers don’t align horizontally if the verses are attached to different staves. To fix that, override the &amp;lt;code&amp;gt;self-alignment-X&amp;lt;/code&amp;gt; property of the &amp;lt;code&amp;gt;LyricText&amp;lt;/code&amp;gt; grob.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lilypond version=&amp;quot;2.24&amp;quot;&amp;gt;&lt;br /&gt;
\markup { default behavior }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;&amp;lt;&lt;br /&gt;
  \new Staff { b b b b }&lt;br /&gt;
  \lyrics {&lt;br /&gt;
    \set stanza = &amp;quot;3.&amp;quot;&lt;br /&gt;
    a a a a&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  \new Staff { b b b b }&lt;br /&gt;
  \lyrics {&lt;br /&gt;
    \set stanza = &amp;quot;1.&amp;quot;&lt;br /&gt;
    aaaaaaaaaa a a a&lt;br /&gt;
  }&lt;br /&gt;
  \lyrics {&lt;br /&gt;
    \set stanza = &amp;quot;2.&amp;quot;&lt;br /&gt;
    a a a a&lt;br /&gt;
  }&lt;br /&gt;
&amp;gt;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
\markup \vspace #1&lt;br /&gt;
\markup {&lt;br /&gt;
  using \typewriter &amp;quot;self-alignment-X = #LEFT&amp;quot; }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;&amp;lt;&lt;br /&gt;
  \new Staff { b b b b }&lt;br /&gt;
  \new Lyrics \lyricmode {&lt;br /&gt;
    \set stanza = &amp;quot;3.&amp;quot;&lt;br /&gt;
    a a a a&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  \new Staff { b b b b }&lt;br /&gt;
  \new Lyrics \lyricmode {&lt;br /&gt;
    \set stanza = &amp;quot;1.&amp;quot;&lt;br /&gt;
    \once \override LyricText.self-alignment-X = #LEFT&lt;br /&gt;
    aaaaaaaaaa a a a&lt;br /&gt;
  }&lt;br /&gt;
  \new Lyrics \lyricmode {&lt;br /&gt;
    \set stanza = &amp;quot;2.&amp;quot;&lt;br /&gt;
    a a a a&lt;br /&gt;
  }&lt;br /&gt;
&amp;gt;&amp;gt;&lt;br /&gt;
&amp;lt;/lilypond&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Tweaks and overrides]]&lt;br /&gt;
[[Category:Vocal music]]&lt;br /&gt;
[[Category:Included in the official documentation]]&lt;br /&gt;
[[Category:Snippet]]&lt;/div&gt;</summary>
		<author><name>Lemzwerg</name></author>
	</entry>
	<entry>
		<id>https://wiki.lilypond.community/index.php?title=LSR_1193&amp;diff=6587</id>
		<title>LSR 1193</title>
		<link rel="alternate" type="text/html" href="https://wiki.lilypond.community/index.php?title=LSR_1193&amp;diff=6587"/>
		<updated>2026-06-26T15:37:38Z</updated>

		<summary type="html">&lt;p&gt;Lemzwerg: Changed redirect target from Vertically aligning stanza numbers of different staves to Horizontally aligning stanza numbers of different staves&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Horizontally aligning stanza numbers of different staves]]&lt;/div&gt;</summary>
		<author><name>Lemzwerg</name></author>
	</entry>
	<entry>
		<id>https://wiki.lilypond.community/index.php?title=Horizontally_aligning_stanza_numbers_of_different_staves&amp;diff=6586</id>
		<title>Horizontally aligning stanza numbers of different staves</title>
		<link rel="alternate" type="text/html" href="https://wiki.lilypond.community/index.php?title=Horizontally_aligning_stanza_numbers_of_different_staves&amp;diff=6586"/>
		<updated>2026-06-26T15:36:53Z</updated>

		<summary type="html">&lt;p&gt;Lemzwerg: Lemzwerg moved page Vertically aligning stanza numbers of different staves to Horizontally aligning stanza numbers of different staves without leaving a redirect&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;It can happen that stanza numbers don&#039;t align vertically if the verses are attached to different staves. To fix that, override the &amp;lt;code&amp;gt;self-alignment-X&amp;lt;/code&amp;gt; property of the &amp;lt;code&amp;gt;LyricText&amp;lt;/code&amp;gt; grob.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lilypond version=&amp;quot;2.24&amp;quot;&amp;gt;&lt;br /&gt;
\markup { default behavior }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;&amp;lt;&lt;br /&gt;
  \new Staff { b b b b }&lt;br /&gt;
  \lyrics {&lt;br /&gt;
    \set stanza = &amp;quot;3.&amp;quot;&lt;br /&gt;
    a a a a&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  \new Staff { b b b b }&lt;br /&gt;
  \lyrics {&lt;br /&gt;
    \set stanza = &amp;quot;1.&amp;quot;&lt;br /&gt;
    aaaaaaaaaa a a a&lt;br /&gt;
  }&lt;br /&gt;
  \lyrics {&lt;br /&gt;
    \set stanza = &amp;quot;2.&amp;quot;&lt;br /&gt;
    a a a a&lt;br /&gt;
  }&lt;br /&gt;
&amp;gt;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
\markup \vspace #1&lt;br /&gt;
\markup {&lt;br /&gt;
  using \typewriter &amp;quot;self-alignment-X = #LEFT&amp;quot; }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;&amp;lt;&lt;br /&gt;
  \new Staff { b b b b }&lt;br /&gt;
  \new Lyrics \lyricmode {&lt;br /&gt;
    \set stanza = &amp;quot;3.&amp;quot;&lt;br /&gt;
    a a a a&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  \new Staff { b b b b }&lt;br /&gt;
  \new Lyrics \lyricmode {&lt;br /&gt;
    \set stanza = &amp;quot;1.&amp;quot;&lt;br /&gt;
    \once \override LyricText.self-alignment-X = #LEFT&lt;br /&gt;
    aaaaaaaaaa a a a&lt;br /&gt;
  }&lt;br /&gt;
  \new Lyrics \lyricmode {&lt;br /&gt;
    \set stanza = &amp;quot;2.&amp;quot;&lt;br /&gt;
    a a a a&lt;br /&gt;
  }&lt;br /&gt;
&amp;gt;&amp;gt;&lt;br /&gt;
&amp;lt;/lilypond&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Tweaks and overrides]]&lt;br /&gt;
[[Category:Vocal music]]&lt;br /&gt;
[[Category:Included in the official documentation]]&lt;br /&gt;
[[Category:Snippet]]&lt;/div&gt;</summary>
		<author><name>Lemzwerg</name></author>
	</entry>
	<entry>
		<id>https://wiki.lilypond.community/index.php?title=Talk:SemiChoirStaff_is_a_ChoirStaff_with_SpanBars_for_special_bar_lines&amp;diff=6572</id>
		<title>Talk:SemiChoirStaff is a ChoirStaff with SpanBars for special bar lines</title>
		<link rel="alternate" type="text/html" href="https://wiki.lilypond.community/index.php?title=Talk:SemiChoirStaff_is_a_ChoirStaff_with_SpanBars_for_special_bar_lines&amp;diff=6572"/>
		<updated>2026-05-25T19:54:54Z</updated>

		<summary type="html">&lt;p&gt;Lemzwerg: /* Title Change */ Reply&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Title Change ==&lt;br /&gt;
&lt;br /&gt;
I believe that “non-” in the current page title is a typo; the title should instead read “… with SpanBars for special bar lines.” @[[User:Lemzwerg|Lemzwerg]] [[User:Gabriel Ellsworth|Gabriel Ellsworth]] ([[User talk:Gabriel Ellsworth|talk]]) 18:39, 25 May 2026 (UTC)&lt;br /&gt;
&lt;br /&gt;
:Agreed – and moved -- [[User:Lemzwerg|Lemzwerg]] ([[User talk:Lemzwerg|talk]]) 19:54, 25 May 2026 (UTC)&lt;/div&gt;</summary>
		<author><name>Lemzwerg</name></author>
	</entry>
	<entry>
		<id>https://wiki.lilypond.community/index.php?title=LSR_299&amp;diff=6571</id>
		<title>LSR 299</title>
		<link rel="alternate" type="text/html" href="https://wiki.lilypond.community/index.php?title=LSR_299&amp;diff=6571"/>
		<updated>2026-05-25T19:54:24Z</updated>

		<summary type="html">&lt;p&gt;Lemzwerg: Changed redirect target from SemiChoirStaff is a ChoirStaff with SpanBars for non-special bar lines to SemiChoirStaff is a ChoirStaff with SpanBars for special bar lines&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[SemiChoirStaff is a ChoirStaff with SpanBars for special bar lines]]&lt;/div&gt;</summary>
		<author><name>Lemzwerg</name></author>
	</entry>
	<entry>
		<id>https://wiki.lilypond.community/index.php?title=Talk:SemiChoirStaff_is_a_ChoirStaff_with_SpanBars_for_special_bar_lines&amp;diff=6570</id>
		<title>Talk:SemiChoirStaff is a ChoirStaff with SpanBars for special bar lines</title>
		<link rel="alternate" type="text/html" href="https://wiki.lilypond.community/index.php?title=Talk:SemiChoirStaff_is_a_ChoirStaff_with_SpanBars_for_special_bar_lines&amp;diff=6570"/>
		<updated>2026-05-25T19:54:04Z</updated>

		<summary type="html">&lt;p&gt;Lemzwerg: Lemzwerg moved page Talk:SemiChoirStaff is a ChoirStaff with SpanBars for non-special bar lines to Talk:SemiChoirStaff is a ChoirStaff with SpanBars for special bar lines without leaving a redirect&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Title Change ==&lt;br /&gt;
&lt;br /&gt;
I believe that “non-” in the current page title is a typo; the title should instead read “… with SpanBars for special bar lines.” @[[User:Lemzwerg|Lemzwerg]] [[User:Gabriel Ellsworth|Gabriel Ellsworth]] ([[User talk:Gabriel Ellsworth|talk]]) 18:39, 25 May 2026 (UTC)&lt;/div&gt;</summary>
		<author><name>Lemzwerg</name></author>
	</entry>
	<entry>
		<id>https://wiki.lilypond.community/index.php?title=SemiChoirStaff_is_a_ChoirStaff_with_SpanBars_for_special_bar_lines&amp;diff=6569</id>
		<title>SemiChoirStaff is a ChoirStaff with SpanBars for special bar lines</title>
		<link rel="alternate" type="text/html" href="https://wiki.lilypond.community/index.php?title=SemiChoirStaff_is_a_ChoirStaff_with_SpanBars_for_special_bar_lines&amp;diff=6569"/>
		<updated>2026-05-25T19:54:04Z</updated>

		<summary type="html">&lt;p&gt;Lemzwerg: Lemzwerg moved page SemiChoirStaff is a ChoirStaff with SpanBars for non-special bar lines to SemiChoirStaff is a ChoirStaff with SpanBars for special bar lines without leaving a redirect&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;If you wish to typeset &amp;lt;code&amp;gt;|.&amp;lt;/code&amp;gt; and friends as connected in a &amp;lt;code&amp;gt;ChoirStaff&amp;lt;/code&amp;gt; while ordinary bar lines stay unconnected, you can add the &amp;lt;code&amp;gt;Span_bar_engraver&amp;lt;/code&amp;gt; and instruct it to omit the &amp;lt;code&amp;gt;|&amp;lt;/code&amp;gt;-style bars.&lt;br /&gt;
&lt;br /&gt;
In this example a new context, &amp;lt;code&amp;gt;SemiChoirStaff&amp;lt;/code&amp;gt;, is created to achieve this.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lilypond version=&amp;quot;2.24&amp;quot;&amp;gt;&lt;br /&gt;
mus = {&lt;br /&gt;
  \clef F&lt;br /&gt;
  c4 d e f | c d e f \bar &amp;quot;||&amp;quot;&lt;br /&gt;
  c4 d e f | c d e f \bar &amp;quot;|.&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
\layout {&lt;br /&gt;
  \context {&lt;br /&gt;
    \ChoirStaff&lt;br /&gt;
    \name &amp;quot;SemiChoirStaff&amp;quot;&lt;br /&gt;
    \consists &amp;quot;Span_bar_engraver&amp;quot;&lt;br /&gt;
    \override SpanBar.stencil =&lt;br /&gt;
      #(lambda (grob)&lt;br /&gt;
        (if (string=? (ly:grob-property grob &#039;glyph-name) &amp;quot;|&amp;quot;)&lt;br /&gt;
            (set! (ly:grob-property grob &#039;glyph-name) &amp;quot;&amp;quot;))&lt;br /&gt;
        (ly:span-bar::print grob))&lt;br /&gt;
  }&lt;br /&gt;
  \context {&lt;br /&gt;
    \Score&lt;br /&gt;
    \accepts SemiChoirStaff&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
\score {&lt;br /&gt;
  \new SemiChoirStaff {&lt;br /&gt;
    &amp;lt;&amp;lt;&lt;br /&gt;
      \new Staff \mus&lt;br /&gt;
      \new Staff \mus&lt;br /&gt;
    &amp;gt;&amp;gt;&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lilypond&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Contexts and engravers]]&lt;br /&gt;
[[Category:Scheme]]&lt;br /&gt;
[[Category:Workaround]]&lt;br /&gt;
[[Category:Snippet]]&lt;/div&gt;</summary>
		<author><name>Lemzwerg</name></author>
	</entry>
	<entry>
		<id>https://wiki.lilypond.community/index.php?title=Magnetic_lyrics:_snap_syllables_together_if_the_hyphen_inbetween_is_too_short&amp;diff=6566</id>
		<title>Magnetic lyrics: snap syllables together if the hyphen inbetween is too short</title>
		<link rel="alternate" type="text/html" href="https://wiki.lilypond.community/index.php?title=Magnetic_lyrics:_snap_syllables_together_if_the_hyphen_inbetween_is_too_short&amp;diff=6566"/>
		<updated>2026-05-19T05:11:08Z</updated>

		<summary type="html">&lt;p&gt;Lemzwerg: Make it an official snippet&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The current code that LilyPond uses to handle lyric hyphens (i.e., &amp;lt;code&amp;gt;LyricHyphen&amp;lt;/code&amp;gt; grobs) often leads to very short hyphens or even small gaps between syllables with no hyphen visible. This snippet merges adjacent syllables into one string in such cases, also taking care of ligatures as if the string was not hyphenated.&lt;br /&gt;
&lt;br /&gt;
It supersedes previous implementations of “magnetic snap” engravers that were in circulation via the lilypond-user mailing list.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lilypond version=&amp;quot;2.24&amp;quot;&amp;gt;&lt;br /&gt;
% magnetic-lyrics.ily&lt;br /&gt;
%&lt;br /&gt;
%   written by&lt;br /&gt;
%     Jean Abou Samra &amp;lt;jean@abou-samra.fr&amp;gt;&lt;br /&gt;
%     Werner Lemberg &amp;lt;wl@gnu.org&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#(define (Left_hyphen_pointer_engraver context)&lt;br /&gt;
   &amp;quot;Collect syllable-hyphen-syllable occurrences in lyrics and store&lt;br /&gt;
them in properties.  This engraver only looks to the left.  For&lt;br /&gt;
example, if the lyrics input is &#039;foo -- bar&#039;, it does the&lt;br /&gt;
following.&lt;br /&gt;
&lt;br /&gt;
* Set the `text` property of the `LyricHyphen` grob between &#039;foo&#039; and&lt;br /&gt;
  &#039;bar&#039; to &#039;foo&#039;.&lt;br /&gt;
&lt;br /&gt;
* Set the `left-hyphen` property of the `LyricText` grob with text&lt;br /&gt;
  &#039;foo&#039; to the `LyricHyphen` grob between &#039;foo&#039; and &#039;bar&#039;.&lt;br /&gt;
&lt;br /&gt;
Use this auxiliary engraver in combination with the&lt;br /&gt;
`lyric-text::apply-magnetic-offset!` hook.&amp;quot;&lt;br /&gt;
   (let ((hyphen #f)&lt;br /&gt;
         (text #f))&lt;br /&gt;
     (make-engraver&lt;br /&gt;
      (acknowledgers&lt;br /&gt;
       ((lyric-syllable-interface engraver grob source-engraver)&lt;br /&gt;
        (set! text grob)))&lt;br /&gt;
      (end-acknowledgers&lt;br /&gt;
       ((lyric-hyphen-interface engraver grob source-engraver)&lt;br /&gt;
        (when (not (grob::has-interface grob &#039;lyric-space-interface))&lt;br /&gt;
          (set! hyphen grob))))&lt;br /&gt;
      ((stop-translation-timestep engraver)&lt;br /&gt;
       (when (and text hyphen)&lt;br /&gt;
         (ly:grob-set-object! text &#039;left-hyphen hyphen))&lt;br /&gt;
       (set! text #f)&lt;br /&gt;
       (set! hyphen #f)))))&lt;br /&gt;
&lt;br /&gt;
#(define (lyric-text::apply-magnetic-offset! grob)&lt;br /&gt;
   &amp;quot;If the space between two syllables is less than the value in&lt;br /&gt;
property `LyricText.details.squash-threshold`, move the right syllable&lt;br /&gt;
to the left so that it gets concatenated with the left syllable.&lt;br /&gt;
&lt;br /&gt;
Use this function as a hook for `LyricText.after-line-breaking` if the&lt;br /&gt;
`Left_hyphen_pointer_engraver} is active.&amp;quot;&lt;br /&gt;
   (let ((hyphen (ly:grob-object grob &#039;left-hyphen #f)))&lt;br /&gt;
     (when hyphen&lt;br /&gt;
       (let ((left-text (ly:spanner-bound hyphen LEFT)))&lt;br /&gt;
         (when (grob::has-interface left-text &#039;lyric-syllable-interface)&lt;br /&gt;
           (let* ((common (ly:grob-common-refpoint grob left-text X))&lt;br /&gt;
                  (this-x-ext (ly:grob-extent grob common X))&lt;br /&gt;
                  (left-x-ext&lt;br /&gt;
                   (begin&lt;br /&gt;
                     ;; Trigger magnetism for left-text.&lt;br /&gt;
                     (ly:grob-property left-text &#039;after-line-breaking)&lt;br /&gt;
                     (ly:grob-extent left-text common X)))&lt;br /&gt;
                  ;; `delta` is the gap width between two syllables.&lt;br /&gt;
                  (delta (- (interval-start this-x-ext)&lt;br /&gt;
                            (interval-end left-x-ext)))&lt;br /&gt;
                  (details (ly:grob-property grob &#039;details))&lt;br /&gt;
                  (threshold (assoc-get &#039;squash-threshold details 0.2)))&lt;br /&gt;
             (when (&amp;lt; delta threshold)&lt;br /&gt;
               (let* (;; We have to manipulate the input text so that&lt;br /&gt;
                      ;; ligatures crossing syllable boundaries are not&lt;br /&gt;
                      ;; disabled.  For languages based on the Latin&lt;br /&gt;
                      ;; script this is essentially a beautification.&lt;br /&gt;
                      ;; However, for non-Western scripts it can be a&lt;br /&gt;
                      ;; necessity.&lt;br /&gt;
                      (lt (ly:grob-property left-text &#039;text))&lt;br /&gt;
                      (rt (ly:grob-property grob &#039;text))&lt;br /&gt;
                      ;; Append new syllable.&lt;br /&gt;
                      (ltrt (if (and (string? lt) (string? rt))&lt;br /&gt;
                                (string-append lt rt)&lt;br /&gt;
                                (make-concat-markup (list lt rt))))&lt;br /&gt;
                      ;; Right-align `ltrt` to the right side.&lt;br /&gt;
                      (markup (grob-interpret-markup&lt;br /&gt;
                               grob&lt;br /&gt;
                               (make-translate-markup&lt;br /&gt;
                                (cons (interval-length this-x-ext) 0)&lt;br /&gt;
                                (make-right-align-markup ltrt)))))&lt;br /&gt;
                 ;; Don&#039;t print `left-text`.&lt;br /&gt;
                 (ly:grob-set-property! left-text &#039;stencil #f)&lt;br /&gt;
                 ;; Set text and stencil (which holds all collected&lt;br /&gt;
                 ;; syllables so far) and shift it to the left.&lt;br /&gt;
                 (ly:grob-set-property! grob &#039;text ltrt)&lt;br /&gt;
                 (ly:grob-set-property! grob &#039;stencil markup)&lt;br /&gt;
                 (ly:grob-translate-axis! grob (- delta) X)))))))))&lt;br /&gt;
&lt;br /&gt;
#(define (lyric-hyphen::displace-bounds-first grob)&lt;br /&gt;
   ;; Make very sure this callback isn&#039;t triggered too early.&lt;br /&gt;
   (let ((left (ly:spanner-bound grob LEFT))&lt;br /&gt;
         (right (ly:spanner-bound grob RIGHT)))&lt;br /&gt;
     (ly:grob-property left &#039;after-line-breaking)&lt;br /&gt;
     (ly:grob-property right &#039;after-line-breaking)&lt;br /&gt;
     (ly:lyric-hyphen::print grob)))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
%% demonstration&lt;br /&gt;
&lt;br /&gt;
music = {&lt;br /&gt;
  &amp;lt;&amp;lt;&lt;br /&gt;
    { d&#039;4 4 4 4 |&lt;br /&gt;
      r4 4 4 4 }&lt;br /&gt;
    \addlyrics { suf -- fice  baff -- ling&lt;br /&gt;
                 car -- fuff -- ling }&lt;br /&gt;
  &amp;gt;&amp;gt;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
\markup &amp;quot;Without magnetic lyrics:&amp;quot;&lt;br /&gt;
&lt;br /&gt;
\score {&lt;br /&gt;
  \music&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
\markup &amp;quot;With magnetic lyrics:&amp;quot;&lt;br /&gt;
&lt;br /&gt;
\score {&lt;br /&gt;
  \music&lt;br /&gt;
&lt;br /&gt;
  \layout {&lt;br /&gt;
    \context {&lt;br /&gt;
      \Lyrics&lt;br /&gt;
      \consists #Left_hyphen_pointer_engraver&lt;br /&gt;
      \override LyricText.after-line-breaking =&lt;br /&gt;
        #lyric-text::apply-magnetic-offset!&lt;br /&gt;
      \override LyricHyphen.stencil =&lt;br /&gt;
        #lyric-hyphen::displace-bounds-first&lt;br /&gt;
      \override LyricText.details.squash-threshold = 0.4&lt;br /&gt;
      \override LyricHyphen.minimum-distance = 0&lt;br /&gt;
      \override LyricHyphen.minimum-length = 0.4&lt;br /&gt;
      \override LyricSpace.minimum-distance = 1&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
\paper {&lt;br /&gt;
  line-width = 83\mm&lt;br /&gt;
  ragged-last = ##f&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lilypond&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Vocal music]]&lt;br /&gt;
[[Category:Spacing]]&lt;br /&gt;
[[Category:Included in the official documentation]]&lt;br /&gt;
[[Category:Snippet]]&lt;/div&gt;</summary>
		<author><name>Lemzwerg</name></author>
	</entry>
	<entry>
		<id>https://wiki.lilypond.community/index.php?title=Magnetic_lyrics:_snap_syllables_together_if_the_hyphen_inbetween_is_too_short&amp;diff=6565</id>
		<title>Magnetic lyrics: snap syllables together if the hyphen inbetween is too short</title>
		<link rel="alternate" type="text/html" href="https://wiki.lilypond.community/index.php?title=Magnetic_lyrics:_snap_syllables_together_if_the_hyphen_inbetween_is_too_short&amp;diff=6565"/>
		<updated>2026-05-19T05:07:31Z</updated>

		<summary type="html">&lt;p&gt;Lemzwerg: Don&amp;#039;t use Texinfo markup in documentation strings&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The current code that LilyPond uses to handle lyric hyphens (i.e., &amp;lt;code&amp;gt;LyricHyphen&amp;lt;/code&amp;gt; grobs) often leads to very short hyphens or even small gaps between syllables with no hyphen visible. This snippet merges adjacent syllables into one string in such cases, also taking care of ligatures as if the string was not hyphenated.&lt;br /&gt;
&lt;br /&gt;
It supersedes previous implementations of “magnetic snap” engravers that were in circulation via the lilypond-user mailing list.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lilypond version=&amp;quot;2.24&amp;quot;&amp;gt;&lt;br /&gt;
% magnetic-lyrics.ily&lt;br /&gt;
%&lt;br /&gt;
%   written by&lt;br /&gt;
%     Jean Abou Samra &amp;lt;jean@abou-samra.fr&amp;gt;&lt;br /&gt;
%     Werner Lemberg &amp;lt;wl@gnu.org&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#(define (Left_hyphen_pointer_engraver context)&lt;br /&gt;
   &amp;quot;Collect syllable-hyphen-syllable occurrences in lyrics and store&lt;br /&gt;
them in properties.  This engraver only looks to the left.  For&lt;br /&gt;
example, if the lyrics input is &#039;foo -- bar&#039;, it does the&lt;br /&gt;
following.&lt;br /&gt;
&lt;br /&gt;
* Set the `text` property of the `LyricHyphen` grob between &#039;foo&#039; and&lt;br /&gt;
  &#039;bar&#039; to &#039;foo&#039;.&lt;br /&gt;
&lt;br /&gt;
* Set the `left-hyphen` property of the `LyricText` grob with text&lt;br /&gt;
  &#039;foo&#039; to the `LyricHyphen` grob between &#039;foo&#039; and &#039;bar&#039;.&lt;br /&gt;
&lt;br /&gt;
Use this auxiliary engraver in combination with the&lt;br /&gt;
`lyric-text::apply-magnetic-offset!` hook.&amp;quot;&lt;br /&gt;
   (let ((hyphen #f)&lt;br /&gt;
         (text #f))&lt;br /&gt;
     (make-engraver&lt;br /&gt;
      (acknowledgers&lt;br /&gt;
       ((lyric-syllable-interface engraver grob source-engraver)&lt;br /&gt;
        (set! text grob)))&lt;br /&gt;
      (end-acknowledgers&lt;br /&gt;
       ((lyric-hyphen-interface engraver grob source-engraver)&lt;br /&gt;
        (when (not (grob::has-interface grob &#039;lyric-space-interface))&lt;br /&gt;
          (set! hyphen grob))))&lt;br /&gt;
      ((stop-translation-timestep engraver)&lt;br /&gt;
       (when (and text hyphen)&lt;br /&gt;
         (ly:grob-set-object! text &#039;left-hyphen hyphen))&lt;br /&gt;
       (set! text #f)&lt;br /&gt;
       (set! hyphen #f)))))&lt;br /&gt;
&lt;br /&gt;
#(define (lyric-text::apply-magnetic-offset! grob)&lt;br /&gt;
   &amp;quot;If the space between two syllables is less than the value in&lt;br /&gt;
property `LyricText.details.squash-threshold`, move the right syllable&lt;br /&gt;
to the left so that it gets concatenated with the left syllable.&lt;br /&gt;
&lt;br /&gt;
Use this function as a hook for `LyricText.after-line-breaking` if the&lt;br /&gt;
`Left_hyphen_pointer_engraver} is active.&amp;quot;&lt;br /&gt;
   (let ((hyphen (ly:grob-object grob &#039;left-hyphen #f)))&lt;br /&gt;
     (when hyphen&lt;br /&gt;
       (let ((left-text (ly:spanner-bound hyphen LEFT)))&lt;br /&gt;
         (when (grob::has-interface left-text &#039;lyric-syllable-interface)&lt;br /&gt;
           (let* ((common (ly:grob-common-refpoint grob left-text X))&lt;br /&gt;
                  (this-x-ext (ly:grob-extent grob common X))&lt;br /&gt;
                  (left-x-ext&lt;br /&gt;
                   (begin&lt;br /&gt;
                     ;; Trigger magnetism for left-text.&lt;br /&gt;
                     (ly:grob-property left-text &#039;after-line-breaking)&lt;br /&gt;
                     (ly:grob-extent left-text common X)))&lt;br /&gt;
                  ;; `delta` is the gap width between two syllables.&lt;br /&gt;
                  (delta (- (interval-start this-x-ext)&lt;br /&gt;
                            (interval-end left-x-ext)))&lt;br /&gt;
                  (details (ly:grob-property grob &#039;details))&lt;br /&gt;
                  (threshold (assoc-get &#039;squash-threshold details 0.2)))&lt;br /&gt;
             (when (&amp;lt; delta threshold)&lt;br /&gt;
               (let* (;; We have to manipulate the input text so that&lt;br /&gt;
                      ;; ligatures crossing syllable boundaries are not&lt;br /&gt;
                      ;; disabled.  For languages based on the Latin&lt;br /&gt;
                      ;; script this is essentially a beautification.&lt;br /&gt;
                      ;; However, for non-Western scripts it can be a&lt;br /&gt;
                      ;; necessity.&lt;br /&gt;
                      (lt (ly:grob-property left-text &#039;text))&lt;br /&gt;
                      (rt (ly:grob-property grob &#039;text))&lt;br /&gt;
                      ;; Append new syllable.&lt;br /&gt;
                      (ltrt (if (and (string? lt) (string? rt))&lt;br /&gt;
                                (string-append lt rt)&lt;br /&gt;
                                (make-concat-markup (list lt rt))))&lt;br /&gt;
                      ;; Right-align `ltrt` to the right side.&lt;br /&gt;
                      (markup (grob-interpret-markup&lt;br /&gt;
                               grob&lt;br /&gt;
                               (make-translate-markup&lt;br /&gt;
                                (cons (interval-length this-x-ext) 0)&lt;br /&gt;
                                (make-right-align-markup ltrt)))))&lt;br /&gt;
                 ;; Don&#039;t print `left-text`.&lt;br /&gt;
                 (ly:grob-set-property! left-text &#039;stencil #f)&lt;br /&gt;
                 ;; Set text and stencil (which holds all collected&lt;br /&gt;
                 ;; syllables so far) and shift it to the left.&lt;br /&gt;
                 (ly:grob-set-property! grob &#039;text ltrt)&lt;br /&gt;
                 (ly:grob-set-property! grob &#039;stencil markup)&lt;br /&gt;
                 (ly:grob-translate-axis! grob (- delta) X)))))))))&lt;br /&gt;
&lt;br /&gt;
#(define (lyric-hyphen::displace-bounds-first grob)&lt;br /&gt;
   ;; Make very sure this callback isn&#039;t triggered too early.&lt;br /&gt;
   (let ((left (ly:spanner-bound grob LEFT))&lt;br /&gt;
         (right (ly:spanner-bound grob RIGHT)))&lt;br /&gt;
     (ly:grob-property left &#039;after-line-breaking)&lt;br /&gt;
     (ly:grob-property right &#039;after-line-breaking)&lt;br /&gt;
     (ly:lyric-hyphen::print grob)))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
%% demonstration&lt;br /&gt;
&lt;br /&gt;
music = {&lt;br /&gt;
  &amp;lt;&amp;lt;&lt;br /&gt;
    { d&#039;4 4 4 4 |&lt;br /&gt;
      r4 4 4 4 }&lt;br /&gt;
    \addlyrics { suf -- fice  baff -- ling&lt;br /&gt;
                 car -- fuff -- ling }&lt;br /&gt;
  &amp;gt;&amp;gt;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
\markup &amp;quot;Without magnetic lyrics:&amp;quot;&lt;br /&gt;
&lt;br /&gt;
\score {&lt;br /&gt;
  \music&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
\markup &amp;quot;With magnetic lyrics:&amp;quot;&lt;br /&gt;
&lt;br /&gt;
\score {&lt;br /&gt;
  \music&lt;br /&gt;
&lt;br /&gt;
  \layout {&lt;br /&gt;
    \context {&lt;br /&gt;
      \Lyrics&lt;br /&gt;
      \consists #Left_hyphen_pointer_engraver&lt;br /&gt;
      \override LyricText.after-line-breaking =&lt;br /&gt;
        #lyric-text::apply-magnetic-offset!&lt;br /&gt;
      \override LyricHyphen.stencil =&lt;br /&gt;
        #lyric-hyphen::displace-bounds-first&lt;br /&gt;
      \override LyricText.details.squash-threshold = 0.4&lt;br /&gt;
      \override LyricHyphen.minimum-distance = 0&lt;br /&gt;
      \override LyricHyphen.minimum-length = 0.4&lt;br /&gt;
      \override LyricSpace.minimum-distance = 1&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
\paper {&lt;br /&gt;
  line-width = 83\mm&lt;br /&gt;
  ragged-last = ##f&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lilypond&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Vocal music]]&lt;br /&gt;
[[Category:Spacing]]&lt;br /&gt;
[[Category:Snippet]]&lt;/div&gt;</summary>
		<author><name>Lemzwerg</name></author>
	</entry>
	<entry>
		<id>https://wiki.lilypond.community/index.php?title=User_talk:Ksnortum&amp;diff=6564</id>
		<title>User talk:Ksnortum</title>
		<link rel="alternate" type="text/html" href="https://wiki.lilypond.community/index.php?title=User_talk:Ksnortum&amp;diff=6564"/>
		<updated>2026-05-18T04:40:52Z</updated>

		<summary type="html">&lt;p&gt;Lemzwerg: /* Templates for convert-ly */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Please be careful while using &#039;Edit&#039; ==&lt;br /&gt;
&lt;br /&gt;
Hello Knute!  There is currently a bug in the &#039;Edit&#039; mode: If you only change some details in the description (i.e., not touching the LilyPond code), the &amp;lt;code&amp;gt;&amp;lt;lilypond&amp;gt;&amp;lt;/code&amp;gt; block gets ‘destroyed’ and is no longer rendered as an image.  Please use &#039;Edit source&#039; instead for the time being to avoid that. -- [[User:Lemzwerg|Lemzwerg]] ([[User talk:Lemzwerg|talk]]) 17:26, 8 April 2026 (UTC)&lt;br /&gt;
&lt;br /&gt;
:Got it, thanks. [[User:Ksnortum|Ksnortum]] ([[User talk:Ksnortum|talk]]) 19:34, 8 April 2026 (UTC)&lt;br /&gt;
:...and thanks for cleaning up the mess! [[User:Ksnortum|Ksnortum]] ([[User talk:Ksnortum|talk]]) 14:58, 10 April 2026 (UTC)&lt;br /&gt;
::You&#039;re welcome! -- [[User:Lemzwerg|Lemzwerg]] ([[User talk:Lemzwerg|talk]]) 15:44, 10 April 2026 (UTC)&lt;br /&gt;
&lt;br /&gt;
== Templates for convert-ly ==&lt;br /&gt;
&lt;br /&gt;
I noticed that there are templates for convert-ly-stable (pointing to 2.24) and convery-ly-devel (pointing to 2.25).  Should these be changed to 2.26 and 2.27 respectively?  The template for convert-ly-devel is only used in a handful of places and convert-ly-stable doesn&#039;t look like it&#039;s used at all. --[[User:Ksnortum|Ksnortum]] ([[User talk:Ksnortum|talk]]) 19:05, 17 May 2026 (UTC)&lt;br /&gt;
&lt;br /&gt;
: In the long run, yes.  I suggest we wait for 2.26.1, then the transition to 2.26 could start in the Wiki for all snippets. -- [[User:Lemzwerg|Lemzwerg]] ([[User talk:Lemzwerg|talk]]) 04:40, 18 May 2026 (UTC)&lt;/div&gt;</summary>
		<author><name>Lemzwerg</name></author>
	</entry>
	<entry>
		<id>https://wiki.lilypond.community/index.php?title=Time_signature_with_alternate_in_parentheses&amp;diff=6541</id>
		<title>Time signature with alternate in parentheses</title>
		<link rel="alternate" type="text/html" href="https://wiki.lilypond.community/index.php?title=Time_signature_with_alternate_in_parentheses&amp;diff=6541"/>
		<updated>2026-04-15T04:35:44Z</updated>

		<summary type="html">&lt;p&gt;Lemzwerg: Aaand another improvement.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;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.&lt;br /&gt;
&lt;br /&gt;
This snippet provides a music function &amp;lt;code&amp;gt;\timeP&amp;lt;/code&amp;gt; that is a small Scheme wrapper around the &amp;lt;code&amp;gt;\compound-meter&amp;lt;/code&amp;gt; markup function.  It overrides the &amp;lt;code&amp;gt;TimeSignature&amp;lt;/code&amp;gt; stencil once to display both a regular and an alternate time signature.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lilypond version=&amp;quot;2.24&amp;quot;&amp;gt;&lt;br /&gt;
timeP =&lt;br /&gt;
#(define-music-function (t tp) (list? list?)&lt;br /&gt;
   (define ((time-parenthesized-time t tp) grob)&lt;br /&gt;
     (let ((m1 (grob-interpret-markup&lt;br /&gt;
                grob (markup #:compound-meter t)))&lt;br /&gt;
           (m2 (grob-interpret-markup&lt;br /&gt;
                grob (markup #:compound-meter tp))))&lt;br /&gt;
       (ly:stencil-combine-at-edge&lt;br /&gt;
        m1 X RIGHT&lt;br /&gt;
        (parenthesize-stencil m2 0.1 0.4 0.4 0.1)&lt;br /&gt;
        0.3)))&lt;br /&gt;
   #{&lt;br /&gt;
     \once \override Timing.TimeSignature.stencil =&lt;br /&gt;
       #(time-parenthesized-time t tp)&lt;br /&gt;
   #})&lt;br /&gt;
&lt;br /&gt;
\relative c&#039; {&lt;br /&gt;
  \timeP #&#039;(3 4) #&#039;(6 8) \time 3/4&lt;br /&gt;
    b8 b8 gis8 gis4 gis8 |&lt;br /&gt;
  \timeP #&#039;(4 4) #&#039;(3 2 3 8) \time 4/4&lt;br /&gt;
    b4. b4 b4.&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lilypond&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Rhythms]]&lt;br /&gt;
[[Category:Scheme]]&lt;br /&gt;
[[Category:Snippet]]&lt;/div&gt;</summary>
		<author><name>Lemzwerg</name></author>
	</entry>
	<entry>
		<id>https://wiki.lilypond.community/index.php?title=Time_signature_with_alternate_in_parentheses&amp;diff=6540</id>
		<title>Time signature with alternate in parentheses</title>
		<link rel="alternate" type="text/html" href="https://wiki.lilypond.community/index.php?title=Time_signature_with_alternate_in_parentheses&amp;diff=6540"/>
		<updated>2026-04-15T04:10:29Z</updated>

		<summary type="html">&lt;p&gt;Lemzwerg: Improve more.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;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.&lt;br /&gt;
&lt;br /&gt;
This snippet provides a small Scheme wrapper around the &amp;lt;code&amp;gt;\compound-meter&amp;lt;/code&amp;gt; markup function that can be used to override the &amp;lt;code&amp;gt;TimeSignature&amp;lt;/code&amp;gt; stencil, displaying both a regular and an alternate time signature.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lilypond version=&amp;quot;2.24&amp;quot;&amp;gt;&lt;br /&gt;
#(define ((time-parenthesized-time t tp) grob)&lt;br /&gt;
   (let ((m1 (grob-interpret-markup&lt;br /&gt;
              grob (markup #:compound-meter t)))&lt;br /&gt;
         (m2 (grob-interpret-markup&lt;br /&gt;
              grob (markup #:compound-meter tp))))&lt;br /&gt;
     (ly:stencil-combine-at-edge&lt;br /&gt;
      m1 X RIGHT&lt;br /&gt;
      (parenthesize-stencil m2 0.1 0.4 0.4 0.1)&lt;br /&gt;
      0.3)))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
\relative c&#039; {&lt;br /&gt;
  \once \override Staff.TimeSignature.stencil =&lt;br /&gt;
    #(time-parenthesized-time &#039;(3 4) &#039;(6 8))&lt;br /&gt;
  \time 3/4 b8 b8 gis8 gis4 gis8 |&lt;br /&gt;
  \once \override Staff.TimeSignature.stencil =&lt;br /&gt;
    #(time-parenthesized-time &#039;(4 4) &#039;(3 2 3 8))&lt;br /&gt;
  \time 4/4 b4. b4 b4.&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lilypond&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Rhythms]]&lt;br /&gt;
[[Category:Scheme]]&lt;br /&gt;
[[Category:Snippet]]&lt;/div&gt;</summary>
		<author><name>Lemzwerg</name></author>
	</entry>
	<entry>
		<id>https://wiki.lilypond.community/index.php?title=Time_signature_with_alternate_in_parentheses&amp;diff=6539</id>
		<title>Time signature with alternate in parentheses</title>
		<link rel="alternate" type="text/html" href="https://wiki.lilypond.community/index.php?title=Time_signature_with_alternate_in_parentheses&amp;diff=6539"/>
		<updated>2026-04-14T20:42:54Z</updated>

		<summary type="html">&lt;p&gt;Lemzwerg: Improved&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;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.&lt;br /&gt;
&lt;br /&gt;
This snippet uses a small Scheme function that overrides the &amp;lt;code&amp;gt;TimeSignature&amp;lt;/code&amp;gt; stencil once to display both the regular and the alternate time signature.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lilypond version=&amp;quot;2.24&amp;quot;&amp;gt;&lt;br /&gt;
#(define ((time-parenthesized-time up down upp downp) grob)&lt;br /&gt;
   (let ((m1 (grob-interpret-markup&lt;br /&gt;
              grob&lt;br /&gt;
              (markup #:override &#039;(baseline-skip . 0)&lt;br /&gt;
                      #:number (#:center-column&lt;br /&gt;
                                ((number-&amp;gt;string up)&lt;br /&gt;
                                 (number-&amp;gt;string down))))))&lt;br /&gt;
         (m2 (grob-interpret-markup&lt;br /&gt;
              grob&lt;br /&gt;
              (markup #:override &#039;(baseline-skip . 0)&lt;br /&gt;
                      #:number (#:center-column&lt;br /&gt;
                                ((number-&amp;gt;string upp)&lt;br /&gt;
                                 (number-&amp;gt;string downp)))))))&lt;br /&gt;
     (ly:stencil-combine-at-edge&lt;br /&gt;
      m1 X RIGHT&lt;br /&gt;
      (parenthesize-stencil m2 0.1 0.4 0.4 0.1)&lt;br /&gt;
      0.3)))&lt;br /&gt;
&lt;br /&gt;
\relative c&#039; {&lt;br /&gt;
  \once \override Staff.TimeSignature.stencil =&lt;br /&gt;
    #(time-parenthesized-time 3 4 6 8)&lt;br /&gt;
  \time 3/4 b8 b8 gis8 gis4 gis8 |&lt;br /&gt;
  \time 4/4 b4 b b b&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lilypond&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Rhythms]]&lt;br /&gt;
[[Category:Scheme]]&lt;br /&gt;
[[Category:Snippet]]&lt;/div&gt;</summary>
		<author><name>Lemzwerg</name></author>
	</entry>
	<entry>
		<id>https://wiki.lilypond.community/index.php?title=User_talk:Ksnortum&amp;diff=6537</id>
		<title>User talk:Ksnortum</title>
		<link rel="alternate" type="text/html" href="https://wiki.lilypond.community/index.php?title=User_talk:Ksnortum&amp;diff=6537"/>
		<updated>2026-04-10T15:44:01Z</updated>

		<summary type="html">&lt;p&gt;Lemzwerg: /* Please be careful while using &amp;#039;Edit&amp;#039; */ Reply&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Please be careful while using &#039;Edit&#039; ==&lt;br /&gt;
&lt;br /&gt;
Hello Knute!  There is currently a bug in the &#039;Edit&#039; mode: If you only change some details in the description (i.e., not touching the LilyPond code), the &amp;lt;code&amp;gt;&amp;lt;lilypond&amp;gt;&amp;lt;/code&amp;gt; block gets ‘destroyed’ and is no longer rendered as an image.  Please use &#039;Edit source&#039; instead for the time being to avoid that. -- [[User:Lemzwerg|Lemzwerg]] ([[User talk:Lemzwerg|talk]]) 17:26, 8 April 2026 (UTC)&lt;br /&gt;
&lt;br /&gt;
:Got it, thanks. [[User:Ksnortum|Ksnortum]] ([[User talk:Ksnortum|talk]]) 19:34, 8 April 2026 (UTC)&lt;br /&gt;
:...and thanks for cleaning up the mess! [[User:Ksnortum|Ksnortum]] ([[User talk:Ksnortum|talk]]) 14:58, 10 April 2026 (UTC)&lt;br /&gt;
::You&#039;re welcome! -- [[User:Lemzwerg|Lemzwerg]] ([[User talk:Lemzwerg|talk]]) 15:44, 10 April 2026 (UTC)&lt;/div&gt;</summary>
		<author><name>Lemzwerg</name></author>
	</entry>
	<entry>
		<id>https://wiki.lilypond.community/index.php?title=Clef_change_at_the_beginning_of_a_piece_(alternative)&amp;diff=6534</id>
		<title>Clef change at the beginning of a piece (alternative)</title>
		<link rel="alternate" type="text/html" href="https://wiki.lilypond.community/index.php?title=Clef_change_at_the_beginning_of_a_piece_(alternative)&amp;diff=6534"/>
		<updated>2026-04-08T17:29:32Z</updated>

		<summary type="html">&lt;p&gt;Lemzwerg: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;When changing the clef at the beginning of the first measure, Lilypond just changes the clef for the staff. This is how to keep the staff clef and add an extra clef after the time signature and before the first note.  See also [[Initial clef change]] and [[Clef change at the beginning of a piece]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lilypond version=&amp;quot;2.24&amp;quot;&amp;gt;&lt;br /&gt;
\relative c&#039; {&lt;br /&gt;
  %%  Start with a bass clef :&lt;br /&gt;
  \clef bass&lt;br /&gt;
  %%  Use a hidden grace note:&lt;br /&gt;
  \once\hideNotes\grace c64&lt;br /&gt;
  %%  Adjust the clef spacing:&lt;br /&gt;
  \once\override Staff.Clef.X-extent = #&#039;(1 . 2)&lt;br /&gt;
  %%  Put in the treble clef:&lt;br /&gt;
  \clef treble&lt;br /&gt;
  c4 c c c | c1&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lilypond&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Staff notation]]&lt;br /&gt;
[[Category:Pitches]]&lt;br /&gt;
[[Category:Tweaks and overrides]]&lt;br /&gt;
[[Category:Snippet]]&lt;/div&gt;</summary>
		<author><name>Lemzwerg</name></author>
	</entry>
	<entry>
		<id>https://wiki.lilypond.community/index.php?title=Clef_change_at_the_beginning_of_a_piece_(alternative)&amp;diff=6533</id>
		<title>Clef change at the beginning of a piece (alternative)</title>
		<link rel="alternate" type="text/html" href="https://wiki.lilypond.community/index.php?title=Clef_change_at_the_beginning_of_a_piece_(alternative)&amp;diff=6533"/>
		<updated>2026-04-08T17:29:02Z</updated>

		<summary type="html">&lt;p&gt;Lemzwerg: Reverted edit by Ksnortum (talk) to last revision by Jean Abou Samra&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;When changing the clef at the beginning of the first measure, Lilypond just changes the clef for the staff. This is how to keep the staff clef and add an extra clef after the time signature and before the first note.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lilypond version=&amp;quot;2.24&amp;quot;&amp;gt;&lt;br /&gt;
\relative c&#039; {&lt;br /&gt;
  %%  Start with a bass clef :&lt;br /&gt;
  \clef bass&lt;br /&gt;
  %%  Use a hidden grace note:&lt;br /&gt;
  \once\hideNotes\grace c64&lt;br /&gt;
  %%  Adjust the clef spacing:&lt;br /&gt;
  \once\override Staff.Clef.X-extent = #&#039;(1 . 2)&lt;br /&gt;
  %%  Put in the treble clef:&lt;br /&gt;
  \clef treble&lt;br /&gt;
  c4 c c c | c1&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lilypond&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Staff notation]]&lt;br /&gt;
[[Category:Pitches]]&lt;br /&gt;
[[Category:Tweaks and overrides]]&lt;br /&gt;
[[Category:Snippet]]&lt;/div&gt;</summary>
		<author><name>Lemzwerg</name></author>
	</entry>
	<entry>
		<id>https://wiki.lilypond.community/index.php?title=Clef_change_at_the_beginning_of_a_piece&amp;diff=6532</id>
		<title>Clef change at the beginning of a piece</title>
		<link rel="alternate" type="text/html" href="https://wiki.lilypond.community/index.php?title=Clef_change_at_the_beginning_of_a_piece&amp;diff=6532"/>
		<updated>2026-04-08T17:28:29Z</updated>

		<summary type="html">&lt;p&gt;Lemzwerg: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;When changing the clef at the beginning of the first measure, Lilypond just changes the clef for the staff. This is how to keep the staff clef and add an extra clef after the time signature and before the first note.  See also [[Clef change at the beginning of a piece (alternative)]] and [[Initial clef change]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lilypond version=&amp;quot;2.24&amp;quot;&amp;gt;&lt;br /&gt;
%% http://lsr.di.unimi.it/LSR/Item?id=792&lt;br /&gt;
%% see also http://lilypond.org/doc/stable/Documentation/notation/displaying-pitches&lt;br /&gt;
&lt;br /&gt;
% Append markup in the text property to the grob&lt;br /&gt;
#(define (append-markup grob old-stencil)&lt;br /&gt;
  (ly:stencil-combine-at-edge&lt;br /&gt;
    old-stencil X RIGHT (ly:text-interface::print grob)))&lt;br /&gt;
&lt;br /&gt;
trebleToBass = {&lt;br /&gt;
  \clef bass&lt;br /&gt;
  % Fake staff clef appearance&lt;br /&gt;
  \once \override Staff.Clef.glyph-name = #&amp;quot;clefs.G&amp;quot;&lt;br /&gt;
  \once \override Staff.Clef.Y-offset = #-1&lt;br /&gt;
  % Make sure any key signatures will printed with respect to&lt;br /&gt;
  % correct middle c position expected for treble clef&lt;br /&gt;
  \once \set Staff.middleCClefPosition = -6&lt;br /&gt;
  % Append change clef to the time signature&lt;br /&gt;
  \once \override Staff.TimeSignature.text = \markup {&lt;br /&gt;
    \hspace #1.2&lt;br /&gt;
    \raise #1&lt;br /&gt;
    \musicglyph &amp;quot;clefs.F_change&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
  \once \override Staff.TimeSignature.stencil = #(lambda (grob)&lt;br /&gt;
    (append-markup grob (ly:time-signature::print grob)))&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
bassToTreble = {&lt;br /&gt;
  \clef treble&lt;br /&gt;
  % Fake staff clef appearance&lt;br /&gt;
  \once \override Staff.Clef.glyph-name = #&amp;quot;clefs.F&amp;quot;&lt;br /&gt;
  \once \override Staff.Clef.Y-offset = #1&lt;br /&gt;
  % Make sure any key signatures will printed with respect to&lt;br /&gt;
  % correct middle c position expected for bass clef&lt;br /&gt;
  \once \set Staff.middleCClefPosition = 6&lt;br /&gt;
  % Append change clef to the time signature&lt;br /&gt;
  \once \override Staff.TimeSignature.text = \markup {&lt;br /&gt;
    \hspace #1.2&lt;br /&gt;
    \lower #1&lt;br /&gt;
    \musicglyph &amp;quot;clefs.G_change&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
  \once \override Staff.TimeSignature.stencil = #(lambda (grob)&lt;br /&gt;
    (append-markup grob (ly:time-signature::print grob)))&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
\relative c {&lt;br /&gt;
  \trebleToBass&lt;br /&gt;
  \key f \major&lt;br /&gt;
  c4 d e f&lt;br /&gt;
  % This should not be visible&lt;br /&gt;
  \clef bass&lt;br /&gt;
  g a b c&lt;br /&gt;
  % This should be visible&lt;br /&gt;
  \clef treble&lt;br /&gt;
  d e f g&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lilypond&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Staff notation]]&lt;br /&gt;
[[Category:Staff notation]]&lt;br /&gt;
[[Category:Pitches]]&lt;br /&gt;
[[Category:Tweaks and overrides]]&lt;br /&gt;
[[Category:Snippet]]&lt;/div&gt;</summary>
		<author><name>Lemzwerg</name></author>
	</entry>
	<entry>
		<id>https://wiki.lilypond.community/index.php?title=Clef_change_at_the_beginning_of_a_piece&amp;diff=6531</id>
		<title>Clef change at the beginning of a piece</title>
		<link rel="alternate" type="text/html" href="https://wiki.lilypond.community/index.php?title=Clef_change_at_the_beginning_of_a_piece&amp;diff=6531"/>
		<updated>2026-04-08T17:27:58Z</updated>

		<summary type="html">&lt;p&gt;Lemzwerg: Reverted edit by Ksnortum (talk) to last revision by Lemzwerg&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;When changing the clef at the beginning of the first measure, Lilypond just changes the clef for the staff. This is how to keep the staff clef and add an extra clef after the time signature and before the first note.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lilypond version=&amp;quot;2.24&amp;quot;&amp;gt;&lt;br /&gt;
%% http://lsr.di.unimi.it/LSR/Item?id=792&lt;br /&gt;
%% see also http://lilypond.org/doc/stable/Documentation/notation/displaying-pitches&lt;br /&gt;
&lt;br /&gt;
% Append markup in the text property to the grob&lt;br /&gt;
#(define (append-markup grob old-stencil)&lt;br /&gt;
  (ly:stencil-combine-at-edge&lt;br /&gt;
    old-stencil X RIGHT (ly:text-interface::print grob)))&lt;br /&gt;
&lt;br /&gt;
trebleToBass = {&lt;br /&gt;
  \clef bass&lt;br /&gt;
  % Fake staff clef appearance&lt;br /&gt;
  \once \override Staff.Clef.glyph-name = #&amp;quot;clefs.G&amp;quot;&lt;br /&gt;
  \once \override Staff.Clef.Y-offset = #-1&lt;br /&gt;
  % Make sure any key signatures will printed with respect to&lt;br /&gt;
  % correct middle c position expected for treble clef&lt;br /&gt;
  \once \set Staff.middleCClefPosition = -6&lt;br /&gt;
  % Append change clef to the time signature&lt;br /&gt;
  \once \override Staff.TimeSignature.text = \markup {&lt;br /&gt;
    \hspace #1.2&lt;br /&gt;
    \raise #1&lt;br /&gt;
    \musicglyph &amp;quot;clefs.F_change&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
  \once \override Staff.TimeSignature.stencil = #(lambda (grob)&lt;br /&gt;
    (append-markup grob (ly:time-signature::print grob)))&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
bassToTreble = {&lt;br /&gt;
  \clef treble&lt;br /&gt;
  % Fake staff clef appearance&lt;br /&gt;
  \once \override Staff.Clef.glyph-name = #&amp;quot;clefs.F&amp;quot;&lt;br /&gt;
  \once \override Staff.Clef.Y-offset = #1&lt;br /&gt;
  % Make sure any key signatures will printed with respect to&lt;br /&gt;
  % correct middle c position expected for bass clef&lt;br /&gt;
  \once \set Staff.middleCClefPosition = 6&lt;br /&gt;
  % Append change clef to the time signature&lt;br /&gt;
  \once \override Staff.TimeSignature.text = \markup {&lt;br /&gt;
    \hspace #1.2&lt;br /&gt;
    \lower #1&lt;br /&gt;
    \musicglyph &amp;quot;clefs.G_change&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
  \once \override Staff.TimeSignature.stencil = #(lambda (grob)&lt;br /&gt;
    (append-markup grob (ly:time-signature::print grob)))&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
\relative c {&lt;br /&gt;
  \trebleToBass&lt;br /&gt;
  \key f \major&lt;br /&gt;
  c4 d e f&lt;br /&gt;
  % This should not be visible&lt;br /&gt;
  \clef bass&lt;br /&gt;
  g a b c&lt;br /&gt;
  % This should be visible&lt;br /&gt;
  \clef treble&lt;br /&gt;
  d e f g&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lilypond&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Staff notation]]&lt;br /&gt;
[[Category:Staff notation]]&lt;br /&gt;
[[Category:Pitches]]&lt;br /&gt;
[[Category:Tweaks and overrides]]&lt;br /&gt;
[[Category:Snippet]]&lt;/div&gt;</summary>
		<author><name>Lemzwerg</name></author>
	</entry>
	<entry>
		<id>https://wiki.lilypond.community/index.php?title=User_talk:Ksnortum&amp;diff=6530</id>
		<title>User talk:Ksnortum</title>
		<link rel="alternate" type="text/html" href="https://wiki.lilypond.community/index.php?title=User_talk:Ksnortum&amp;diff=6530"/>
		<updated>2026-04-08T17:26:25Z</updated>

		<summary type="html">&lt;p&gt;Lemzwerg: /* Please be careful while using &amp;#039;Edit&amp;#039; */ new section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Please be careful while using &#039;Edit&#039; ==&lt;br /&gt;
&lt;br /&gt;
Hello Knute!  There is currently a bug in the &#039;Edit&#039; mode: If you only change some details in the description (i.e., not touching the LilyPond code), the &amp;lt;code&amp;gt;&amp;lt;lilypond&amp;gt;&amp;lt;/code&amp;gt; block gets ‘destroyed’ and is no longer rendered as an image.  Please use &#039;Edit source&#039; instead for the time being to avoid that. -- [[User:Lemzwerg|Lemzwerg]] ([[User talk:Lemzwerg|talk]]) 17:26, 8 April 2026 (UTC)&lt;/div&gt;</summary>
		<author><name>Lemzwerg</name></author>
	</entry>
	<entry>
		<id>https://wiki.lilypond.community/index.php?title=Initial_clef_change&amp;diff=6529</id>
		<title>Initial clef change</title>
		<link rel="alternate" type="text/html" href="https://wiki.lilypond.community/index.php?title=Initial_clef_change&amp;diff=6529"/>
		<updated>2026-04-08T17:22:41Z</updated>

		<summary type="html">&lt;p&gt;Lemzwerg: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This snippet handles initial clef changes with a custom engraver. This engraver checks whether there is a difference between the initial clef (as given by &amp;lt;code&amp;gt;\with { \clef ... }&amp;lt;/code&amp;gt; and the clef at the first timestep. If any difference is encountered a new clef (spaced like a cue clef) is created, while the original clef and any key signatures are modified to look like the initial clef values.  See also the snippets [[Clef change at the beginning of a piece]] and [[Clef change at the beginning of a piece (alternative)]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lilypond version=&amp;quot;2.24&amp;quot;&amp;gt;&lt;br /&gt;
%%% This engraver records the initial clef properties (e.g. what is set by \with { \clef ... })&lt;br /&gt;
%%% If in the first timestep these changed, engrave the original clef, and change formatting and break&lt;br /&gt;
%%% alignment of the actual clef to mimic a clef change clef. Duplicates some procedure from clef engraver&lt;br /&gt;
%%% and could easily be integrated.&lt;br /&gt;
#(define (initial-clef-change-engraver context)&lt;br /&gt;
   (let ((initial-clef-properties #f) (cclef #f) (keysigs &#039;()))&lt;br /&gt;
     ; macro for checking if any clef property has changed&lt;br /&gt;
     (define (clef-changed)&lt;br /&gt;
       (&amp;gt;&lt;br /&gt;
        (length initial-clef-properties)&lt;br /&gt;
        (length&lt;br /&gt;
         (filter&lt;br /&gt;
          (lambda (x) (equal? (cdr x) (ly:context-property context (car x))))&lt;br /&gt;
          initial-clef-properties))))&lt;br /&gt;
     (make-engraver&lt;br /&gt;
      ; Record initials propertis&lt;br /&gt;
      ((initialize engraver)&lt;br /&gt;
       (set!&lt;br /&gt;
        initial-clef-properties&lt;br /&gt;
        `((clefGlyph . ,(ly:context-property context &#039;clefGlyph))&lt;br /&gt;
          (clefPosition  . ,(ly:context-property context &#039;clefPosition))&lt;br /&gt;
          (middleCClefPosition . ,(ly:context-property context &#039;middleCClefPosition))&lt;br /&gt;
          (clefTransposition  . ,(ly:context-property context &#039;clefTransposition)))))&lt;br /&gt;
      ; Record the actual clef to adjust. Use details.muted to not acknowledge clef created by this engraver.&lt;br /&gt;
      (acknowledgers&lt;br /&gt;
       ((clef-interface engraver grob source-engraver)&lt;br /&gt;
        (if (not (assoc-get &#039;muted (ly:grob-property grob &#039;details) #f))&lt;br /&gt;
            (set! cclef grob)))&lt;br /&gt;
       ((key-signature-interface engraver grob source-engraver)&lt;br /&gt;
        (set! keysigs (cons grob keysigs))))&lt;br /&gt;
      ; Create a clef if necessary&lt;br /&gt;
      ((process-music engraver)&lt;br /&gt;
       (if (and initial-clef-properties (clef-changed))&lt;br /&gt;
           (let ((clef (ly:engraver-make-grob engraver &#039;Clef &#039;())))&lt;br /&gt;
             (ly:grob-set-property! clef &#039;staff-position (assoc-get &#039;clefPosition initial-clef-properties))&lt;br /&gt;
             (ly:grob-set-property! clef &#039;glyph (assoc-get &#039;clefGlyph initial-clef-properties))&lt;br /&gt;
             (ly:grob-set-nested-property! clef &#039;(details muted) #t)&lt;br /&gt;
             (if ((lambda (x) (and (number? x) (not (= 0 x))))&lt;br /&gt;
                  (assoc-get &#039;clefTransposition initial-clef-properties 0))&lt;br /&gt;
                 (let ((mod (ly:engraver-make-grob engraver &#039;ClefModifier &#039;()))&lt;br /&gt;
                       (formatter (ly:context-property context &#039;clefTranspositionFormatter))&lt;br /&gt;
                       (style (ly:context-property context &#039;clefTranspositionStyle))&lt;br /&gt;
                       (dir (sign (assoc-get &#039;clefTransposition initial-clef-properties 0)))&lt;br /&gt;
                       (abs_trans (1+ (abs (assoc-get &#039;clefTransposition initial-clef-properties 0)))))&lt;br /&gt;
                   (if (procedure? formatter)&lt;br /&gt;
                       (ly:grob-set-property! mod &#039;text (formatter (number-&amp;gt;string abs_trans) style)))&lt;br /&gt;
                   (ly:grob-set-object! mod &#039;side-support-elements (ly:grob-list-&amp;gt;grob-array (list clef)))&lt;br /&gt;
                   (ly:grob-set-parent! mod X clef)&lt;br /&gt;
                   (ly:grob-set-parent! mod Y clef)&lt;br /&gt;
                   (ly:grob-set-property! mod &#039;direction dir))))))&lt;br /&gt;
      ; Adjust the actual clef and key signatures&lt;br /&gt;
      ((process-acknowledged engraver)&lt;br /&gt;
       (if (and cclef initial-clef-properties (clef-changed))&lt;br /&gt;
           (begin&lt;br /&gt;
&lt;br /&gt;
            ; Key signatures need to be handled if they appear before the cue-clef&lt;br /&gt;
            ; This requires the break alignment information, so this only sets a&lt;br /&gt;
            ; hook which will be processed during `before-line-breaking` of the&lt;br /&gt;
            ; BreakAlignGroups&lt;br /&gt;
            (for-each&lt;br /&gt;
             (lambda (keysig)&lt;br /&gt;
               (let ((det (ly:grob-property keysig &#039;details))&lt;br /&gt;
                     (initial-clef-properties initial-clef-properties))&lt;br /&gt;
                 (ly:grob-set-property!&lt;br /&gt;
                  keysig&lt;br /&gt;
                  &#039;details&lt;br /&gt;
                  (acons&lt;br /&gt;
                   &#039;break-alignment-handler&lt;br /&gt;
                   (lambda (grob break-alignment)&lt;br /&gt;
                     (let ((start-of-line&lt;br /&gt;
                            (vector-ref&lt;br /&gt;
                             (ly:grob-property break-alignment &#039;break-align-orders)&lt;br /&gt;
                             2)))&lt;br /&gt;
                       (if (member &#039;cue-clef (or (member &#039;key-signature start-of-line) &#039;()))&lt;br /&gt;
                           (ly:grob-set-property!&lt;br /&gt;
                            grob &#039;c0-position&lt;br /&gt;
                            (assoc-get &#039;middleCClefPosition initial-clef-properties)))))&lt;br /&gt;
                   det))))&lt;br /&gt;
             keysigs)&lt;br /&gt;
&lt;br /&gt;
            (ly:grob-set-property! cclef &#039;non-default #t)&lt;br /&gt;
            (ly:grob-set-property! cclef &#039;break-align-symbol &#039;cue-clef)&lt;br /&gt;
            (if (not (eq? #t (ly:grob-property cclef &#039;full-size-change)))&lt;br /&gt;
                (ly:grob-set-property! cclef &#039;glyph-name&lt;br /&gt;
                                      (format #f &amp;quot;~a_change&amp;quot; (ly:grob-property cclef &#039;glyph)))))))&lt;br /&gt;
      ; Unset parameters&lt;br /&gt;
      ((stop-translation-timestep engraver)&lt;br /&gt;
       (set! initial-clef-properties #f)&lt;br /&gt;
       (set! clef #f)&lt;br /&gt;
       (set! keysigs &#039;())))))&lt;br /&gt;
&lt;br /&gt;
\layout {&lt;br /&gt;
  \context {&lt;br /&gt;
    \Staff&lt;br /&gt;
    \consists #initial-clef-change-engraver&lt;br /&gt;
  }&lt;br /&gt;
  \context {&lt;br /&gt;
    \Score&lt;br /&gt;
    \override BreakAlignGroup.before-line-breaking =&lt;br /&gt;
    #(lambda (grob)&lt;br /&gt;
       (let ((grobs (ly:grob-object grob &#039;elements))&lt;br /&gt;
             (break-alignment (ly:grob-parent grob X)))&lt;br /&gt;
         (if (not (null? grobs))&lt;br /&gt;
             (set! grobs (ly:grob-array-&amp;gt;list grobs)))&lt;br /&gt;
         (for-each&lt;br /&gt;
          (lambda (grob)&lt;br /&gt;
            (let* ((det (ly:grob-property grob &#039;details))&lt;br /&gt;
                   (handler (assoc-get &#039;break-alignment-handler det)))&lt;br /&gt;
              (if (procedure? handler)&lt;br /&gt;
                  (handler grob break-alignment))))&lt;br /&gt;
          grobs)))&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
\new Staff \with { \clef &amp;quot;bass^15&amp;quot; } {&lt;br /&gt;
  \key bes\major&lt;br /&gt;
  \clef &amp;quot;treble_8&amp;quot;&lt;br /&gt;
  c&#039;1 c&#039;1&lt;br /&gt;
  \clef bass&lt;br /&gt;
  c&#039;1&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
\score {&lt;br /&gt;
  \layout {&lt;br /&gt;
    \context {&lt;br /&gt;
      \Score&lt;br /&gt;
      \override BreakAlignment.break-align-orders =&lt;br /&gt;
      ##((staff-ellipsis&lt;br /&gt;
          left-edge&lt;br /&gt;
          cue-end-clef&lt;br /&gt;
          ambitus&lt;br /&gt;
          breathing-sign&lt;br /&gt;
          optional-material-end-bracket&lt;br /&gt;
          signum-repetitionis&lt;br /&gt;
          clef&lt;br /&gt;
          cue-clef&lt;br /&gt;
          staff-bar&lt;br /&gt;
          key-cancellation&lt;br /&gt;
          key-signature&lt;br /&gt;
          time-signature&lt;br /&gt;
          optional-material-start-bracket&lt;br /&gt;
          custos)&lt;br /&gt;
         (staff-ellipsis&lt;br /&gt;
          left-edge&lt;br /&gt;
          optional-material-end-bracket&lt;br /&gt;
          cue-end-clef&lt;br /&gt;
          ambitus&lt;br /&gt;
          breathing-sign&lt;br /&gt;
          signum-repetitionis&lt;br /&gt;
          clef&lt;br /&gt;
          cue-clef&lt;br /&gt;
          staff-bar&lt;br /&gt;
          key-cancellation&lt;br /&gt;
          key-signature&lt;br /&gt;
          time-signature&lt;br /&gt;
          optional-material-start-bracket&lt;br /&gt;
          custos)&lt;br /&gt;
         (staff-ellipsis&lt;br /&gt;
          left-edge&lt;br /&gt;
          optional-material-end-bracket&lt;br /&gt;
          ambitus&lt;br /&gt;
          breathing-sign&lt;br /&gt;
          signum-repetitionis&lt;br /&gt;
          clef&lt;br /&gt;
          cue-clef&lt;br /&gt;
          key-cancellation&lt;br /&gt;
          key-signature&lt;br /&gt;
          time-signature&lt;br /&gt;
          staff-bar&lt;br /&gt;
          optional-material-start-bracket&lt;br /&gt;
          custos))&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
  \new Staff \with { \clef &amp;quot;bass^15&amp;quot; } {&lt;br /&gt;
    \key bes\major&lt;br /&gt;
    \clef &amp;quot;treble_8&amp;quot;&lt;br /&gt;
    c&#039;1 c&#039;1&lt;br /&gt;
    \clef bass&lt;br /&gt;
    c&#039;1&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
% Basic usage:&lt;br /&gt;
\score {&lt;br /&gt;
  &amp;lt;&amp;lt;&lt;br /&gt;
    % Just the treble clef&lt;br /&gt;
    \new Staff {&lt;br /&gt;
      \key bes \major&lt;br /&gt;
      c&#039;&#039;1&lt;br /&gt;
    }&lt;br /&gt;
      &lt;br /&gt;
    % Just the bass clef&lt;br /&gt;
    \new Staff \with { \clef bass  } {&lt;br /&gt;
      \key bes \major&lt;br /&gt;
      c1&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    % Initial treble clef, then bass clef&lt;br /&gt;
    \new Staff {&lt;br /&gt;
      \key bes \major&lt;br /&gt;
      \clef bass &lt;br /&gt;
      c1&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    % Initial bass clef, then treble clef&lt;br /&gt;
    \new Staff \with { \clef bass  } {&lt;br /&gt;
      \key bes \major&lt;br /&gt;
      \clef treble &lt;br /&gt;
      c&#039;&#039;1&lt;br /&gt;
    }&lt;br /&gt;
  &amp;gt;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  \layout {&lt;br /&gt;
    \context {&lt;br /&gt;
      \Staff&lt;br /&gt;
      \consists #initial-clef-change-engraver&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lilypond&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Contexts and engravers]]&lt;br /&gt;
[[Category:Scheme]]&lt;br /&gt;
[[Category:Staff notation]]&lt;br /&gt;
[[Category:Snippet]]&lt;/div&gt;</summary>
		<author><name>Lemzwerg</name></author>
	</entry>
	<entry>
		<id>https://wiki.lilypond.community/index.php?title=Initial_clef_change&amp;diff=6528</id>
		<title>Initial clef change</title>
		<link rel="alternate" type="text/html" href="https://wiki.lilypond.community/index.php?title=Initial_clef_change&amp;diff=6528"/>
		<updated>2026-04-08T17:21:45Z</updated>

		<summary type="html">&lt;p&gt;Lemzwerg: Reverted edit by Ksnortum (talk) to last revision by Lemzwerg&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This snippet handles initial clef changes with a custom engraver. This engraver checks whether there is a difference between the initial clef (as given by &amp;lt;code&amp;gt;\with { \clef ... }&amp;lt;/code&amp;gt; and the clef at the first timestep. If any difference is encountered a new clef (spaced like a cue clef) is created, while the original clef and any key signatures are modified to look like the initial clef values.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lilypond version=&amp;quot;2.24&amp;quot;&amp;gt;&lt;br /&gt;
%%% This engraver records the initial clef properties (e.g. what is set by \with { \clef ... })&lt;br /&gt;
%%% If in the first timestep these changed, engrave the original clef, and change formatting and break&lt;br /&gt;
%%% alignment of the actual clef to mimic a clef change clef. Duplicates some procedure from clef engraver&lt;br /&gt;
%%% and could easily be integrated.&lt;br /&gt;
#(define (initial-clef-change-engraver context)&lt;br /&gt;
   (let ((initial-clef-properties #f) (cclef #f) (keysigs &#039;()))&lt;br /&gt;
     ; macro for checking if any clef property has changed&lt;br /&gt;
     (define (clef-changed)&lt;br /&gt;
       (&amp;gt;&lt;br /&gt;
        (length initial-clef-properties)&lt;br /&gt;
        (length&lt;br /&gt;
         (filter&lt;br /&gt;
          (lambda (x) (equal? (cdr x) (ly:context-property context (car x))))&lt;br /&gt;
          initial-clef-properties))))&lt;br /&gt;
     (make-engraver&lt;br /&gt;
      ; Record initials propertis&lt;br /&gt;
      ((initialize engraver)&lt;br /&gt;
       (set!&lt;br /&gt;
        initial-clef-properties&lt;br /&gt;
        `((clefGlyph . ,(ly:context-property context &#039;clefGlyph))&lt;br /&gt;
          (clefPosition  . ,(ly:context-property context &#039;clefPosition))&lt;br /&gt;
          (middleCClefPosition . ,(ly:context-property context &#039;middleCClefPosition))&lt;br /&gt;
          (clefTransposition  . ,(ly:context-property context &#039;clefTransposition)))))&lt;br /&gt;
      ; Record the actual clef to adjust. Use details.muted to not acknowledge clef created by this engraver.&lt;br /&gt;
      (acknowledgers&lt;br /&gt;
       ((clef-interface engraver grob source-engraver)&lt;br /&gt;
        (if (not (assoc-get &#039;muted (ly:grob-property grob &#039;details) #f))&lt;br /&gt;
            (set! cclef grob)))&lt;br /&gt;
       ((key-signature-interface engraver grob source-engraver)&lt;br /&gt;
        (set! keysigs (cons grob keysigs))))&lt;br /&gt;
      ; Create a clef if necessary&lt;br /&gt;
      ((process-music engraver)&lt;br /&gt;
       (if (and initial-clef-properties (clef-changed))&lt;br /&gt;
           (let ((clef (ly:engraver-make-grob engraver &#039;Clef &#039;())))&lt;br /&gt;
             (ly:grob-set-property! clef &#039;staff-position (assoc-get &#039;clefPosition initial-clef-properties))&lt;br /&gt;
             (ly:grob-set-property! clef &#039;glyph (assoc-get &#039;clefGlyph initial-clef-properties))&lt;br /&gt;
             (ly:grob-set-nested-property! clef &#039;(details muted) #t)&lt;br /&gt;
             (if ((lambda (x) (and (number? x) (not (= 0 x))))&lt;br /&gt;
                  (assoc-get &#039;clefTransposition initial-clef-properties 0))&lt;br /&gt;
                 (let ((mod (ly:engraver-make-grob engraver &#039;ClefModifier &#039;()))&lt;br /&gt;
                       (formatter (ly:context-property context &#039;clefTranspositionFormatter))&lt;br /&gt;
                       (style (ly:context-property context &#039;clefTranspositionStyle))&lt;br /&gt;
                       (dir (sign (assoc-get &#039;clefTransposition initial-clef-properties 0)))&lt;br /&gt;
                       (abs_trans (1+ (abs (assoc-get &#039;clefTransposition initial-clef-properties 0)))))&lt;br /&gt;
                   (if (procedure? formatter)&lt;br /&gt;
                       (ly:grob-set-property! mod &#039;text (formatter (number-&amp;gt;string abs_trans) style)))&lt;br /&gt;
                   (ly:grob-set-object! mod &#039;side-support-elements (ly:grob-list-&amp;gt;grob-array (list clef)))&lt;br /&gt;
                   (ly:grob-set-parent! mod X clef)&lt;br /&gt;
                   (ly:grob-set-parent! mod Y clef)&lt;br /&gt;
                   (ly:grob-set-property! mod &#039;direction dir))))))&lt;br /&gt;
      ; Adjust the actual clef and key signatures&lt;br /&gt;
      ((process-acknowledged engraver)&lt;br /&gt;
       (if (and cclef initial-clef-properties (clef-changed))&lt;br /&gt;
           (begin&lt;br /&gt;
&lt;br /&gt;
            ; Key signatures need to be handled if they appear before the cue-clef&lt;br /&gt;
            ; This requires the break alignment information, so this only sets a&lt;br /&gt;
            ; hook which will be processed during `before-line-breaking` of the&lt;br /&gt;
            ; BreakAlignGroups&lt;br /&gt;
            (for-each&lt;br /&gt;
             (lambda (keysig)&lt;br /&gt;
               (let ((det (ly:grob-property keysig &#039;details))&lt;br /&gt;
                     (initial-clef-properties initial-clef-properties))&lt;br /&gt;
                 (ly:grob-set-property!&lt;br /&gt;
                  keysig&lt;br /&gt;
                  &#039;details&lt;br /&gt;
                  (acons&lt;br /&gt;
                   &#039;break-alignment-handler&lt;br /&gt;
                   (lambda (grob break-alignment)&lt;br /&gt;
                     (let ((start-of-line&lt;br /&gt;
                            (vector-ref&lt;br /&gt;
                             (ly:grob-property break-alignment &#039;break-align-orders)&lt;br /&gt;
                             2)))&lt;br /&gt;
                       (if (member &#039;cue-clef (or (member &#039;key-signature start-of-line) &#039;()))&lt;br /&gt;
                           (ly:grob-set-property!&lt;br /&gt;
                            grob &#039;c0-position&lt;br /&gt;
                            (assoc-get &#039;middleCClefPosition initial-clef-properties)))))&lt;br /&gt;
                   det))))&lt;br /&gt;
             keysigs)&lt;br /&gt;
&lt;br /&gt;
            (ly:grob-set-property! cclef &#039;non-default #t)&lt;br /&gt;
            (ly:grob-set-property! cclef &#039;break-align-symbol &#039;cue-clef)&lt;br /&gt;
            (if (not (eq? #t (ly:grob-property cclef &#039;full-size-change)))&lt;br /&gt;
                (ly:grob-set-property! cclef &#039;glyph-name&lt;br /&gt;
                                      (format #f &amp;quot;~a_change&amp;quot; (ly:grob-property cclef &#039;glyph)))))))&lt;br /&gt;
      ; Unset parameters&lt;br /&gt;
      ((stop-translation-timestep engraver)&lt;br /&gt;
       (set! initial-clef-properties #f)&lt;br /&gt;
       (set! clef #f)&lt;br /&gt;
       (set! keysigs &#039;())))))&lt;br /&gt;
&lt;br /&gt;
\layout {&lt;br /&gt;
  \context {&lt;br /&gt;
    \Staff&lt;br /&gt;
    \consists #initial-clef-change-engraver&lt;br /&gt;
  }&lt;br /&gt;
  \context {&lt;br /&gt;
    \Score&lt;br /&gt;
    \override BreakAlignGroup.before-line-breaking =&lt;br /&gt;
    #(lambda (grob)&lt;br /&gt;
       (let ((grobs (ly:grob-object grob &#039;elements))&lt;br /&gt;
             (break-alignment (ly:grob-parent grob X)))&lt;br /&gt;
         (if (not (null? grobs))&lt;br /&gt;
             (set! grobs (ly:grob-array-&amp;gt;list grobs)))&lt;br /&gt;
         (for-each&lt;br /&gt;
          (lambda (grob)&lt;br /&gt;
            (let* ((det (ly:grob-property grob &#039;details))&lt;br /&gt;
                   (handler (assoc-get &#039;break-alignment-handler det)))&lt;br /&gt;
              (if (procedure? handler)&lt;br /&gt;
                  (handler grob break-alignment))))&lt;br /&gt;
          grobs)))&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
\new Staff \with { \clef &amp;quot;bass^15&amp;quot; } {&lt;br /&gt;
  \key bes\major&lt;br /&gt;
  \clef &amp;quot;treble_8&amp;quot;&lt;br /&gt;
  c&#039;1 c&#039;1&lt;br /&gt;
  \clef bass&lt;br /&gt;
  c&#039;1&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
\score {&lt;br /&gt;
  \layout {&lt;br /&gt;
    \context {&lt;br /&gt;
      \Score&lt;br /&gt;
      \override BreakAlignment.break-align-orders =&lt;br /&gt;
      ##((staff-ellipsis&lt;br /&gt;
          left-edge&lt;br /&gt;
          cue-end-clef&lt;br /&gt;
          ambitus&lt;br /&gt;
          breathing-sign&lt;br /&gt;
          optional-material-end-bracket&lt;br /&gt;
          signum-repetitionis&lt;br /&gt;
          clef&lt;br /&gt;
          cue-clef&lt;br /&gt;
          staff-bar&lt;br /&gt;
          key-cancellation&lt;br /&gt;
          key-signature&lt;br /&gt;
          time-signature&lt;br /&gt;
          optional-material-start-bracket&lt;br /&gt;
          custos)&lt;br /&gt;
         (staff-ellipsis&lt;br /&gt;
          left-edge&lt;br /&gt;
          optional-material-end-bracket&lt;br /&gt;
          cue-end-clef&lt;br /&gt;
          ambitus&lt;br /&gt;
          breathing-sign&lt;br /&gt;
          signum-repetitionis&lt;br /&gt;
          clef&lt;br /&gt;
          cue-clef&lt;br /&gt;
          staff-bar&lt;br /&gt;
          key-cancellation&lt;br /&gt;
          key-signature&lt;br /&gt;
          time-signature&lt;br /&gt;
          optional-material-start-bracket&lt;br /&gt;
          custos)&lt;br /&gt;
         (staff-ellipsis&lt;br /&gt;
          left-edge&lt;br /&gt;
          optional-material-end-bracket&lt;br /&gt;
          ambitus&lt;br /&gt;
          breathing-sign&lt;br /&gt;
          signum-repetitionis&lt;br /&gt;
          clef&lt;br /&gt;
          cue-clef&lt;br /&gt;
          key-cancellation&lt;br /&gt;
          key-signature&lt;br /&gt;
          time-signature&lt;br /&gt;
          staff-bar&lt;br /&gt;
          optional-material-start-bracket&lt;br /&gt;
          custos))&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
  \new Staff \with { \clef &amp;quot;bass^15&amp;quot; } {&lt;br /&gt;
    \key bes\major&lt;br /&gt;
    \clef &amp;quot;treble_8&amp;quot;&lt;br /&gt;
    c&#039;1 c&#039;1&lt;br /&gt;
    \clef bass&lt;br /&gt;
    c&#039;1&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
% Basic usage:&lt;br /&gt;
\score {&lt;br /&gt;
  &amp;lt;&amp;lt;&lt;br /&gt;
    % Just the treble clef&lt;br /&gt;
    \new Staff {&lt;br /&gt;
      \key bes \major&lt;br /&gt;
      c&#039;&#039;1&lt;br /&gt;
    }&lt;br /&gt;
      &lt;br /&gt;
    % Just the bass clef&lt;br /&gt;
    \new Staff \with { \clef bass  } {&lt;br /&gt;
      \key bes \major&lt;br /&gt;
      c1&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    % Initial treble clef, then bass clef&lt;br /&gt;
    \new Staff {&lt;br /&gt;
      \key bes \major&lt;br /&gt;
      \clef bass &lt;br /&gt;
      c1&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    % Initial bass clef, then treble clef&lt;br /&gt;
    \new Staff \with { \clef bass  } {&lt;br /&gt;
      \key bes \major&lt;br /&gt;
      \clef treble &lt;br /&gt;
      c&#039;&#039;1&lt;br /&gt;
    }&lt;br /&gt;
  &amp;gt;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  \layout {&lt;br /&gt;
    \context {&lt;br /&gt;
      \Staff&lt;br /&gt;
      \consists #initial-clef-change-engraver&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lilypond&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Contexts and engravers]]&lt;br /&gt;
[[Category:Scheme]]&lt;br /&gt;
[[Category:Staff notation]]&lt;br /&gt;
[[Category:Snippet]]&lt;/div&gt;</summary>
		<author><name>Lemzwerg</name></author>
	</entry>
	<entry>
		<id>https://wiki.lilypond.community/index.php?title=Splitting_chords&amp;diff=6518</id>
		<title>Splitting chords</title>
		<link rel="alternate" type="text/html" href="https://wiki.lilypond.community/index.php?title=Splitting_chords&amp;diff=6518"/>
		<updated>2026-04-07T03:53:53Z</updated>

		<summary type="html">&lt;p&gt;Lemzwerg: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This snippet is a 2009 contribution by Gilles Thibault in [https://lists.gnu.org/archive/html/lilypond-user/2009-01/msg00685.html lilypond-user]. It provides two functions to split a chord sequence into two separate voices, also preserving articulations and slurs: &amp;lt;code&amp;gt;\keepOnlyFirstNote&amp;lt;/code&amp;gt; extracts the first note (as given in the input; this is usually the lowest one) of every chord, and &amp;lt;code&amp;gt;\deleteFirstNote&amp;lt;/code&amp;gt; collects the remaining notes.&lt;br /&gt;
&lt;br /&gt;
Note that these functions don&#039;t support &amp;lt;samp&amp;gt;q&amp;lt;/samp&amp;gt; to repeat the last chord.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lilypond version=&amp;quot;2.24&amp;quot;&amp;gt;&lt;br /&gt;
#(define (has-duration? music)&lt;br /&gt;
   (ly:duration? (ly:music-property music &#039;duration)))&lt;br /&gt;
&lt;br /&gt;
#(define (not-has-duration? music)&lt;br /&gt;
   (not (has-duration? music)))&lt;br /&gt;
&lt;br /&gt;
keepOnlyFirstNote =&lt;br /&gt;
#(define-music-function (parser location music) (ly:music?)&lt;br /&gt;
   (music-map&lt;br /&gt;
    (lambda (evt)&lt;br /&gt;
      (when (eq? &#039;EventChord (ly:music-property evt &#039;name))&lt;br /&gt;
 	(let ((elts (ly:music-property evt &#039;elements)))&lt;br /&gt;
 	  (when (has-duration? (car elts))&lt;br /&gt;
 	    (ly:music-set-property!&lt;br /&gt;
 	     evt &#039;elements&lt;br /&gt;
 	     (cons (car elts)&lt;br /&gt;
 		   (filter not-has-duration? (cdr elts)))))))&lt;br /&gt;
      evt)&lt;br /&gt;
    music))&lt;br /&gt;
&lt;br /&gt;
deleteFirstNote =&lt;br /&gt;
#(define-music-function (parser location music) (ly:music?)&lt;br /&gt;
   (music-map&lt;br /&gt;
    (lambda (evt)&lt;br /&gt;
      (when (eq? &#039;EventChord (ly:music-property evt &#039;name))&lt;br /&gt;
 	(let ((elts (ly:music-property evt &#039;elements)))&lt;br /&gt;
          (when (has-duration? (car elts))&lt;br /&gt;
            (ly:music-set-property! evt &#039;elements  (cdr elts)))))&lt;br /&gt;
      evt)&lt;br /&gt;
    music))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
music = \relative c&#039; {&lt;br /&gt;
  &amp;lt;c e&amp;gt;4-&amp;gt; &amp;lt;d f&amp;gt;( &amp;lt;b g&#039;&amp;gt;) &amp;lt;c e&amp;gt;-. g2 c2&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
\markup { Music with chords }&lt;br /&gt;
\new Staff \music&lt;br /&gt;
&lt;br /&gt;
\markup { Music split into two staves }&lt;br /&gt;
&amp;lt;&amp;lt;&lt;br /&gt;
  \new Staff \deleteFirstNote \music&lt;br /&gt;
  \new Staff \keepOnlyFirstNote \music&lt;br /&gt;
&amp;gt;&amp;gt;&lt;br /&gt;
&amp;lt;/lilypond&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[category:Chords]]&lt;br /&gt;
[[category:Scheme]]&lt;br /&gt;
[[category:Really cool]]&lt;/div&gt;</summary>
		<author><name>Lemzwerg</name></author>
	</entry>
	<entry>
		<id>https://wiki.lilypond.community/index.php?title=Splitting_chords&amp;diff=6517</id>
		<title>Splitting chords</title>
		<link rel="alternate" type="text/html" href="https://wiki.lilypond.community/index.php?title=Splitting_chords&amp;diff=6517"/>
		<updated>2026-04-07T03:51:40Z</updated>

		<summary type="html">&lt;p&gt;Lemzwerg: Not sure how it could happen that changing a single letter in the docstring completely ruined the rendering...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This snippet is a 2009 contribution by Gilles Thibault in [https://lists.gnu.org/archive/html/lilypond-user/2009-01/msg00685.html lilypond-user]. It provides two functions to split a chord sequence into two separate voices, also preserving articulations and slurs: &amp;lt;code&amp;gt;\keepOnlyFirstNote&amp;lt;/code&amp;gt; extracts the first note (as given in the input; this is usually the lowest one) of every chord, and &amp;lt;code&amp;gt;\deleteFirstNote&amp;lt;/code&amp;gt; collects the remaining notes.&lt;br /&gt;
&lt;br /&gt;
Note that these function don&#039;t support &amp;lt;samp&amp;gt;q&amp;lt;/samp&amp;gt; to repeat the last chord.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lilypond version=&amp;quot;2.24&amp;quot;&amp;gt;&lt;br /&gt;
#(define (has-duration? music)&lt;br /&gt;
   (ly:duration? (ly:music-property music &#039;duration)))&lt;br /&gt;
&lt;br /&gt;
#(define (not-has-duration? music)&lt;br /&gt;
   (not (has-duration? music)))&lt;br /&gt;
&lt;br /&gt;
keepOnlyFirstNote =&lt;br /&gt;
#(define-music-function (parser location music) (ly:music?)&lt;br /&gt;
   (music-map&lt;br /&gt;
    (lambda (evt)&lt;br /&gt;
      (when (eq? &#039;EventChord (ly:music-property evt &#039;name))&lt;br /&gt;
 	(let ((elts (ly:music-property evt &#039;elements)))&lt;br /&gt;
 	  (when (has-duration? (car elts))&lt;br /&gt;
 	    (ly:music-set-property!&lt;br /&gt;
 	     evt &#039;elements&lt;br /&gt;
 	     (cons (car elts)&lt;br /&gt;
 		   (filter not-has-duration? (cdr elts)))))))&lt;br /&gt;
      evt)&lt;br /&gt;
    music))&lt;br /&gt;
&lt;br /&gt;
deleteFirstNote =&lt;br /&gt;
#(define-music-function (parser location music) (ly:music?)&lt;br /&gt;
   (music-map&lt;br /&gt;
    (lambda (evt)&lt;br /&gt;
      (when (eq? &#039;EventChord (ly:music-property evt &#039;name))&lt;br /&gt;
 	(let ((elts (ly:music-property evt &#039;elements)))&lt;br /&gt;
          (when (has-duration? (car elts))&lt;br /&gt;
            (ly:music-set-property! evt &#039;elements  (cdr elts)))))&lt;br /&gt;
      evt)&lt;br /&gt;
    music))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
music = \relative c&#039; {&lt;br /&gt;
  &amp;lt;c e&amp;gt;4-&amp;gt; &amp;lt;d f&amp;gt;( &amp;lt;b g&#039;&amp;gt;) &amp;lt;c e&amp;gt;-. g2 c2&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
\markup { Music with chords }&lt;br /&gt;
\new Staff \music&lt;br /&gt;
&lt;br /&gt;
\markup { Music split into two staves }&lt;br /&gt;
&amp;lt;&amp;lt;&lt;br /&gt;
  \new Staff \deleteFirstNote \music&lt;br /&gt;
  \new Staff \keepOnlyFirstNote \music&lt;br /&gt;
&amp;gt;&amp;gt;&lt;br /&gt;
&amp;lt;/lilypond&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[category:Chords]]&lt;br /&gt;
[[category:Scheme]]&lt;br /&gt;
[[category:Really cool]]&lt;/div&gt;</summary>
		<author><name>Lemzwerg</name></author>
	</entry>
	<entry>
		<id>https://wiki.lilypond.community/index.php?title=Splitting_chords&amp;diff=6513</id>
		<title>Splitting chords</title>
		<link rel="alternate" type="text/html" href="https://wiki.lilypond.community/index.php?title=Splitting_chords&amp;diff=6513"/>
		<updated>2026-04-05T09:09:04Z</updated>

		<summary type="html">&lt;p&gt;Lemzwerg: Formatting, improved docstring&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This snippet is a 2009 contribution by Gilles Thibault in [https://lists.gnu.org/archive/html/lilypond-user/2009-01/msg00685.html lilypond-user]. It provides two functions to split a chord sequence into two separate voices, also preserving articulations and slurs: &amp;lt;code&amp;gt;\keepOnlyFirstNode&amp;lt;/code&amp;gt; extracts the first note (as given in the input; this is usually the lowest one) of every chord, and &amp;lt;code&amp;gt;\deleteFirstNote&amp;lt;/code&amp;gt; collects the remaining notes.&lt;br /&gt;
&lt;br /&gt;
Note that these function don&#039;t support &amp;lt;samp&amp;gt;q&amp;lt;/samp&amp;gt; to repeat the last chord.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lilypond version=&amp;quot;2.24&amp;quot;&amp;gt;&lt;br /&gt;
#(define (has-duration? music)&lt;br /&gt;
   (ly:duration? (ly:music-property music &#039;duration)))&lt;br /&gt;
&lt;br /&gt;
#(define (not-has-duration? music)&lt;br /&gt;
   (not (has-duration? music)))&lt;br /&gt;
&lt;br /&gt;
keepOnlyFirstNote =&lt;br /&gt;
#(define-music-function (parser location music) (ly:music?)&lt;br /&gt;
   (music-map&lt;br /&gt;
    (lambda (evt)&lt;br /&gt;
      (when (eq? &#039;EventChord (ly:music-property evt &#039;name))&lt;br /&gt;
	(let ((elts (ly:music-property evt &#039;elements)))&lt;br /&gt;
	  (when (has-duration? (car elts))&lt;br /&gt;
	    (ly:music-set-property!&lt;br /&gt;
	     evt &#039;elements&lt;br /&gt;
	     (cons (car elts)&lt;br /&gt;
		   (filter not-has-duration? (cdr elts)))))))&lt;br /&gt;
      evt)&lt;br /&gt;
    music))&lt;br /&gt;
&lt;br /&gt;
deleteFirstNote =&lt;br /&gt;
#(define-music-function (parser location music) (ly:music?)&lt;br /&gt;
   (music-map&lt;br /&gt;
    (lambda (evt)&lt;br /&gt;
      (when (eq? &#039;EventChord (ly:music-property evt &#039;name))&lt;br /&gt;
	(let ((elts (ly:music-property evt &#039;elements)))&lt;br /&gt;
          (when (has-duration? (car elts))&lt;br /&gt;
            (ly:music-set-property! evt &#039;elements  (cdr elts)))))&lt;br /&gt;
      evt)&lt;br /&gt;
    music))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
music = \relative c&#039; {&lt;br /&gt;
  &amp;lt;c e&amp;gt;4-&amp;gt; &amp;lt;d f&amp;gt;( &amp;lt;b g&#039;&amp;gt;) &amp;lt;c e&amp;gt;-. g2 c2&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
\markup { Music with chords }&lt;br /&gt;
\new Staff \music&lt;br /&gt;
&lt;br /&gt;
\markup { Music split into two staffs }&lt;br /&gt;
&amp;lt;&amp;lt;&lt;br /&gt;
  \new Staff \deleteFirstNote \music&lt;br /&gt;
  \new Staff \keepOnlyFirstNote \music&lt;br /&gt;
&amp;gt;&amp;gt;&lt;br /&gt;
&amp;lt;/lilypond&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[category:Chords]]&lt;br /&gt;
[[category:Scheme]]&lt;br /&gt;
[[category:Really cool]]&lt;/div&gt;</summary>
		<author><name>Lemzwerg</name></author>
	</entry>
	<entry>
		<id>https://wiki.lilypond.community/index.php?title=User_talk:MartialR&amp;diff=6506</id>
		<title>User talk:MartialR</title>
		<link rel="alternate" type="text/html" href="https://wiki.lilypond.community/index.php?title=User_talk:MartialR&amp;diff=6506"/>
		<updated>2026-03-31T11:16:49Z</updated>

		<summary type="html">&lt;p&gt;Lemzwerg: /* Recorder diagrams */ new section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Recorder diagrams ==&lt;br /&gt;
&lt;br /&gt;
Please have a look at [https://wiki.lilypond.community/wiki/Talk:Diagram_for_Recorder_baroque_in_F_and_C#c-Lemzwerg-20260331094100-Better_markup_definitions this comment] -- [[User:Lemzwerg|Lemzwerg]] ([[User talk:Lemzwerg|talk]]) 11:16, 31 March 2026 (UTC)&lt;/div&gt;</summary>
		<author><name>Lemzwerg</name></author>
	</entry>
	<entry>
		<id>https://wiki.lilypond.community/index.php?title=Talk:Diagram_for_Recorder_baroque_in_F_and_C&amp;diff=6505</id>
		<title>Talk:Diagram for Recorder baroque in F and C</title>
		<link rel="alternate" type="text/html" href="https://wiki.lilypond.community/index.php?title=Talk:Diagram_for_Recorder_baroque_in_F_and_C&amp;diff=6505"/>
		<updated>2026-03-31T11:10:26Z</updated>

		<summary type="html">&lt;p&gt;Lemzwerg: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Better markup definitions ==&lt;br /&gt;
&lt;br /&gt;
Please ask for help on the [mailto:lilypond-user@gnu.org &#039;lilypond-user&#039; mailing list] how to write a Scheme function for defining the fingering markups, avoiding tedious repetition!  This will dramatically reduce the size of the definitions, also making them easier to maintain. -- [[User:Lemzwerg|Lemzwerg]] ([[User talk:Lemzwerg|talk]]) 09:41, 31 March 2026 (UTC)&lt;/div&gt;</summary>
		<author><name>Lemzwerg</name></author>
	</entry>
	<entry>
		<id>https://wiki.lilypond.community/index.php?title=Talk:Diagram_for_Recorder_baroque_in_F_and_C&amp;diff=6504</id>
		<title>Talk:Diagram for Recorder baroque in F and C</title>
		<link rel="alternate" type="text/html" href="https://wiki.lilypond.community/index.php?title=Talk:Diagram_for_Recorder_baroque_in_F_and_C&amp;diff=6504"/>
		<updated>2026-03-31T09:41:28Z</updated>

		<summary type="html">&lt;p&gt;Lemzwerg: /* Better markup definitions */ new section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Better markup definitions ==&lt;br /&gt;
&lt;br /&gt;
Please ask for help on the [[mailto:lilypond-user@gnu.org &#039;lilypond-user&#039; mailing list]] how to write a Scheme function for defining the fingering markups, avoiding tedious repetition!  This will dramatically reduce the size of the definitions, also making them easier to maintain. -- [[User:Lemzwerg|Lemzwerg]] ([[User talk:Lemzwerg|talk]]) 09:41, 31 March 2026 (UTC)&lt;/div&gt;</summary>
		<author><name>Lemzwerg</name></author>
	</entry>
	<entry>
		<id>https://wiki.lilypond.community/index.php?title=Key_signatures_for_small_staves&amp;diff=6465</id>
		<title>Key signatures for small staves</title>
		<link rel="alternate" type="text/html" href="https://wiki.lilypond.community/index.php?title=Key_signatures_for_small_staves&amp;diff=6465"/>
		<updated>2026-03-18T18:11:37Z</updated>

		<summary type="html">&lt;p&gt;Lemzwerg: Revised.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Traditionally, the spacing of key signatures in smaller staves is larger in comparison to full-size staves.&lt;br /&gt;
&lt;br /&gt;
Here is a function that extends &amp;lt;code&amp;gt;\magnifyStaff&amp;lt;/code&amp;gt; to automatically calculate the right key signature spacing according to the staff size.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lilypond version=&amp;quot;2.24&amp;quot;&amp;gt;&lt;br /&gt;
scaleStaff =&lt;br /&gt;
#(define-music-function (scaleFac) (number?)&lt;br /&gt;
  #{&lt;br /&gt;
    \magnifyStaff #scaleFac&lt;br /&gt;
    \override KeySignature.padding = #(* 2/3 (- 1 scaleFac))&lt;br /&gt;
  #})&lt;br /&gt;
&lt;br /&gt;
keyTest = { \key cis\major s4*4 \bar &amp;quot;&amp;quot; }&lt;br /&gt;
&lt;br /&gt;
\markup\italic &amp;quot;Default output:&amp;quot;&lt;br /&gt;
&amp;lt;&amp;lt;&lt;br /&gt;
  \new Staff \with { \magnifyStaff #5/7 } \keyTest&lt;br /&gt;
  \new Staff \keyTest&lt;br /&gt;
&amp;gt;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
\markup\italic &amp;quot;Traditional output:&amp;quot;&lt;br /&gt;
&amp;lt;&amp;lt;&lt;br /&gt;
  \new Staff \with { \scaleStaff #5/7 } \keyTest&lt;br /&gt;
  \new Staff \keyTest&lt;br /&gt;
&amp;gt;&amp;gt;&lt;br /&gt;
&amp;lt;/lilypond&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Staff notation]]&lt;br /&gt;
[[Category:Vocal music]]&lt;br /&gt;
[[Category:Spacing]]&lt;br /&gt;
[[Category:Tweaks and overrides]]&lt;br /&gt;
[[Category:Specific notation]]&lt;br /&gt;
[[Category:Workaround]]&lt;br /&gt;
[[Category:Snippet]]&lt;/div&gt;</summary>
		<author><name>Lemzwerg</name></author>
	</entry>
	<entry>
		<id>https://wiki.lilypond.community/index.php?title=LSR_1094&amp;diff=6464</id>
		<title>LSR 1094</title>
		<link rel="alternate" type="text/html" href="https://wiki.lilypond.community/index.php?title=LSR_1094&amp;diff=6464"/>
		<updated>2026-03-18T17:55:16Z</updated>

		<summary type="html">&lt;p&gt;Lemzwerg: Changed redirect target from Key signature and small staff to Key signatures for small staves&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Key signatures for small staves]]&lt;/div&gt;</summary>
		<author><name>Lemzwerg</name></author>
	</entry>
	<entry>
		<id>https://wiki.lilypond.community/index.php?title=Key_signatures_for_small_staves&amp;diff=6463</id>
		<title>Key signatures for small staves</title>
		<link rel="alternate" type="text/html" href="https://wiki.lilypond.community/index.php?title=Key_signatures_for_small_staves&amp;diff=6463"/>
		<updated>2026-03-18T17:54:43Z</updated>

		<summary type="html">&lt;p&gt;Lemzwerg: Lemzwerg moved page Key signature and small staff to Key signatures for small staves without leaving a redirect&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Traditionally, smaller staves key signature spacing is slightly different than full size staves ones.&lt;br /&gt;
&lt;br /&gt;
Here&#039;s a function that automatically calculates the right key signature spacing according to the staff size.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lilypond version=&amp;quot;2.24&amp;quot;&amp;gt;&lt;br /&gt;
%% =&amp;gt; http://lsr.di.unimi.it/LSR/Item?id=1094&lt;br /&gt;
&lt;br /&gt;
%% This extends \staffSize as defined in &lt;br /&gt;
%% &amp;quot;Changing the size of a staff with a music function&amp;quot;&lt;br /&gt;
%% http://lsr.di.unimi.it/LSR/Item?id=862&lt;br /&gt;
staffSize = #(define-music-function (new-size) (number?)&lt;br /&gt;
  #{&lt;br /&gt;
    \set fontSize = #new-size&lt;br /&gt;
    \override StaffSymbol.staff-space = #(magstep new-size)&lt;br /&gt;
    \override StaffSymbol.thickness = #(magstep new-size)&lt;br /&gt;
    \override KeySignature.padding = #(* 2/3 (- 1 (magstep new-size)))&lt;br /&gt;
  #})&lt;br /&gt;
&lt;br /&gt;
keyTest = { \key cis\major s4*4 \bar &amp;quot;&amp;quot; }&lt;br /&gt;
&lt;br /&gt;
\markup\italic &amp;quot;Default output:&amp;quot;&lt;br /&gt;
&amp;lt;&amp;lt;&lt;br /&gt;
  \new Staff \with { &lt;br /&gt;
    fontSize = #-3&lt;br /&gt;
    \override StaffSymbol.staff-space = #(magstep -3)&lt;br /&gt;
    \override StaffSymbol.thickness = #(magstep -3)&lt;br /&gt;
  } \keyTest &lt;br /&gt;
  \new Staff \keyTest &lt;br /&gt;
  &lt;br /&gt;
&amp;gt;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
\markup\italic &amp;quot;Traditional output:&amp;quot;&lt;br /&gt;
&amp;lt;&amp;lt;&lt;br /&gt;
  \new Staff \with { \staffSize #-3 } \keyTest &lt;br /&gt;
  \new Staff \keyTest &lt;br /&gt;
  &lt;br /&gt;
&amp;gt;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%{&lt;br /&gt;
% For v.2.19 and higher:&lt;br /&gt;
&lt;br /&gt;
scaleStaff = #(define-music-function (scaleFac) (number?)&lt;br /&gt;
                 #{&lt;br /&gt;
                   \magnifyStaff #scaleFac&lt;br /&gt;
                   \override KeySignature.padding = #(* 2/3 (- 1 scaleFac))&lt;br /&gt;
                 #})&lt;br /&gt;
&lt;br /&gt;
sizeTest = #5/7&lt;br /&gt;
keyTest = { \key cis\major s4*4 \bar &amp;quot;&amp;quot; }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;&amp;lt;&lt;br /&gt;
  \new Staff \with { \scaleStaff #sizeTest } \keyTest&lt;br /&gt;
  \new Staff \keyTest&lt;br /&gt;
&amp;gt;&amp;gt;&lt;br /&gt;
 %}&lt;br /&gt;
&amp;lt;/lilypond&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Staff notation]]&lt;br /&gt;
[[Category:Vocal music]]&lt;br /&gt;
[[Category:Spacing]]&lt;br /&gt;
[[Category:Contexts and engravers]]&lt;br /&gt;
[[Category:Tweaks and overrides]]&lt;br /&gt;
[[Category:Specific notation]]&lt;br /&gt;
[[Category:Workaround]]&lt;br /&gt;
[[Category:Snippet]]&lt;/div&gt;</summary>
		<author><name>Lemzwerg</name></author>
	</entry>
	<entry>
		<id>https://wiki.lilypond.community/index.php?title=Talk:Airy_tone&amp;diff=6462</id>
		<title>Talk:Airy tone</title>
		<link rel="alternate" type="text/html" href="https://wiki.lilypond.community/index.php?title=Talk:Airy_tone&amp;diff=6462"/>
		<updated>2026-03-18T16:58:38Z</updated>

		<summary type="html">&lt;p&gt;Lemzwerg: /* Circles not displaying in Wiki */ Reply&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Circles not displaying in Wiki ==&lt;br /&gt;
&lt;br /&gt;
The circles are not displaying in the Wiki.  However, if I copy and paste the code and compile it locally, the circles do display.  Does anyone know how to fix this? [[User:Ksnortum|Ksnortum]] ([[User talk:Ksnortum|talk]]) 16:40, 18 March 2026 (UTC)&lt;br /&gt;
&lt;br /&gt;
:The usual thing: The code for drawing the circles is Postscript, which is not supported by the SVG backend used in the Wiki.  It should be rewritten using LilyPond drawing commands. -- [[User:Lemzwerg|Lemzwerg]] ([[User talk:Lemzwerg|talk]]) 16:58, 18 March 2026 (UTC)&lt;/div&gt;</summary>
		<author><name>Lemzwerg</name></author>
	</entry>
	<entry>
		<id>https://wiki.lilypond.community/index.php?title=Feta_font_chart&amp;diff=6459</id>
		<title>Feta font chart</title>
		<link rel="alternate" type="text/html" href="https://wiki.lilypond.community/index.php?title=Feta_font_chart&amp;diff=6459"/>
		<updated>2026-03-16T23:15:20Z</updated>

		<summary type="html">&lt;p&gt;Lemzwerg: Revised&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This chart shows all articulations or scripts that LilyPond&#039;s “feta” font contains.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lilypond version=&amp;quot;2.24&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;&amp;lt;&lt;br /&gt;
  \new Staff \relative c&#039;&#039; {&lt;br /&gt;
    c\accent              c\marcato          c\staccatissimo&lt;br /&gt;
    c\staccato            c\tenuto           c\portato&lt;br /&gt;
    c\upbow               c\downbow          c\flageolet&lt;br /&gt;
    c\thumb               c^\lheel           c\rheel&lt;br /&gt;
    c^\ltoe               c\rtoe             c\open&lt;br /&gt;
    c\stopped             c\turn             c\reverseturn&lt;br /&gt;
    c\trill               c\prall            c\mordent&lt;br /&gt;
    c\prallprall          c\prallmordent     c\upprall&lt;br /&gt;
    c\downprall           c\upmordent        c\downmordent&lt;br /&gt;
    c\pralldown           c\prallup          c\lineprall&lt;br /&gt;
    c\signumcongruentiae  c\shortfermata     c\fermata&lt;br /&gt;
    c\longfermata         c\verylongfermata  c\segno&lt;br /&gt;
    c\coda                c\varcoda&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  \new Lyrics \lyricmode {&lt;br /&gt;
    accent              marcato          staccatissimo&lt;br /&gt;
    staccato            tenuto           portato&lt;br /&gt;
    upbow               downbow          flageolet&lt;br /&gt;
    thumb               lheel            rheel&lt;br /&gt;
    ltoe                rtoe             open&lt;br /&gt;
    stopped             turn             reverseturn&lt;br /&gt;
    trill               prall            mordent&lt;br /&gt;
    prallprall          prallmordent     upprall&lt;br /&gt;
    downprall           upmordent        downmordent&lt;br /&gt;
    pralldown           prallup          lineprall&lt;br /&gt;
    signumcongruentiae  shortfermata     fermata&lt;br /&gt;
    longfermata         verylongfermata  segno&lt;br /&gt;
    coda                varcoda&lt;br /&gt;
  }&lt;br /&gt;
&amp;gt;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
\layout {&lt;br /&gt;
  \context {&lt;br /&gt;
    \Staff&lt;br /&gt;
    \remove Clef_engraver&lt;br /&gt;
    \remove Time_signature_engraver&lt;br /&gt;
    \remove Bar_line_engraver&lt;br /&gt;
  }&lt;br /&gt;
  \context {&lt;br /&gt;
    \Lyrics&lt;br /&gt;
    \override LyricText.font-family = #&#039;typewriter&lt;br /&gt;
    \override LyricSpace.minimum-distance = 3&lt;br /&gt;
  }&lt;br /&gt;
  \context {&lt;br /&gt;
    \Score&lt;br /&gt;
    timing = ##f&lt;br /&gt;
    forbidBreakBetweenBarLines = ##f&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lilypond&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Symbols and glyphs]]&lt;br /&gt;
[[Category:Expressive marks]]&lt;br /&gt;
[[Category:Snippet]]&lt;/div&gt;</summary>
		<author><name>Lemzwerg</name></author>
	</entry>
	<entry>
		<id>https://wiki.lilypond.community/index.php?title=Positioning_a_%5Cfermata_over_the_last_bar_line&amp;diff=6454</id>
		<title>Positioning a \fermata over the last bar line</title>
		<link rel="alternate" type="text/html" href="https://wiki.lilypond.community/index.php?title=Positioning_a_%5Cfermata_over_the_last_bar_line&amp;diff=6454"/>
		<updated>2026-03-15T16:41:23Z</updated>

		<summary type="html">&lt;p&gt;Lemzwerg: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;To position a \fermata sign over the last bar line, you must use a specially modified rehearsal mark.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lilypond version=&amp;quot;2.24&amp;quot;&amp;gt;&lt;br /&gt;
\relative c&#039;&#039; {&lt;br /&gt;
  \override Score.RehearsalMark.break-visibility = #begin-of-line-invisible&lt;br /&gt;
  c1 \mark \markup { \musicglyph &amp;quot;scripts.ufermata&amp;quot; }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lilypond&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Expressive marks]]&lt;br /&gt;
[[Category:Breaks]]&lt;br /&gt;
[[Category:Staff notation]]&lt;br /&gt;
[[Category:Workaround]]&lt;br /&gt;
[[Category:Symbols and glyphs]]&lt;br /&gt;
[[Category:Snippet]]&lt;/div&gt;</summary>
		<author><name>Lemzwerg</name></author>
	</entry>
	<entry>
		<id>https://wiki.lilypond.community/index.php?title=Alternate_%5CtextSpanner_engraver&amp;diff=6448</id>
		<title>Alternate \textSpanner engraver</title>
		<link rel="alternate" type="text/html" href="https://wiki.lilypond.community/index.php?title=Alternate_%5CtextSpanner_engraver&amp;diff=6448"/>
		<updated>2026-03-12T06:46:28Z</updated>

		<summary type="html">&lt;p&gt;Lemzwerg: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;LilyPond&#039;s default text spanner engraver can only handle a single text spanner per voice at a time.  The engraver in this snippet provides an alternate implementation to circumvent this limitation; it uses spanner IDs to specify start and end of overlapping text spanners.&lt;br /&gt;
&lt;br /&gt;
To use it, replace &amp;lt;code&amp;gt;Text_spanner_engraver&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;\alternateTextSpannerEngraver&amp;lt;/code&amp;gt;.  The example below demonstrates two possible ways to specify a spanner ID: either define a new command or use the &amp;lt;code&amp;gt;\=&amp;lt;/code&amp;gt; command to directly set the ID.&lt;br /&gt;
&lt;br /&gt;
To control the vertical order of text spanners, use the standard way of tweaking the &amp;lt;code&amp;gt;outside-staff-priority&amp;lt;/code&amp;gt; property.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lilypond version=&amp;quot;2.24&amp;quot;&amp;gt;&lt;br /&gt;
% LSR written by Dave Nalesnik&lt;br /&gt;
% LSR https://lists.gnu.org/archive/html/lilypond-user/2026-01/msg00006.html&lt;br /&gt;
&lt;br /&gt;
% Incorporating some code from the rewrite in Scheme of&lt;br /&gt;
% Text_spanner_engraver in input/regression/scheme-text-spanner.ly&lt;br /&gt;
&lt;br /&gt;
#(define (add-bound-item spanner item)&lt;br /&gt;
   (if (null? (ly:spanner-bound spanner LEFT))&lt;br /&gt;
       (ly:spanner-set-bound! spanner LEFT item)&lt;br /&gt;
       (ly:spanner-set-bound! spanner RIGHT item)))&lt;br /&gt;
&lt;br /&gt;
#(define (set-axis! grob axis)&lt;br /&gt;
   (when (not (number? (ly:grob-property grob &#039;side-axis)))&lt;br /&gt;
     (set! (ly:grob-property grob &#039;side-axis) axis)&lt;br /&gt;
     (ly:grob-chain-callback&lt;br /&gt;
      grob&lt;br /&gt;
      (if (eq? axis X)&lt;br /&gt;
          ly:side-position-interface::x-aligned-side&lt;br /&gt;
          side-position-interface::y-aligned-side)&lt;br /&gt;
      (if (eq? axis X)&lt;br /&gt;
	  &#039;X-offset&lt;br /&gt;
	  &#039;Y-offset))))&lt;br /&gt;
&lt;br /&gt;
#(define (assign-spanner-index orig-ls)&lt;br /&gt;
   &amp;quot;Determine an available position of a new spanner in an ordered&lt;br /&gt;
sequence of spanners (a list of pairs, where the car of the pair&lt;br /&gt;
gives the position).  The goal is for the sequence to begin with&lt;br /&gt;
zero and contain no gaps.  Return the index representing the&lt;br /&gt;
spanner&#039;s position.&lt;br /&gt;
&lt;br /&gt;
Examples (only showing the cars of the pairs):&lt;br /&gt;
&lt;br /&gt;
  (0 1)   =&amp;gt; 2&lt;br /&gt;
  (2 3)   =&amp;gt; 0&lt;br /&gt;
  (0 3)   =&amp;gt; 1&lt;br /&gt;
  (0 1 3) =&amp;gt; 2&lt;br /&gt;
&amp;quot;&lt;br /&gt;
   (if (null? orig-ls)&lt;br /&gt;
       0&lt;br /&gt;
       (let loop ((ls orig-ls)&lt;br /&gt;
		  (insert? #t)&lt;br /&gt;
		  (result 0))&lt;br /&gt;
         (cond&lt;br /&gt;
          ((null? ls)&lt;br /&gt;
	   result)&lt;br /&gt;
          ;; Position at head of list.&lt;br /&gt;
          ((and insert? (&amp;gt; (caar orig-ls) 0))&lt;br /&gt;
           (loop ls #f 0))&lt;br /&gt;
          ;; No gaps, put at end of list.&lt;br /&gt;
          ((and insert? (null? (cdr ls)))&lt;br /&gt;
           (loop (cdr ls) #f (1+ (caar ls))))&lt;br /&gt;
          ;; Fill lowest position of gap.&lt;br /&gt;
          ((and insert?&lt;br /&gt;
                (&amp;gt; (caadr ls) (1+ (caar ls))))&lt;br /&gt;
           (loop (cdr ls) #f (1+ (caar ls))))&lt;br /&gt;
          (else&lt;br /&gt;
	   (loop (cdr ls) insert? result))))))&lt;br /&gt;
&lt;br /&gt;
alternateTextSpannerEngraver =&lt;br /&gt;
#(lambda (context)&lt;br /&gt;
   (let (;; A list of pairs comprising a spanner index (not&lt;br /&gt;
	 ;; `spanner-id` values) and a spanner which has been begun.&lt;br /&gt;
         (spanners &#039;())&lt;br /&gt;
         (finished &#039;()) ; A list of spanners in completion stage.&lt;br /&gt;
         (start-events &#039;()) ; A list of START events.&lt;br /&gt;
         (stop-events &#039;())) ; A list of STOP events.&lt;br /&gt;
     (make-engraver&lt;br /&gt;
      ;; `\startTextSpan`, `\stopTextSpan`, and the like create&lt;br /&gt;
      ;; events which we collect here.&lt;br /&gt;
      (listeners&lt;br /&gt;
       ((text-span-event engraver event)&lt;br /&gt;
        (if (= START (ly:event-property event &#039;span-direction))&lt;br /&gt;
            (set! start-events (cons event start-events))&lt;br /&gt;
            (set! stop-events (cons event stop-events)))))&lt;br /&gt;
&lt;br /&gt;
      ;; Populate `note-columns` property of spanners.  Bounds are&lt;br /&gt;
      ;; set to note columns, and each spanner keeps a record of&lt;br /&gt;
      ;; the note columns it traverses.&lt;br /&gt;
      (acknowledgers&lt;br /&gt;
       ((note-column-interface engraver grob source-engraver)&lt;br /&gt;
        (for-each (lambda (s)&lt;br /&gt;
                    (ly:pointer-group-interface::add-grob&lt;br /&gt;
                     (cdr s) &#039;note-columns grob)&lt;br /&gt;
                    (when (null? (ly:spanner-bound (cdr s) LEFT))&lt;br /&gt;
                      (add-bound-item (cdr s) grob)))&lt;br /&gt;
		  spanners)&lt;br /&gt;
        ;; `finished` only contains spanners, no indices.&lt;br /&gt;
        (for-each (lambda (f)&lt;br /&gt;
                    (ly:pointer-group-interface::add-grob&lt;br /&gt;
                     f &#039;note-columns grob)&lt;br /&gt;
                    (when (null? (ly:spanner-bound f RIGHT))&lt;br /&gt;
                      (add-bound-item f grob)))&lt;br /&gt;
		  finished)))&lt;br /&gt;
&lt;br /&gt;
      ((process-music trans)&lt;br /&gt;
       ;; Move begun spanners from `span` to `finished`.  We do&lt;br /&gt;
       ;; this on the basis of `spanner-id`.  If we find a match&lt;br /&gt;
       ;; -- either the strings are the same, or both are unset --&lt;br /&gt;
       ;; a transfer can be made.  Return a warning if we find no&lt;br /&gt;
       ;; match: spanner hasn&#039;t been properly begun.&lt;br /&gt;
       (for-each&lt;br /&gt;
        (lambda (es)&lt;br /&gt;
          (let ((es-id (ly:event-property es &#039;spanner-id)))&lt;br /&gt;
            (let loop ((sp spanners))&lt;br /&gt;
              (if (null? sp)&lt;br /&gt;
                  (ly:warning &amp;quot;No spanner to end!&amp;quot;)&lt;br /&gt;
                  (let ((sp-id (ly:event-property&lt;br /&gt;
                                (event-cause (cdar sp))&lt;br /&gt;
				&#039;spanner-id)))&lt;br /&gt;
                    (cond&lt;br /&gt;
                     ((equal? sp-id es-id)&lt;br /&gt;
                      (set! finished (cons (cdar sp) finished))&lt;br /&gt;
                      (set! spanners&lt;br /&gt;
			    (remove (lambda (s)&lt;br /&gt;
				      (eq? s (car sp))) spanners)))&lt;br /&gt;
                     (else&lt;br /&gt;
		      (loop (cdr sp)))))))))&lt;br /&gt;
        stop-events)&lt;br /&gt;
&lt;br /&gt;
       ;; The end of our spanners can be acknowledged by other&lt;br /&gt;
       ;; engravers, thus announce them.&lt;br /&gt;
       (for-each&lt;br /&gt;
        (lambda (f)&lt;br /&gt;
          (ly:engraver-announce-end-grob trans f (event-cause f)))&lt;br /&gt;
        finished)&lt;br /&gt;
&lt;br /&gt;
       ;; Make spanners in response to START events.&lt;br /&gt;
       ;;&lt;br /&gt;
       ;; Each new spanner is assigned an index denoting its&lt;br /&gt;
       ;; position relative to other active spanners.  This is&lt;br /&gt;
       ;; enforced (for the moment) by adding a small amount to&lt;br /&gt;
       ;; the spanner&#039;s `outside-staff-priority` proportional to&lt;br /&gt;
       ;; this index.  This is unlikely to result in conflicts,&lt;br /&gt;
       ;; though a better solution may be to organize the spanners&lt;br /&gt;
       ;; by a new alignment grob.&lt;br /&gt;
       ;;&lt;br /&gt;
       ;; Also, add any existing spanners to the&lt;br /&gt;
       ;; `side-support-elements` array of the new spanner.  This&lt;br /&gt;
       ;; ensures correct ordering over line breaks when&lt;br /&gt;
       ;; `outside-staff-priority` is set to `#f` (which means&lt;br /&gt;
       ;; that it is no longer an outside-staff object -- not the&lt;br /&gt;
       ;; default).&lt;br /&gt;
       (for-each&lt;br /&gt;
        (lambda (es)&lt;br /&gt;
          (let* ((new (ly:engraver-make-grob&lt;br /&gt;
		       trans &#039;TextSpanner es))&lt;br /&gt;
                 (new-idx (assign-spanner-index spanners))&lt;br /&gt;
                 (new-osp (ly:grob-property&lt;br /&gt;
			   new &#039;outside-staff-priority))&lt;br /&gt;
                 (new-osp (if (number? new-osp)&lt;br /&gt;
                              (+ new-osp (/ new-idx 1000.0))&lt;br /&gt;
                              new-osp)))&lt;br /&gt;
            (set! (ly:grob-property&lt;br /&gt;
		   new &#039;outside-staff-priority) new-osp)&lt;br /&gt;
            (set-axis! new Y)&lt;br /&gt;
            ;; Add spanners with a lower index than the new&lt;br /&gt;
            ;; spanner to its `side-support-elements` list.  This&lt;br /&gt;
            ;; allows new spanners to fill gaps under the topmost&lt;br /&gt;
            ;; spanner.&lt;br /&gt;
            (for-each (lambda (sp)&lt;br /&gt;
			(when (&amp;lt; (car sp) new-idx)&lt;br /&gt;
			  (ly:pointer-group-interface::add-grob&lt;br /&gt;
			   new &#039;side-support-elements (cdr sp))))&lt;br /&gt;
		      spanners)&lt;br /&gt;
            (set! spanners (cons (cons new-idx new) spanners))&lt;br /&gt;
            (set! spanners (sort spanners car&amp;lt;))))&lt;br /&gt;
        start-events)&lt;br /&gt;
&lt;br /&gt;
       ;; Events have served their purpose for this timestep.&lt;br /&gt;
       ;; Clear the way for new events in later timesteps.&lt;br /&gt;
       (set! start-events &#039;())&lt;br /&gt;
       (set! stop-events &#039;()))&lt;br /&gt;
&lt;br /&gt;
      ((stop-translation-timestep trans)&lt;br /&gt;
       ;; Set bounds of spanners to `PaperColumns` grobs if they&lt;br /&gt;
       ;; haven&#039;t been set.  This allows spanners to be drawn&lt;br /&gt;
       ;; between spacers.&lt;br /&gt;
       ;;&lt;br /&gt;
       ;; Other uses?  Doesn&#039;t appear to affect whether spanners&lt;br /&gt;
       ;; can de drawn between rests.&lt;br /&gt;
       (for-each (lambda (s)&lt;br /&gt;
		   (when (null? (ly:spanner-bound (cdr s) LEFT))&lt;br /&gt;
		     (ly:spanner-set-bound!&lt;br /&gt;
		      (cdr s) LEFT&lt;br /&gt;
		      (ly:context-property context&lt;br /&gt;
					   &#039;currentMusicalColumn))))&lt;br /&gt;
		 spanners)&lt;br /&gt;
       (for-each (lambda (f)&lt;br /&gt;
		   (when (null? (ly:spanner-bound f RIGHT))&lt;br /&gt;
		     (ly:spanner-set-bound!&lt;br /&gt;
		      f RIGHT&lt;br /&gt;
		      (ly:context-property context&lt;br /&gt;
					   &#039;currentMusicalColumn))))&lt;br /&gt;
		 finished)&lt;br /&gt;
       (set! finished &#039;()))&lt;br /&gt;
&lt;br /&gt;
      ((finalize trans)&lt;br /&gt;
       ;; If spanner ends on spacer at end of context?&lt;br /&gt;
       (for-each (lambda (f)&lt;br /&gt;
                   (when (null? (ly:spanner-bound f RIGHT))&lt;br /&gt;
                     (ly:spanner-set-bound!&lt;br /&gt;
		      f RIGHT&lt;br /&gt;
                      (ly:context-property context&lt;br /&gt;
					   &#039;currentMusicalColumn))))&lt;br /&gt;
		 finished)&lt;br /&gt;
       (set! finished &#039;())&lt;br /&gt;
       ;; User didn&#039;t end spanner.&lt;br /&gt;
       (for-each (lambda (sp)&lt;br /&gt;
		   (ly:warning &amp;quot;incomplete spanner removed!&amp;quot;)&lt;br /&gt;
		   (ly:grob-suicide! (cdr sp)))&lt;br /&gt;
		 spanners)&lt;br /&gt;
       (set! spanners &#039;())))))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%% EXAMPLE %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%&lt;br /&gt;
&lt;br /&gt;
startTextSpanOne =&lt;br /&gt;
#(make-music &#039;TextSpanEvent &#039;span-direction START &#039;spanner-id &amp;quot;1&amp;quot;)&lt;br /&gt;
stopTextSpanOne =&lt;br /&gt;
#(make-music &#039;TextSpanEvent &#039;span-direction STOP &#039;spanner-id &amp;quot;1&amp;quot;)&lt;br /&gt;
startTextSpanTwo =&lt;br /&gt;
#(make-music &#039;TextSpanEvent &#039;span-direction START &#039;spanner-id &amp;quot;2&amp;quot;)&lt;br /&gt;
stopTextSpanTwo =&lt;br /&gt;
#(make-music &#039;TextSpanEvent &#039;span-direction STOP &#039;spanner-id &amp;quot;2&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
\layout {&lt;br /&gt;
  \context {&lt;br /&gt;
    \Voice&lt;br /&gt;
    \remove Text_spanner_engraver&lt;br /&gt;
    \consists \alternateTextSpannerEngraver&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
\relative c&#039; {&lt;br /&gt;
  \override TextSpanner.style = ##f&lt;br /&gt;
  \override TextSpanner.thickness = 10&lt;br /&gt;
  % \override TextSpanner.to-barline = ##t&lt;br /&gt;
&lt;br /&gt;
  a4 \tweak color #red \startTextSpan&lt;br /&gt;
    b \tweak color #green \startTextSpanOne&lt;br /&gt;
    c \tweak color #blue \startTextSpanTwo&lt;br /&gt;
    d \=3\startTextSpan |&lt;br /&gt;
  a4\stopTextSpan&lt;br /&gt;
    b \stopTextSpanOne&lt;br /&gt;
      \tweak color #red \startTextSpan&lt;br /&gt;
    c \stopTextSpanTwo&lt;br /&gt;
      \tweak color #green \startTextSpanOne&lt;br /&gt;
    d \=3\stopTextSpan&lt;br /&gt;
      \tweak color #blue \startTextSpanTwo |&lt;br /&gt;
  a4 \=3\startTextSpan&lt;br /&gt;
    b c d | \break&lt;br /&gt;
&lt;br /&gt;
  a4 b c d |&lt;br /&gt;
  a4\stopTextSpan&lt;br /&gt;
    \stopTextSpanOne&lt;br /&gt;
    \stopTextSpanTwo&lt;br /&gt;
    \=3\stopTextSpan&lt;br /&gt;
    b &lt;br /&gt;
    c \startTextSpan&lt;br /&gt;
    d \tweak outside-staff-priority #0 \=1\startTextSpan |&lt;br /&gt;
  a4 b&lt;br /&gt;
    c \=1\stopTextSpan&lt;br /&gt;
    d \stopTextSpan |&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lilypond&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Contexts and engravers]]&lt;br /&gt;
[[Category:Editorial annotations]]&lt;br /&gt;
[[Category:Expressive marks]]&lt;br /&gt;
[[Category:Scheme]]&lt;br /&gt;
[[Category:Workaround]]&lt;br /&gt;
[[Category:Snippet]]&lt;/div&gt;</summary>
		<author><name>Lemzwerg</name></author>
	</entry>
</feed>