On 11/21/2010 8:11 PM, Patrick Karl wrote: > I'm trying to duplicate in LilyPond a very ugly photocopied piece of > music, which was handed out in an Early Music workshop, which includes > "incipits". Does LilyPond do incipits? The only thing I find in the > v2.12 NR is:
Yes, it can do beautiful incipits. I place the following code at the top of the file (retrieved from the snippets repository): incipit = #(define-music-function (parser location incipit-music) (ly:music?) #{ \once \override Staff.InstrumentName #'self-alignment-X = #RIGHT \once \override Staff.InstrumentName #'self-alignment-Y = #UP \once \override Staff.InstrumentName #'Y-offset = #4 \once \override Staff.InstrumentName #'padding = #0.3 \once \override Staff.InstrumentName #'stencil = #(lambda (grob) (let* ((instrument-name (ly:grob-property grob 'long-text)) (layout (ly:output-def-clone (ly:grob-layout grob))) (music (make-music 'SequentialMusic 'elements (list (make-music 'ContextSpeccedMusic 'context-type 'MensuralStaff 'element (make-music 'PropertySet 'symbol 'instrumentName 'value instrument-name)) $incipit-music))) (score (ly:make-score music)) (mm (ly:output-def-lookup layout 'mm)) (indent (ly:output-def-lookup layout 'indent)) (width (ly:output-def-lookup layout 'incipit-width)) (incipit-width (if (number? width) (* width mm) (* indent 0.5)))) (ly:output-def-set-variable! layout 'indent (- indent incipit-width)) (ly:output-def-set-variable! layout 'line-width indent) (ly:output-def-set-variable! layout 'ragged-right #f) (ly:output-def-set-variable! layout 'ragged-last #f) (ly:output-def-set-variable! layout 'system-count 1) (ly:score-add-output-def! score layout) (set! (ly:grob-property grob 'long-text) (markup #:score score)) (ly:system-start-text::print grob))) #}) Then something like the following: cantusIncipit = << \new MensuralVoice = cantusIncipit << \repeat unfold 9 { s1 \noBreak } { \override Rest #'style = #'neomensural \clef "neomensural-c1" \key c \major \time 2/2 r2 a'2 } >> Then finally in the \score: \new Voice = "cantus" << \incipit \cantusIncipit \cantusMusic >> \new Lyrics \lyricsto "cantus" \cantusLyrics Aaron P.S. I tried to send a PDF of a single page, but it was apparently too big. You can see the incipits in a modern edition I did at http://hdl.handle.net/1880/47815 _______________________________________________ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user