]> git.donarmstrong.com Git - lilypond.git/commitdiff
LSR: Incipit example.
authorNicolas Sceaux <nicolas.sceaux@free.fr>
Sun, 17 Feb 2008 14:46:50 +0000 (15:46 +0100)
committerNicolas Sceaux <nicolas.sceaux@free.fr>
Sun, 17 Feb 2008 14:46:50 +0000 (15:46 +0100)
input/new/incipit.ly [new file with mode: 0644]
input/regression/incipit.ly

diff --git a/input/new/incipit.ly b/input/new/incipit.ly
new file mode 100644 (file)
index 0000000..6710d99
--- /dev/null
@@ -0,0 +1,262 @@
+\version "2.11.39"
+\header {
+  doctitle = "Incipit"
+  lsrtags = "staff-notation,Ancient notation"
+  texidoc = "Incipits can be added using the instrument name grob, but
+keeping separate the instrument name definition and the incipit definition."
+}
+
+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)))
+  #})
+
+%%%%%%%%%%%%%%%%%%%%%%%%%
+
+global = {
+  \set Score.skipBars = ##t
+  \key g \major
+  \time 4/4
+  
+  %make the staff lines invisible on staves
+  \override Staff.BarLine #'transparent = ##t
+  \skip 1*8 % the actual music
+
+  % let finis bar go through all staves
+  \override Staff.BarLine #'transparent = ##f
+
+  % finis bar
+  \bar "|."
+}
+
+discantusIncipit = <<
+  \new MensuralVoice = discantusIncipit <<
+    \repeat unfold 9 { s1 \noBreak }
+    {
+      \clef "neomensural-c1"
+      \key f \major
+      \time 2/2
+      c''1. 
+    }
+  >>
+  \new Lyrics \lyricsto discantusIncipit { IV- }
+>>
+
+discantusNotes = {
+  \transpose c' c'' {
+    \clef "treble"
+    d'2. d'4 |
+    b e' d'2 |
+    c'4 e'4.( d'8 c' b |
+    a4) b a2 |
+    b4.( c'8 d'4) c'4 |
+    \once \override NoteHead #'transparent = ##t c'1 |
+    b\breve |
+  }
+}
+
+discantusLyrics = \lyricmode {
+  Ju -- bi -- |
+  la -- te De -- |
+  o, om --
+  nis ter -- |
+  ra, __ om- |
+  "..." |
+  -us. |
+}
+
+altusIncipit = <<
+  \new MensuralVoice = altusIncipit <<
+    \repeat unfold 9 { s1 \noBreak }
+    {
+      \clef "neomensural-c3"
+      \key f \major
+      \time 2/2
+      r1 f'1. 
+    }
+  >>
+  \new Lyrics \lyricsto altusIncipit { IV- }
+>>
+
+altusNotes = {
+  \transpose c' c'' {
+    \clef "treble"
+    r2 g2. e4 fis g | % two bars
+    a2 g4 e |
+    fis g4.( fis16 e fis4) |
+    g1 |
+    \once \override NoteHead #'transparent = ##t g1 |
+    g\breve |
+  }
+}
+
+altusLyrics = \lyricmode {
+  Ju -- bi -- la -- te | % two bars
+  De -- o, om -- |
+  nis ter -- ra, |
+  "..." |
+  -us. |
+}
+
+tenorIncipit = <<
+  \new MensuralVoice = tenorIncipit <<
+    \repeat unfold 9 { s1 \noBreak }
+    {
+      \clef "neomensural-c4"
+      \key f \major
+      \time 2/2
+      r\longa
+      r\breve
+      r1 c'1.
+    }
+  >>
+  \new Lyrics \lyricsto tenorIncipit { IV- }
+>>
+
+tenorNotes = {
+  \transpose c' c' {
+    \once \override Staff.VerticalAxisGroup #'minimum-Y-extent = #'(-6 . 3)
+    \clef "treble_8"
+    R1 |
+    R1 |
+    R1 |
+    r2 d'2. d'4 b e' | % two bars
+    \once \override NoteHead #'transparent = ##t e'1 |
+    d'\breve |
+  }
+}
+
+tenorLyrics = \lyricmode {
+  Ju -- bi -- la -- te | % two bars
+  "..." |
+  -us. 
+}
+
+bassusIncipit = <<
+  \new MensuralVoice = bassusIncipit <<
+    \repeat unfold 9 { s1 \noBreak }
+    {
+      \clef "bass"
+      \key f \major
+      \time 2/2
+      %% incipit
+      r\maxima
+      f1.
+    }
+  >>
+  \new Lyrics \lyricsto bassusIncipit { IV- }
+>>
+
+bassusNotes = {
+  \transpose c' c' {
+    \clef "bass"
+    R1 |
+    R1 |
+    R1 |
+    R1 |
+    g2. e4 |
+    \once \override NoteHead #'transparent = ##t e1 |
+    g\breve |
+  }
+}
+
+bassusLyrics = \lyricmode {
+  Ju -- bi- |
+  "..." |
+  -us. 
+}
+
+\score {
+  <<
+    \new StaffGroup = choirStaff <<
+      \new Voice = "discantusNotes" <<
+        \global 
+        \set Staff.instrumentName = "Discantus"
+        \incipit \discantusIncipit
+        \discantusNotes
+      >>
+      \new Lyrics = "discantusLyrics" \lyricsto discantusNotes { \discantusLyrics }
+      \new Voice = "altusNotes" <<
+        \global 
+        \set Staff.instrumentName = "Altus"
+        \incipit \altusIncipit
+        \altusNotes
+      >>
+      \new Lyrics = "altusLyrics" \lyricsto altusNotes { \altusLyrics }
+      \new Voice = "tenorNotes" <<
+        \global 
+        \set Staff.instrumentName = "Tenor"
+        \incipit \tenorIncipit
+        \tenorNotes
+      >>
+      \new Lyrics = "tenorLyrics" \lyricsto tenorNotes { \tenorLyrics }
+      \new Voice = "bassusNotes" <<
+        \set Staff.instrumentName = "Bassus"
+        \incipit \bassusIncipit
+        \bassusNotes
+      >>
+    >>
+    \new Lyrics = "bassusLyrics" \lyricsto bassusNotes { \bassusLyrics } 
+    %% Keep the bass lyrics outside of the staff group to avoid bar lines
+    %% between the lyrics.
+  >>
+  \layout {
+    \context {
+      \Score
+      %% no bars in staves
+      \override BarLine #'transparent = ##t
+    }
+    %% the next three instructions keep the lyrics between the barlines
+    \context {
+      \Lyrics 
+      \consists "Bar_engraver" 
+      \override BarLine #'transparent = ##t
+    } 
+    \context { \StaffGroup \consists "Separating_line_group_engraver" }
+    \context {
+      \Voice
+      %% no slurs
+      \override Slur #'transparent = ##t
+      %% Comment in the below "\remove" command to allow line
+      %% breaking also at those barlines where a note overlaps
+      %% into the next bar.  The command is commented out in this
+      %% short example score, but especially for large scores, you
+      %% will typically yield better line breaking and thus improve
+      %% overall spacing if you comment in the following command.
+      %%\remove "Forbid_line_break_engraver"
+    }
+    indent=6\cm
+    incipit-width = 4\cm
+  }
+}
\ No newline at end of file
index bbcc17b3e78ca7ccce84b118b45042cb612490de..d0073bd31e742dae9c577ef189ad1f7a936ab48c 100644 (file)
@@ -37,7 +37,7 @@
                                         (* incipit-width mm)
                                         (* indent 0.5))))
          (ly:output-def-set-variable! layout 'indent (- indent scaled-incipit-width))
-         (ly:output-def-set-variable! layout 'line-width scaled-incipit-width)
+         (ly:output-def-set-variable! layout 'line-width indent)
          (ly:output-def-set-variable! layout 'ragged-right #f)
          (ly:score-add-output-def! score layout)
          (set! (ly:grob-property grob 'long-text)