]> git.donarmstrong.com Git - lilypond.git/commitdiff
LSR: new snippets.
authorGraham Percival <graham@percival-music.ca>
Fri, 31 Aug 2007 05:18:15 +0000 (22:18 -0700)
committerGraham Percival <graham@percival-music.ca>
Fri, 31 Aug 2007 05:18:15 +0000 (22:18 -0700)
input/lsr/nonmusic/aligning-and-centering-instrument-names.ly [new file with mode: 0644]
input/lsr/nonmusic/printing-the-full-title-on-several-scores-in-the-same-file..ly [new file with mode: 0644]
input/lsr/parts/display-bracket-with-only-one-staff-in-a-system.ly [new file with mode: 0644]
input/lsr/parts/forcing-visibility-of-systems-with-multi-bar-rests-when-using--removeemptystaffcontext.ly [new file with mode: 0644]
input/lsr/parts/hiding-staves-with-rests-only-for-some-all-voices.ly [new file with mode: 0644]

diff --git a/input/lsr/nonmusic/aligning-and-centering-instrument-names.ly b/input/lsr/nonmusic/aligning-and-centering-instrument-names.ly
new file mode 100644 (file)
index 0000000..50bd9c5
--- /dev/null
@@ -0,0 +1,52 @@
+%%  Do not edit this file; it is auto-generated from LSR!
+\version "2.11.23"
+
+\header { texidoc = "
+Instrument names are generally printed at the left side of the staves.
+To align the names of several different intruments, you can put them in
+a \markup block and use one of the following possibilites:
+
+
+* 
+    Right-aligned instrument names: this is LilyPond's default behavior
+  
+* 
+    Center-aligned instrument names: with the \hcenter-in #n syntax, you
+    can place the instrument names inside a padded box (n being the width
+    of the box)
+  
+* 
+    Left-aligned instrument names: you have to print the names on top of an
+    empty box, using the \combine command
+    with a \hspace #n object.
+  
+
+" }
+
+\paper{ 
+  indent = #0 
+  left-margin = #30
+  line-width = #160
+}
+
+\new StaffGroup \relative
+<<
+  \new Staff {
+    \set Staff.instrumentName = "blabla"
+    c1^"default" c1 \break 
+    \set Staff.instrumentName = \markup { \hcenter-in #10 "blabla" }
+    c1^"centered" c1 \break 
+    \set Staff.instrumentName = \markup {\combine \hspace #8 "blabla" }
+    c1^"left-aligned" c1 
+    
+  } 
+  \new Staff {
+    \set Staff.instrumentName = "blo"
+    c1 c1 \break 
+    \set Staff.instrumentName = \markup { \hcenter-in #10 "blo" }
+    c1 c1 \break 
+    \set Staff.instrumentName = \markup {\combine \hspace #8 "blo" }
+    c1 c1 
+  } 
+  
+>>
diff --git a/input/lsr/nonmusic/printing-the-full-title-on-several-scores-in-the-same-file..ly b/input/lsr/nonmusic/printing-the-full-title-on-several-scores-in-the-same-file..ly
new file mode 100644 (file)
index 0000000..e61902d
--- /dev/null
@@ -0,0 +1,47 @@
+%%  Do not edit this file; it is auto-generated from LSR!
+\version "2.11.23"
+
+\header { texidoc = "
+By default, only the piece and opus fields from the \header@{...@}
+block are typeset above each separate score, if you have multiple
+\score@{...@} blocks in your input file.
+
+As is mentioned in the manual, you can change this by setting the paper
+variable  printallheaders, so that the full title is printed over each
+score. The corresponding \header@{...@} block should then be included
+within the corresponding \score@{...@} block,  otherwise you will get
+an additional title (the title for the full book) above the first 
+individual score title. This example shows how to get rid of the extra
+book level title.  Note that a top level \header@{...@} block is useful
+if some titling information is the  same for all scores and you do not
+want to repeat the information several times in the  input file.
+
+
+" }
+
+\header{
+  composer = "The One and Only"
+}
+
+
+
+\score{
+{c' d' e' f'}
+\header{
+  title = "First piece"
+}
+}
+
+\score{
+{c' d' e' f'}
+\header{
+  title = "Second piece"
+}
+}
+
+\paper{
+  printallheaders=##t
+  bookTitleMarkup = ##f
+}
+
+
diff --git a/input/lsr/parts/display-bracket-with-only-one-staff-in-a-system.ly b/input/lsr/parts/display-bracket-with-only-one-staff-in-a-system.ly
new file mode 100644 (file)
index 0000000..e73d259
--- /dev/null
@@ -0,0 +1,42 @@
+%%  Do not edit this file; it is auto-generated from LSR!
+\version "2.11.23"
+
+\header { texidoc = "
+If there is only one staff in one of the staff types ChoirStaff,
+InnerChoirStaff, InnerStaffGroup and StaffGroup, the bracket won't be
+displayed as standard behaviour. This can be changed with:
+
+
+@code{\override [staffcontext].SystemStartBracket #'collapse-height =
+#1}
+
+
+This applies to all staff contexts with
+@code{systemStartDelimiter}-property set to @code{'SystemStartBracket}.
+
+
+For staff contexts with @code{'SystemStartBrace}, such as
+@code{PianoStaff}, this tweaking can be used as well. 
+" }
+
+\score {
+  \new StaffGroup << 
+    % Must be one lower than your actual amount off staff lines
+    \override StaffGroup.SystemStartBracket #'collapse-height = #4 
+    \new Staff { 
+      c'4 d' e' f' 
+    }
+  >> 
+  } 
+  {
+  \new PianoStaff << 
+    \override PianoStaff.SystemStartBrace #'collapse-height = #4 
+    \new Staff { 
+      c'4 d' e' f' 
+    }
+  >> 
+  } 
+  \layout { 
+    ragged-right = ##t 
+    indent = 0\cm
+  }
diff --git a/input/lsr/parts/forcing-visibility-of-systems-with-multi-bar-rests-when-using--removeemptystaffcontext.ly b/input/lsr/parts/forcing-visibility-of-systems-with-multi-bar-rests-when-using--removeemptystaffcontext.ly
new file mode 100644 (file)
index 0000000..638bbd7
--- /dev/null
@@ -0,0 +1,90 @@
+%%  Do not edit this file; it is auto-generated from LSR!
+\version "2.11.23"
+
+\header { texidoc = "
+In an orchestral score, you may find it useful to hide multi-bar rests
+using @code{\RemoveEmptyStaffContext} to produce a \"Frenched\" score,
+but this can prove problematic when you want to make such bars visible.
+
+
+For example, imagine you are using a @code{PianoStaff} for a harp part.
+When there is music in one stave, you will want both staves to be
+visible. Of course, adding hidden notes to the invisible staff will
+make the stave visible, but this is a rather ugly kludge.
+
+
+A more elegant solution is to use the property
+@code{keepAliveInterfaces}. This determines which items of musical
+output are interesting enough to keep a bar visible when
+@code{remove-empty} is set. By default, it looks like this:
+
+
+@code{keepAliveInterfaces = #'(
+    rhythmic-grob-interface
+    lyric-interface
+    stanza-number-interface
+    percent-repeat-interface)}
+
+
+If you insert @code{multi-measure-rest-interface} into this list,
+multi-bar rests count as interesting items. You can then create macros
+to switch this behaviour on and off as required:
+
+
+@code{showMultiRests = @{ \set Staff.keepAliveInterfaces = #'(
+    rhythmic-grob-interface
+    multi-measure-rest-interface
+    lyric-interface
+    stanza-number-interface
+    percent-repeat-interface) @}}
+
+
+@code{hideMultiRests = \unset Staff.keepAliveInterfaces}
+
+
+For this to work successfully, you must place these macros carefully,
+otherwise they tend to interfere with the visibility of other hidden
+staves. 
+" }
+
+showMultiRests = { \set Staff.keepAliveInterfaces = #'(
+    rhythmic-grob-interface
+    multi-measure-rest-interface
+    lyric-interface
+    stanza-number-interface
+    percent-repeat-interface)
+}
+hideMultiRests = \unset Staff.keepAliveInterfaces
+one = { \repeat unfold 4 { a1 b c' d' \break }
+    R1 \showMultiRests R R \hideMultiRests R \break %Macro positioning is critical - overrides are inside each system,
+    R1*4 \break                                            %i.e. after first rest and before last
+    R
+}
+two = { \override MultiMeasureRest #'color = #red
+    R1*4
+    R1 \showMultiRests R R \hideMultiRests R
+    R1*4
+    R
+    R1 \showMultiRests R R R
+    R R R \hideMultiRests R
+    R1*4
+}
+three = { \override MultiMeasureRest #'color = #blue
+    R1*4
+    R
+    R1 \showMultiRests R R \hideMultiRests R
+    R1*4
+    R1 \showMultiRests R R \hideMultiRests R
+    R1*4
+    R1 \showMultiRests R R R
+}
+\score {
+    \new StaffGroup <<
+    \context Staff = one \one
+    \context Staff = two \two
+    \context Staff = three \three
+    >>
+    \layout {
+        \context { \RemoveEmptyStaffContext }
+    }
+}
diff --git a/input/lsr/parts/hiding-staves-with-rests-only-for-some-all-voices.ly b/input/lsr/parts/hiding-staves-with-rests-only-for-some-all-voices.ly
new file mode 100644 (file)
index 0000000..0c4e926
--- /dev/null
@@ -0,0 +1,76 @@
+%%  Do not edit this file; it is auto-generated from LSR!
+\version "2.11.23"
+
+\header { texidoc = "
+If you have a choir score, or an orchestral score, where some voices
+are quiet for a long time, you might want to hide staves containing
+nothing (or only multi-measure rests). By default, lilypond will show
+all staves, even if they only contain rests. To change this into what
+is sometimes called a \"French Score\" style, simply add the
+\RemoveEmptyStaffContext variable, in a \context block, to your \layout.
+
+The first system would still show all staves for all voices. To force
+this setting to also apply to the first system of a score, set
+#'remove-first of VerticalAxisGroup to ##t.
+
+If only one staff is displayed, the choir or the StaffGroup bracket
+would also be hidden, so you will probably need to set
+#'collapse-height of SystemStartBracket to #1 (or anything smaller than
+5, which is the usual number of lines in a staff, see also snippet
+\"Display bracket with only one stave in the system\").
+
+If you have some voices where you still want to display all (even
+empty) staves, you need to set the remove-empty property of the
+VerticalAxisGroup to true for that one staff only. You can do this in
+the \with section of the staff (in this example, the alto staff will
+never erase empty lines, while the soprano staff will).
+" }
+
+sop = \relative c'' {
+  R1*2 |\break 
+  c4 c c c | R1 |\break
+  R1*2 | \break
+  R1*2 |\break 
+  c4 c c c | R1 \bar"|."
+}
+
+alt = \relative c'' {
+  g4 g g g | R1 | \break |
+  R1*2 | \break
+  R1*2 | \break
+  g4 g g g | R1 | \break |
+  g4 g g g | R1 \bar"|."
+}
+
+\layout {
+  \context { 
+    % add the RemoveEmptyStaffContext that erases rest-only staves
+    \RemoveEmptyStaffContext 
+  }
+  \context {
+    \Score
+    % Remove all-rest staves also in the first system
+    \override VerticalAxisGroup #'remove-first = ##t
+  }
+  \context {
+    \ChoirStaff 
+    % If only one non-empty staff in a system exists, still print the backet
+    \override SystemStartBracket #'collapse-height = #1
+  }
+}
+
+\score{
+  \context ChoirStaff <<
+    \context Staff=soprano <<
+      \sop
+      \set Staff.shortInstrumentName = "S"
+    >>
+    % never remove empty staves from the alto staff:
+    \context Staff=alto \with { \override VerticalAxisGroup #'remove-empty = ##f }
+    <<
+      \alt
+      \set Staff.shortInstrumentName = "A"
+    >>
+  >>
+}
+