<?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=Rpspringuel</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=Rpspringuel"/>
	<link rel="alternate" type="text/html" href="https://wiki.lilypond.community/wiki/Special:Contributions/Rpspringuel"/>
	<updated>2026-05-03T14:05:41Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.44.2</generator>
	<entry>
		<id>https://wiki.lilypond.community/index.php?title=Recitation_tone&amp;diff=5639</id>
		<title>Recitation tone</title>
		<link rel="alternate" type="text/html" href="https://wiki.lilypond.community/index.php?title=Recitation_tone&amp;diff=5639"/>
		<updated>2025-12-10T20:05:26Z</updated>

		<summary type="html">&lt;p&gt;Rpspringuel: Recitation tones for modern chant&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A reciting note is sustained for several syllables.&lt;br /&gt;
&lt;br /&gt;
Normally only the initial reciting tone is printed (and it&#039;s printed as a &lt;br /&gt;
half-note, whole-note, or breve) and the rest of the syllables are printed &lt;br /&gt;
without notes above them.  However, if the number of syllables to be recited is &lt;br /&gt;
long enough that a line break needs to occur within the recitation, then the &lt;br /&gt;
reciting tone is repeated at the beginning of the new line.  These definitions &lt;br /&gt;
enable this formatting.&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
    \recite 8 g&#039;&lt;br /&gt;
The number is the number of syllables to be said on the reciting tone.  These syllables are entered as normal in \lyricmode.&lt;br /&gt;
The note is the pitch for the reciting tone.&lt;br /&gt;
    \recite g&#039;&lt;br /&gt;
When there are no lyrics associated with the recitation tone (as, for example, when printing a psalm tone) then only the pitch of the reciting tone is specified.  This usage is for ensuring consistent appearance.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lilypond version=&amp;quot;2.24&amp;quot;&amp;gt;&lt;br /&gt;
#(define (line-position grob)&lt;br /&gt;
     &amp;quot;Returns position of @var{grob} in current system:&lt;br /&gt;
     @code{&#039;start}, if at first time-step&lt;br /&gt;
     @code{&#039;end}, if at last time-step&lt;br /&gt;
     @code{&#039;middle} otherwise&lt;br /&gt;
     &amp;quot;&lt;br /&gt;
     (let* ((col (ly:item-get-column grob))&lt;br /&gt;
            (ln (ly:grob-object col &#039;left-neighbor))&lt;br /&gt;
            (rn (ly:grob-object col &#039;right-neighbor))&lt;br /&gt;
            (col-to-check-left (if (ly:grob? ln) ln col))&lt;br /&gt;
            (col-to-check-right (if (ly:grob? rn) rn col))&lt;br /&gt;
            (break-dir-left&lt;br /&gt;
             (and&lt;br /&gt;
              (ly:grob-property col-to-check-left &#039;non-musical #f)&lt;br /&gt;
              (ly:item-break-dir col-to-check-left)))&lt;br /&gt;
            (break-dir-right&lt;br /&gt;
             (and&lt;br /&gt;
              (ly:grob-property col-to-check-right &#039;non-musical #f)&lt;br /&gt;
              (ly:item-break-dir col-to-check-right))))&lt;br /&gt;
         (cond ((eqv? 1 break-dir-left) &#039;start)&lt;br /&gt;
               ((eqv? -1 break-dir-right) &#039;end)&lt;br /&gt;
               (else &#039;middle))))&lt;br /&gt;
&lt;br /&gt;
#(define (tranparent-at-line-position vctor)&lt;br /&gt;
     (lambda (grob)&lt;br /&gt;
         &amp;quot;Relying on @code{line-position} select the relevant entry from @var{vctor}.&lt;br /&gt;
          Used to determine transparency,&amp;quot;&lt;br /&gt;
         (case (line-position grob)&lt;br /&gt;
             ((end) (not (vector-ref vctor 0)))&lt;br /&gt;
             ((middle) (not (vector-ref vctor 1)))&lt;br /&gt;
             ((start) (not (vector-ref vctor 2))))))&lt;br /&gt;
&lt;br /&gt;
noteHeadBreakVisibility =&lt;br /&gt;
#(define-music-function (break-visibility)(vector?)&lt;br /&gt;
     &amp;quot;Makes notes transparent relying on @var{break-visibility}.&lt;br /&gt;
      The list of objects to make transparent is taken from @code{hideNotes}.&amp;quot;&lt;br /&gt;
     #{&lt;br /&gt;
         \override NoteHead.transparent = #(tranparent-at-line-position break-visibility)&lt;br /&gt;
         \override Dots.transparent = #(tranparent-at-line-position break-visibility)&lt;br /&gt;
         \override Accidental.transparent = #(tranparent-at-line-position break-visibility)&lt;br /&gt;
         \override Rest.transparent = #(tranparent-at-line-position break-visibility)&lt;br /&gt;
         %stems are always hidden in chant&lt;br /&gt;
         %we assume chants are not in a TabStaff and so don&#039;t need to hide TabNoteHeads&lt;br /&gt;
         %ledger lines have to be taken care of in the layout block using delete-ledgers-for-transparent-note-heads&lt;br /&gt;
     #})&lt;br /&gt;
&lt;br /&gt;
#(define delete-ledgers-for-transparent-note-heads&lt;br /&gt;
     (lambda (grob)&lt;br /&gt;
         &amp;quot;Reads whether a @code{NoteHead} is transparent.&lt;br /&gt;
          If so this @code{NoteHead} is removed from @code{&#039;note-heads} from&lt;br /&gt;
          @var{grob}, which is supposed to be @code{LedgerLineSpanner}.&lt;br /&gt;
          As a result ledgers are not printed for this @code{NoteHead}&amp;quot;&lt;br /&gt;
         (let* ((nhds-array (ly:grob-object grob &#039;note-heads))&lt;br /&gt;
                (nhds-list&lt;br /&gt;
                 (if (ly:grob-array? nhds-array)&lt;br /&gt;
                     (ly:grob-array-&amp;gt;list nhds-array)&lt;br /&gt;
                     &#039;()))&lt;br /&gt;
                ;; Relies on the transparent-property being done before&lt;br /&gt;
                ;; Staff.LedgerLineSpanner.after-line-breaking is executed.&lt;br /&gt;
                ;; This is fragile ...&lt;br /&gt;
                (to-keep&lt;br /&gt;
                 (remove&lt;br /&gt;
                  (lambda (nhd)&lt;br /&gt;
                      (ly:grob-property nhd &#039;transparent #f))&lt;br /&gt;
                  nhds-list)))&lt;br /&gt;
             ;; TODO find a better method to iterate over grob-arrays, similiar&lt;br /&gt;
             ;; to filter/remove etc for lists&lt;br /&gt;
             ;; For now rebuilt from scratch&lt;br /&gt;
             (set! (ly:grob-object grob &#039;note-heads)  &#039;())&lt;br /&gt;
             (for-each&lt;br /&gt;
              (lambda (nhd)&lt;br /&gt;
                  (ly:pointer-group-interface::add-grob grob &#039;note-heads nhd))&lt;br /&gt;
              to-keep))))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
\layout {&lt;br /&gt;
    \context {&lt;br /&gt;
        \Staff&lt;br /&gt;
        \override LedgerLineSpanner.after-line-breaking =&lt;br /&gt;
        #delete-ledgers-for-transparent-note-heads&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
recite = #(define-music-function (times note) ((index? 1) ly:music?)&lt;br /&gt;
              &amp;quot;Causes @code{note} to be set as a reciting note for @code{times}&lt;br /&gt;
               syllables.  The value of @code{recite-duration} determines&lt;br /&gt;
               how the recitation note looks: 1 is a half-note, 0 is a&lt;br /&gt;
               whole note, and -1 is a breve.  Only the first occurance&lt;br /&gt;
               of the recitation note and those which appear at the&lt;br /&gt;
               beginning of a line are visible.&amp;quot;&lt;br /&gt;
              (let* ((note2 (ly:music-deep-copy note)) (recite-duration 0) (recite-multiplier (/ (expt 2 recite-duration) 4)))&lt;br /&gt;
                  (if (eqv? times 1)&lt;br /&gt;
                      (withMusicProperty &#039;duration (ly:make-duration recite-duration) note)&lt;br /&gt;
                      #{ #(withMusicProperty &#039;duration (ly:make-duration recite-duration 0 recite-multiplier) note)&lt;br /&gt;
                         \noteHeadBreakVisibility #begin-of-line-visible&lt;br /&gt;
                         \repeat unfold #(1- times) { #(withMusicProperty &#039;duration (ly:make-duration recite-duration 0 recite-multiplier) note2) \bar &amp;quot;&amp;quot; }&lt;br /&gt;
                         \noteHeadBreakVisibility #all-visible&lt;br /&gt;
                      #})))&lt;br /&gt;
&lt;br /&gt;
% Examples starts here.&lt;br /&gt;
\language &amp;quot;english&amp;quot;&lt;br /&gt;
&lt;br /&gt;
global = { \key c \major }&lt;br /&gt;
&lt;br /&gt;
music = {&lt;br /&gt;
    \recite 6 g&#039; d&#039; f&#039; g&#039; \bar &amp;quot;|&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
doxology_words = \lyricmode {&lt;br /&gt;
    Glory be to the Father and to the Son&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
\new Staff&lt;br /&gt;
&amp;lt;&amp;lt;&lt;br /&gt;
    \new Voice = &amp;quot;mel&amp;quot; { &lt;br /&gt;
        \cadenzaOn \global \music \bar &amp;quot;||&amp;quot;&lt;br /&gt;
        \music \bar &amp;quot;||&amp;quot;&lt;br /&gt;
        \music \bar &amp;quot;|.&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
    \new Lyrics \lyricsto &amp;quot;mel&amp;quot; {&lt;br /&gt;
        \doxology_words&lt;br /&gt;
        \doxology_words&lt;br /&gt;
        \doxology_words&lt;br /&gt;
    }&lt;br /&gt;
&amp;gt;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/lilypond&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rpspringuel</name></author>
	</entry>
</feed>