]> git.donarmstrong.com Git - lilypond.git/commitdiff
NR: Replace \set Staff.instrumentName
authorJames Lowe <pkx@gnu.org>
Mon, 23 Jan 2017 20:52:53 +0000 (20:52 +0000)
committerJames Lowe <pkx@gnu.org>
Mon, 30 Jan 2017 16:02:40 +0000 (16:02 +0000)
Issue 5039

1st Patch - Notation Reference

Replace appropriate instances of

\set Staff.instrumentName = " ... "

with

\new Staff \with { instrumentName = " ... " }

Documentation/notation/editorial.itely
Documentation/notation/percussion.itely
Documentation/notation/pitches.itely
Documentation/notation/staff.itely

index b1fbb8b1c938966009c9674d6aaf75ed133dc19c..458fce1ff4d97dbd8c6f27c6afb0f14ed297f2df 100644 (file)
@@ -507,12 +507,13 @@ If @code{x11-color} cannot make sense of the parameter then the
 color returned defaults to black.
 
 @lilypond[verbatim,quote]
-\relative c'' {
-  \override Staff.StaffSymbol.color = #(x11-color 'SlateBlue2)
-  \set Staff.instrumentName = \markup {
-    \with-color #(x11-color 'navy) "Clarinet"
+\new Staff \with {
+  instrumentName = \markup {
+    \with-color #(x11-color 'red) "Clarinet"
+    }
   }
-
+  \relative c'' {
+  \override Staff.StaffSymbol.color = #(x11-color 'SlateBlue2)
   gis8 a
   \override Beam.color = #(x11-color "medium turquoise")
   gis a
@@ -536,12 +537,13 @@ Exact RGB colors can be specified using the Scheme function
 @code{rgb-color}.
 
 @lilypond[verbatim,quote]
+\new Staff \with {
+  instrumentName = \markup {
+    \with-color #(x11-color 'red) "Clarinet"
+    }
+  }
 \relative c'' {
   \override Staff.StaffSymbol.color = #(x11-color 'SlateBlue2)
-  \set Staff.instrumentName = \markup {
-    \with-color #(x11-color 'navy) "Clarinet"
-  }
-
   \override Stem.color = #(rgb-color 0 0 0)
   gis8 a
   \override Stem.color = #(rgb-color 1 1 1)
index c6502992b0796ddf8dd53ed75090f895b7a20d77..da730eb5f3b944bf72299b193d0ced9cbf8eb5cd 100644 (file)
@@ -466,27 +466,22 @@ delicate things have a look at @ref{Staff symbol}.
 
 A tambourine, entered with @q{tamb}:
 
-@lilypond[quote,verbatim]
+@lilypond[verbatim,quote]
 #(define mydrums '((tambourine default #t 0)))
 
-tambustaff = {
-  \override Staff.StaffSymbol.line-positions = #'( 0 )
-  \override Staff.BarLine.bar-extent = #'(-1.5 . 1.5)
-  \set DrumStaff.instrumentName = #"Tambourine"
-}
+\new DrumStaff \with { instrumentName = #"Tambourine" }
 
-\new DrumStaff {
-  \tambustaff
+\drummode {
   \set DrumStaff.drumStyleTable = #(alist->hash-table mydrums)
+  \override Staff.StaffSymbol.line-positions = #'( 0 )
+  \override Staff.BarLine.bar-extent = #'(-1.5 . 1.5)
 
-  \drummode {
-    \time 6/8
-    tamb8. 16 8 8 8 8 |
-    tamb4. 8 8 8 |
-    % the trick with the scaled duration and the shorter rest
-    % is neccessary for the correct ending of the trill-span!
-    tamb2.*5/6 \startTrillSpan s8 \stopTrillSpan |
-  }
+  \time 6/8
+  tamb8. 16 8 8 8 8 |
+  tamb4. 8 8 8 |
+  % the trick with the scaled duration and the shorter rest
+  % is neccessary for the correct ending of the trill-span!
+  tamb2.*5/6 \startTrillSpan s8 \stopTrillSpan |
 }
 @end lilypond
 
@@ -495,19 +490,14 @@ Music for Tam-Tam (entered with @q{tt}):
 @lilypond[quote,verbatim]
 #(define mydrums '((tamtam default #t 0)))
 
-tamtamstaff = {
-  \override Staff.StaffSymbol.line-positions = #'( 0 )
-  \override Staff.BarLine.bar-extent = #'(-1.5 . 1.5)
-  \set DrumStaff.instrumentName = #"Tamtam"
-}
+\new DrumStaff \with { instrumentName = #"Tamtam" }
 
-\new DrumStaff {
-  \tamtamstaff
-  \set DrumStaff.drumStyleTable = #(alist->hash-table mydrums)
+\drummode {
+\set DrumStaff.drumStyleTable = #(alist->hash-table mydrums)
+\override Staff.StaffSymbol.line-positions = #'( 0 )
+\override Staff.BarLine.bar-extent = #'(-1.5 . 1.5)
 
-  \drummode {
-    tt 1 \pp \laissezVibrer
-  }
+  tt 1 \pp \laissezVibrer
 }
 @end lilypond
 
@@ -517,20 +507,16 @@ Two different bells, entered with @q{cb} (cowbell) and @q{rb} (ridebell)
 #(define mydrums '((ridebell default #t  3)
                    (cowbell  default #t -2)))
 
-bellstaff = {
-  \override DrumStaff.StaffSymbol.line-positions = #'(-2 3)
+\new DrumStaff \with { instrumentName = #"Different Bells" }
+
+\drummode {
   \set DrumStaff.drumStyleTable = #(alist->hash-table mydrums)
+  \override DrumStaff.StaffSymbol.line-positions = #'(-2 3)
   \override Staff.BarLine.bar-extent = #'(-1.5 . 1.5)
-  \set DrumStaff.instrumentName = #"Different Bells"
-}
 
-\new DrumStaff {
-  \bellstaff
-  \drummode {
-    \time 2/4
-    rb8 8 cb8 16 rb16-> ~ |
-    16 8 16 cb8 8 |
-  }
+  \time 2/4
+  rb8 8 cb8 16 rb16-> ~ |
+  16 8 16 cb8 8 |
 }
 @end lilypond
 
@@ -575,22 +561,22 @@ drumsB = {
 
 \score {
   \new StaffGroup <<
-    \new DrumStaff {
-      \set DrumStaff.instrumentName = \markup {
+    \new DrumStaff \with {
+      instrumentName = \markup {
         \column {
           "Tambourine"
           "et"
           "caisse claire s. timbre"
         }
       }
-      \set DrumStaff.drumStyleTable = #(alist->hash-table mydrums)
-      \drumsA
-    }
-
-   \new DrumStaff {
-     \set DrumStaff.instrumentName = #"Grosse Caisse"
-     \set DrumStaff.drumStyleTable = #(alist->hash-table mydrums)
-     \drumsB }
+    drumStyleTable = #(alist->hash-table mydrums)
+  }
+  \drumsA
+  \new DrumStaff \with {
+    instrumentName = #"Grosse Caisse"
+    drumStyleTable = #(alist->hash-table mydrums)
+  }
+  \drumsB
   >>
 }
 @end lilypond
index 6b9e0981214fc37d19b8e47f298c26962e7c2d3e..15af95d1405ba6ff626fd31ee912f7581f559274 100644 (file)
@@ -1523,26 +1523,24 @@ playing in unison.
 
 @lilypond[verbatim,quote]
 \new GrandStaff <<
-  \new Staff = "violin" {
-    \relative c'' {
-      \set Staff.instrumentName = #"Vln"
-      \set Staff.midiInstrument = #"violin"
-      % not strictly necessary, but a good reminder
-      \transposition c'
-
-      \key c \major
-      g4( c8) r c r c4
-    }
+  \new Staff = "violin" \with {
+    instrumentName = #"Vln"
+    midiInstrument = #"violin"
   }
-  \new Staff = "clarinet" {
-    \relative c'' {
-      \set Staff.instrumentName = \markup { Cl (B\flat) }
-      \set Staff.midiInstrument = #"clarinet"
-      \transposition bes
-
-      \key d \major
-      a4( d8) r d r d4
-    }
+  \relative c'' {
+    % not strictly necessary, but a good reminder
+    \transposition c'
+    \key c \major
+    g4( c8) r c r c4
+  }
+  \new Staff = "clarinet" \with {
+    instrumentName = \markup { Cl (B\flat) }
+    midiInstrument = #"clarinet"
+  }
+  \relative c'' {
+    \transposition bes
+    \key d \major
+    a4( d8) r d r d4
   }
 >>
 @end lilypond
index d097535643b0bb9a4f6e6841755b11c07b65fa5c..d7ed3e6738b55b9cb8ac7bbc3cc496625c8d0eaf 100644 (file)
@@ -215,8 +215,8 @@ that it supports printing the instrument name directly.  For
 details, see @ref{Instrument names}.
 
 @lilypond[verbatim,quote]
-\new PianoStaff <<
-  \set PianoStaff.instrumentName = #"Piano"
+\new PianoStaff \with { instrumentName = #"Piano" }
+<<
   \new Staff \relative { c''1 c }
   \new Staff \relative { \clef bass c1 c }
 >>
@@ -961,20 +961,14 @@ printed and subsequent changes will be ignored:
 @lilypond[verbatim,quote,ragged-right]
 prepPiccolo = <>^\markup \italic { muta in Piccolo }
 
+prepFlute = <>^\markup \italic { muta in Flauto }
+
 setPiccolo = {
-  \set Staff.instrumentName = #"Piccolo"
-  \set Staff.shortInstrumentName = #"Picc."
-  \set Staff.midiInstrument = #"piccolo"
   <>^\markup \bold { Piccolo }
   \transposition c''
 }
 
-prepFlute = <>^\markup \italic { muta in Flauto }
-
 setFlute = {
-  \set Staff.instrumentName = #"Flute"
-  \set Staff.shortInstrumentName = #"Flt."
-  \set Staff.midiInstrument = #"flute"
   <>^\markup \bold { Flute }
   \transposition c'
 }
@@ -982,14 +976,17 @@ setFlute = {
 \new Staff \with {
   instrumentName = #"Flute"
   shortInstrumentName = #"Flt."
-  midiInstrument = #"flute"
 }
 \relative {
   g'1 g g g \break
   g1 g \prepPiccolo R R \break
+  \set Staff.instrumentName = #"Piccolo"
+  \set Staff.shortInstrumentName = #"Picc."
   \setPiccolo
   g1 g g g \break
   g1 g \prepFlute R R \break
+  \set Staff.instrumentName = #"Flute"
+  \set Staff.shortInstrumentName = #"Flt."
   \setFlute
   g1 g g g
 }