]> git.donarmstrong.com Git - lilypond.git/blobdiff - input/wilhelmus.ly
Add comment about \command.
[lilypond.git] / input / wilhelmus.ly
index 2f5c9c5311feadfefc466ac4359a34330a518038..0cc4134901421f03fa010b7dba3e531dc55e6be1 100644 (file)
@@ -1,4 +1,4 @@
-\version "2.3.0"
+\version "2.4.0"
 
 \header {
   texidoc = "Wilhelmus van Nassouwe"
 #(define (prepend-grob-property grob-name
          grob-prop entry)
   (lambda (context)
-   (ly:context-pushpop-property context grob-name grob-prop
-    (cons
-     entry
-     (assoc-get grob-prop (car (ly:context-property context grob-name)))))))
+   (let*
+    ((grob-def (ly:context-property context grob-name)))
+    (if (pair? grob-def)
+     (ly:context-pushpop-property context grob-name grob-prop
+      (cons
+       entry
+       (assoc-get grob-prop (car grob-def))))))))
 
 #(define (set-extra-space grob-name entry value)
   (prepend-grob-property grob-name 'space-alist
    (cons entry (cons 'extra-space value))))
 
-noclefs = \notes {
+noclefs =  {
   s1
   \override Staff.Clef #'break-visibility = #(lambda (dir) (cons #t #t))
 }
 
 setMargins = {
   %% first line left margin
-  \context Staff \applycontext #(set-extra-space 'TimeSignature 'first-note 4.5)
+  %% justified:
+  %% \context Staff \applycontext #(set-extra-space 'TimeSignature 'first-note 4.5)
+  %% raggedright:
+  \context Staff \applycontext #(set-extra-space 'TimeSignature 'first-note 9.5)
   
   %% next lines left margin
   \context Staff \applycontext #(set-extra-space 'KeySignature 'staff-bar 15)
   
   %% next lines small key-signature margin
-  \context Staff \applycontext #(set-extra-space 'LeftEdge 'key-signature 4.0)
+  \context Staff \applycontext #(set-extra-space 'LeftEdge 'key-signature 1.0)
 }
 
 pipeSymbol = {
@@ -49,13 +55,13 @@ pipeSymbol = {
 
 myBreak = { \bar "" \break }
 
-\paper {
+\layout {
   indent = 0.0\mm
   linewidth = 120.0\mm
   textheight = 270.0\mm
 }
 
-voice = \notes \relative c' {
+voice =  \relative c' {
   \clef violin
   \key g \major
   d4 | g g a a b | a8 \myBreak
@@ -64,22 +70,29 @@ voice = \notes \relative c' {
   d4 | g g a a | b a8 \myBreak
   b8 | c4 b a a| g2.  \myBreak
 
-  b8[ c] | d2 e4 d2 c4 | b a8 \myBreak
+  %% Hack for better left tekst margin
+  %% b8[ c] | d2 e4 d2 c4 | b a8 \myBreak
+  \set melismaBusyProperties = #'()
+  b8[ c] |
+  \unset melismaBusyProperties
+  d2 e4 d2 c4 b | a8 \myBreak
   b8 | c4 b a g | a2. \myBreak
 
   d,4 | g4.\melisma a8\melismaEnd b2 a2 g4 | fis e8 \myBreak
   d8 | e4 g g fis | 
   
-  \override NoteHead #'style = #'neo_mensural
+  \override NoteHead #'style = #'neomensural
 
   g\breve
 
-
-  \override Staff.BarLine #'extra-offset = #'(12 . 0)
+  %% justified lines:
+  %%\override Staff.BarLine #'extra-offset = #'(12 . 0)
+  %% raggedright:
+  \override Staff.BarLine #'extra-offset = #'(23 . 0)
   \bar "|."
 }
 
-stich = \notes \relative c'' {
+stich =  \relative c'' {
   \override Staff.NoteCollision #'merge-differently-dotted = ##t
   \set fontSize = #-3
   %% broken?
@@ -100,7 +113,7 @@ stich = \notes \relative c'' {
   s8 e8[ fis]
 }
 
-modernText = \lyrics {
+modernText = \lyricmode {
   Wil -- hel -- mus van Nas -- sou -- we
   ben ik van duit -- sen bloed,
 
@@ -114,12 +127,14 @@ modernText = \lyrics {
   heb ik al -- tijd ge -- eerd.
 }
 
-text = \lyrics {
+text = \lyricmode {
   Wil -- hel -- mus van Nas -- sou -- we
   Ben ick van duyt -- schen bloet,
   Den Va -- der -- landt ghe -- trou -- we,
   blyf ick tot in den doot!
-  Een Prin -- ce van O -- ran -- gien
+  %% Hack for better left text margin:
+  %% Een Prin -- ce van O -- ran -- gien
+  Een " " Prin -- ce van O -- ran -- gien
   Ben ick, vry, on -- ver -- veert;
   Den Co -- ninck van His -- pan -- gien
   Heb ick al -- tijt ghe -- eert.
@@ -130,6 +145,21 @@ oneHalfNoteTime = \markup {
   \column < { \number "1" } { \smaller \smaller \note #"2" #-0.5 } >
 }
 
+\layout {
+  raggedright = ##t
+
+  \context {
+    \Score
+    %% defaults
+    %% (shortest-duration-space . 2.0)
+    %% (spacing-increment . 1.2)
+    %% (base-shortest-duration . ,(ly:make-moment 1 8))
+    %% wider spacing
+    \override SpacingSpanner #'shortest-duration-space = #3.0
+    \override SpacingSpanner #'spacing-increment = #1.2
+    \override SpacingSpanner #'base-shortest-duration = #(ly:make-moment 1 8)
+  }
+}
 
 \score {
   \context Score <<
@@ -143,7 +173,7 @@ oneHalfNoteTime = \markup {
       \set Staff.minimumVerticalExtent = #'(2 . 2)
       
       %% Custom time signature
-      \override Staff.TimeSignature #'print-function = #Text_item::print
+      \override Staff.TimeSignature #'print-function = #Text_interface::print
       \override Staff.TimeSignature #'text = #oneHalfNoteTime
       \noclefs
     
@@ -155,8 +185,8 @@ oneHalfNoteTime = \markup {
       \text
     }
   >>
-  \paper {}
-%  \midi {}
+  \layout {}
+  \midi {}
 }
 
 %%% Local variables: