]> git.donarmstrong.com Git - lilypond.git/blobdiff - Documentation/user/percussion.itely
Merge master into nested-bookparts
[lilypond.git] / Documentation / user / percussion.itely
index 826cd60ad7badacf15b029b5b1d4229b509df11a..ce45bd7f5e12fbe6a4400ad8fc6ee23fffff6168 100644 (file)
     version that you are working on.  See TRANSLATION for details.
 @end ignore
 
+@c \version "2.11.61"
+
 @node Percussion
 @section Percussion
 
 @menu
-* TODO percussion node fix::    
+* Common notation for percussion::
 @end menu
 
-@node TODO percussion node fix
-@subsection TODO percussion node fix
+@node Common notation for percussion
+@subsection Common notation for percussion
 
 Rhythmic music is primarily used for percussion and drum notation, but it can
 also be used to show the rhythms of melodies.
 
 @menu
-* Showing melody rhythms::      
-* Entering percussion::         
-* Percussion staves::           
-* Ghost notes::                 
+* References for percussion::
+* Basic percussion notation::
+* Drum rolls::
+* Pitched percussion::
+* Percussion staves::
+* Custom percussion staves::
+* Ghost notes::
 @end menu
 
+@node References for percussion
+@unnumberedsubsubsec References for percussion
 
-@node Showing melody rhythms
-@unnumberedsubsubsec Showing melody rhythms
+TODO add more.
 
-Sometimes you might want to show only the rhythm of a melody.  This
-can be done with the rhythmic staff.  All pitches of notes on such a
-staff are squashed, and the staff itself has a single line
+@itemize
 
-@lilypond[quote,ragged-right,fragment,relative=1,verbatim]
-\new RhythmicStaff {
-  \time 4/4
-  c4 e8 f g2 | r4 g r2 | g1:32 | r1 |
-}
-@end lilypond
+@item Some percussion may be notated on a rhythmic staff; this is
+discussed in @ref{Showing melody rhythms}, and
+@ref{Instantiating new staves}.
+
+@item MIDI output is discussed in a separate section; please see
+@ref{Percussion in MIDI}.
+
+@end itemize
 
 @seealso
 
-Program reference: @internalsref{RhythmicStaff}.
+Notation Reference:
+@ref{Showing melody rhythms},
+@ref{Instantiating new staves}.
+@ref{Percussion in MIDI}.
 
+Snippets: @rlsr{Percussion}.
 
-@node Entering percussion
-@unnumberedsubsubsec Entering percussion
+
+@node Basic percussion notation
+@unnumberedsubsubsec Basic percussion notation
 
 @cindex percussion
 @cindex drums
 
-
 Percussion notes may be entered in @code{\drummode} mode, which is
-similar to the standard mode for entering notes.  Each piece of
-percussion has a full name and an abbreviated name, and both can be used
-in input files
+similar to the standard mode for entering notes.  The simplest way
+to enter percussion notes is to use the @code{\drums} command,
+which creates the correct context and entry mode for percussion:
 
-@lilypond[quote,ragged-right,verbatim]
+@lilypond[quote,verbatim]
 \drums {
-  hihat hh bassdrum bd
+  hihat4 hh bassdrum bd
 }
 @end lilypond
 
-The complete list of drum names is in the init file
-@file{ly/@/drumpitch@/-init@/.ly}.
-@c TODO: properly document this.
+This is shorthand for:
+
+@lilypond[quote,verbatim]
+\new DrumStaff {
+  \drummode {
+    hihat4 hh bassdrum bd
+  }
+}
+@end lilypond
+
+Each piece of percussion has a full name and an abbreviated name,
+and both can be used in input files.  The full list of percussion
+note names may be found in @ref{Percussion notes}.
+
+Note that the normal notation of pitches (such as @code{cis4}) in
+a @code{DrumStaff} context will cause an error message.
+Percussion clefs are added automatically to a @code{DrumStaff}
+contex, but other clefs may also be used.
+
+There are a few issues concerning MIDI support for percussion
+instruments; for details please see @ref{Percussion in MIDI}.
+
+@seealso
+
+Notation Reference: @ref{Percussion in MIDI}, @ref{Percussion notes}.
+
+File: @file{ly/@/drumpitch@/-init@/.ly}
+
+Snippets: @rlsr{Percussion}.
+
+
+@node Drum rolls
+@unnumberedsubsubsec Drum rolls
+
+Drum rolls are indicated with three slashes across the stem.  For
+quarter notes or longer the three slashes are shown explicitly,
+eighth notes are shown with two slashes (the beam being the
+third), and drum rolls shorter than eighths have one stem slash to
+supplement the beams.  This is achieved with the tremolo notation,
+@code{:32}, as described in @ref{Tremolo repeats}.  Here is an
+example of some snare rolls:
+
+@lilypond[quote,verbatim]
+\drums {
+  \time 2/4
+  sn16 sn8 sn16 sn8 sn8:32 ~
+  sn8 sn8 sn4:32 ~
+  sn4 sn8 sn16 sn16
+  sn4 r4
+}
+@end lilypond
+
+Sticking can be indicated by placing @code{^"R"} or @code{^"L"}
+after the note.  The @code{staff-padding} property may be
+overridden to achieve a pleasing baseline.
+
+@lilypond[quote,verbatim]
+\drums {
+  \repeat unfold 2 {
+    sn16 ^"L" sn^"R" sn^"L" sn^"L" sn^"R" sn^"L"  sn^"R" sn^"R"
+  }
+}
+@end lilypond
 
 @seealso
 
-Program reference: @internalsref{note-event}.
+Snippets: @rlsr{Percussion}.
+
+
+@node Pitched percussion
+@unnumberedsubsubsec Pitched percussion
+
+Certain pitched percussion instruments (e.g. xylophone,
+vibraphone, and timpani) are written using normal staves.
+This is covered in other sections of the manual.
+
+@seealso
+
+@c TODO: possibly link to an alternate section of NR 3.5, if
+@c "percussion in MIDI" gets a separate subsubsection for
+@c pitched percussion sounds.  -gp
+Notation Reference: @ref{Percussion in MIDI}.
+
+Snippets: @rlsr{Percussion}.
+
 
 @node Percussion staves
 @unnumberedsubsubsec Percussion staves
+
 @cindex percussion
 @cindex drums
 
 A percussion part for more than one instrument typically uses a
-multiline staff where each position in the staff refers to one piece
-of percussion.
-
+multiline staff where each position in the staff refers to one
+piece of percussion.  To typeset the music, the notes must be
+interpreted in @code{DrumStaff} and @code{DrumVoice} context.
 
-To typeset the music, the notes must be interpreted in a
-@internalsref{DrumStaff} and @internalsref{DrumVoice} contexts
-
-@lilypond[quote,ragged-right,verbatim]
-up = \drummode { crashcymbal4 hihat8 halfopenhihat hh hh hh openhihat }
-down = \drummode { bassdrum4 snare8 bd r bd sn4 }
-  \new DrumStaff <<
-    \new DrumVoice { \voiceOne \up }
-    \new DrumVoice { \voiceTwo \down }
-  >>
+@lilypond[quote,verbatim]
+up = \drummode {
+  crashcymbal4 hihat8 halfopenhihat hh hh hh openhihat
+}
+down = \drummode {
+  bassdrum4 snare8 bd r bd sn4
+}
+\new DrumStaff <<
+  \new DrumVoice { \voiceOne \up }
+  \new DrumVoice { \voiceTwo \down }
+>>
 @end lilypond
 
 The above example shows verbose polyphonic notation.  The short
-polyphonic notation, described in @rlearning{I'm seeing Voices},
-can also be used if the @internalsref{DrumVoice}s are instantiated
-by hand first.  For example,
+polyphonic notation, described in @rlearning{I'm hearing Voices},
+can also be used if the voices are instantiated by hand first.
+For example,
 
-@lilypond[quote,ragged-right,fragment,verbatim]
+@lilypond[quote,verbatim]
 \new DrumStaff <<
-  \new DrumVoice = "1" { s1 *2 }
-  \new DrumVoice = "2" { s1 *2 }
+  \new DrumVoice = "1" { s1*2 }
+  \new DrumVoice = "2" { s1*2 }
   \drummode {
     bd4 sn4 bd4 sn4
-    <<
-      { \repeat unfold 16 hh16 }
-      \\
-      { bd4 sn4 bd4 sn4 }
-    >>
+    << {
+      \repeat unfold 16 hh16
+    } \\ {
+      bd4 sn4 bd4 sn4
+    >>
   }
 >>
 @end lilypond
 
-
 There are also other layout possibilities.  To use these, set the
-property @code{drumStyleTable} in context @internalsref{DrumVoice}.
-The following variables have been predefined
+property @code{drumStyleTable} in context @code{DrumVoice}.  The
+following variables have been predefined:
 
+@c FIXME: decide what to do about this table.  (ie verbatim or not)
 @table @code
+
 @item drums-style
-This is the default.  It typesets a typical drum kit on a five-line staff
+This is the default.  It typesets a typical drum kit on a
+five-line staff:
 
 @lilypond[quote,line-width=10.0\cm]
 nam = \lyricmode {
@@ -150,13 +242,13 @@ mus = \drummode {
 }
 @end lilypond
 
-The drum scheme supports six different toms.  When there are fewer toms,
-simply select the toms that produce the desired result, i.e., to get toms
-on the three middle lines you use @code{tommh}, @code{tomml}, and
-@code{tomfh}.
+The drum scheme supports six different toms.  When there are fewer
+toms, simply select the toms that produce the desired result.  For
+example, to get toms on the three middle lines you use
+@code{tommh}, @code{tomml}, and @code{tomfh}.
 
 @item timbales-style
-This typesets timbales on a two line staff
+This typesets timbales on a two line staff:
 
 @lilypond[quote,ragged-right]
 nam = \lyricmode { timh ssh timl ssl cb }
@@ -181,7 +273,7 @@ mus = \drummode { timh ssh timl ssl cb s16 }
 @end lilypond
 
 @item congas-style
-This typesets congas on a two line staff
+This typesets congas on a two line staff:
 
 @lilypond[quote,ragged-right]
 nam = \lyricmode { cgh cgho cghm ssh cgl cglo cglm ssl }
@@ -207,7 +299,7 @@ mus = \drummode { cgh cgho cghm ssh cgl cglo cglm ssl s16 }
 @end lilypond
 
 @item bongos-style
-This typesets bongos on a two line staff
+This typesets bongos on a two line staff:
 
 @lilypond[quote,ragged-right]
 nam = \lyricmode { boh boho bohm ssh bol bolo bolm ssl }
@@ -233,7 +325,7 @@ mus = \drummode { boh boho bohm ssh bol bolo bolm ssl s16 }
 @end lilypond
 
 @item percussion-style
-To typeset all kinds of simple percussion on one line staves.
+To typeset all kinds of simple percussion on one line staves:
 
 @lilypond[quote,ragged-right]
 nam = \lyricmode { tri trio trim gui guis guil cb cl tamb cab mar hc }
@@ -256,10 +348,14 @@ mus = \drummode { tri trio trim gui guis guil cb cl tamb cab mar hc s16 }
 @end lilypond
 @end table
 
-If you do not like any of the predefined lists you can define your own
-list at the top of your file
 
-@lilypond[quote,ragged-right,verbatim]
+@node Custom percussion staves
+@unnumberedsubsubsec Custom percussion staves
+
+If you do not like any of the predefined lists you can define your
+own list at the top of your file.
+
+@lilypond[quote,verbatim]
 #(define mydrums '(
          (bassdrum     default   #f         -1)
          (snare        default   #f         0)
@@ -277,29 +373,196 @@ down = \drummode { bd4 sn bd toml8 toml }
 @end lilypond
 
 
-@seealso
+@snippets
+
+FIXME: MOVE ALL THESE TO LSR!  -gp
+
+Here are some examples:
+
+Two Woodblocks, entered with wbh (high woodblock) and wbl (low woodblock)
+
+@lilypond[quote,verbatim]
+% These lines define the position of the woodblocks in the stave;
+% if you like, you can change it or you can use special note heads
+% for the woodblocks.
+#(define mydrums '((hiwoodblock default #t  3)
+                   (lowoodblock default #t -2)))
+
+woodstaff = {
+  % This defines a staff with only two lines.
+  % It also defines the positions of the two lines.
+  \override Staff.StaffSymbol #'line-positions = #'(-2 3)
+
+  % This is neccessary; if not entered, the barline wuld be too short!
+  \override Staff.BarLine #'bar-size = #3
+}
 
-Init files: @file{ly/@/drumpitch@/-init@/.ly}.
+\new DrumStaff {
+  \set DrumStaff.drumStyleTable = #(alist->hash-table mydrums)
 
-Program reference: @internalsref{DrumStaff}, @internalsref{DrumVoice}.
+  % with this you load your new drum style table
+  \woodstaff
 
-@refbugs
+  \drummode {
+    \time 2/4
+    wbl8 wbl16 wbl wbh8-> wbl |
+    wbl8 wbl16 wbh-> ~ wbh wbl16 r8 |
+  }
+}
+@end lilypond
+
+Note that in this special case the length of the barline must
+altered with @code{\override Staff.BarLine #'bar-size #number}.
+Otherwise it would be too short.  And you have also to define the
+positions of the two stafflines.  For more information about these
+delicate things have a look at @ref{Staff symbol}.
+
+A tambourine, entered with @q{tamb}:
+
+@lilypond[quote,verbatim]
+tambustaff = {
+  \override Staff.StaffSymbol #'line-positions = #'( 0 )
+  \override Staff.BarLine #'bar-size = #3
+  \set DrumStaff.instrumentName = "Tambourine"
+}
 
-Because general MIDI does not contain rim shots, the sidestick is used
-for this purpose instead.
+\new DrumStaff {
+  \tambustaff
+  % broken
+  % \set DrumStaff.drumStyleTable = #(alist->hash-table mydrums)
 
+  \drummode {
+    \time 6/8
+    \repeat "unfold" 2 { tamb8. tamb16 tamb8 tamb tamb tamb | }
+    tamb4. tamb8 tamb tamb |
+    % 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
+
+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-size = #3
+  \set DrumStaff.instrumentName = "Tamtam"
+}
 
-@c FIXME: check name -gp
+\new DrumStaff {
+  \tamtamstaff
+  \set DrumStaff.drumStyleTable = #(alist->hash-table mydrums)
+
+  \drummode {
+    tt 1 \pp \laissezVibrer
+  }
+}
+@end lilypond
+
+Two different bells, entered with @q{cb} (cowbell) and @q{rb} (ridebell)
+
+@lilypond[quote,verbatim]
+#(define mydrums '((ridebell default #t  3)
+                   (cowbell  default #t -2)))
+
+bellstaff = {
+  \override DrumStaff.StaffSymbol #'line-positions = #'(-2 3)
+  \set DrumStaff.drumStyleTable = #(alist->hash-table mydrums)
+  \override Staff.BarLine #'bar-size = #3
+  \set DrumStaff.instrumentName = "Different Bells"
+}
+
+\new DrumStaff {
+  \bellstaff
+  \drummode {
+    \time 2/4
+    \repeat "unfold" 2 { rb8 rb cb cb16 rb-> ~ |
+                         rb16 rb8 rb16 cb8 cb | }
+  }
+}
+@end lilypond
+
+Here an short example by maestro Stravinsky (from @q{L'histoire du Soldat})
+
+@lilypond[quote,verbatim]
+#(define mydrums '((bassdrum   default #t  4)
+                   (snare      default #t -4)
+                   (tambourine default #t  0)))
+
+global = {
+  \time 3/8 s4.
+  \time 2/4 s2*2
+  \time 3/8 s4.
+  \time 2/4 s2
+}
+
+drumsA = {
+  \context DrumVoice <<
+    { \global }
+    { \drummode {
+        \autoBeamOff
+        \stemDown sn8 \stemUp tamb s8 |
+        sn4 \stemDown sn4 |
+        \stemUp tamb8 \stemDown sn8 \stemUp sn16 \stemDown sn \stemUp sn8 |
+        \stemDown sn8 \stemUp tamb s8 |
+        \stemUp sn4 s8 \stemUp tamb
+      }
+    }
+  >>
+}
+
+drumsB = {
+  \drummode {
+    s4 bd8 s2*2 s4 bd8 s4 bd8 s8
+  }
+}
+
+\layout {
+  indent = #40
+}
+
+\score {
+  \new StaffGroup <<
+    \new DrumStaff {
+      \set DrumStaff.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 }
+  >>
+}
+@end lilypond
+
+@seealso
+
+Snippets: @rlsr{Percussion}.
+
+Internals Reference: @rinternals{DrumStaff}, @rinternals{DrumVoice}.
+
+
+
+@c TODO: check name -gp
 @node Ghost notes
 @unnumberedsubsubsec Ghost notes
 
 Ghost notes for drums and percussion may be created using the
-@code{\parenthesize} command detailed in @ref{Parentheses}.  However,
-the default @code{\drummode} does
-not include the @code{Parenthesis_engraver} plugin which allows
-this.  You
-must add the plugin explicitly in the context definition as
-detailed in @ref{Changing context properties on the fly}.
+@code{\parenthesize} command detailed in @ref{Parentheses}.
+However, the default @code{\drummode} does not include the
+@code{Parenthesis_engraver} plugin which allows this.
 
 @lilypond[quote,ragged-right,verbatim,fragment]
 \new DrumStaff \with {
@@ -311,8 +574,8 @@ detailed in @ref{Changing context properties on the fly}.
     <<
       {
         hh8[ hh] <hh sn> hh16
-        < \parenthesize sn > hh < \parenthesize
-        sn > hh8 <hh sn> hh
+        < \parenthesize sn > hh
+        < \parenthesize sn > hh8 <hh sn> hh
       } \\ {
         bd4 r4 bd8 bd r8 bd
       }
@@ -325,5 +588,6 @@ detailed in @ref{Changing context properties on the fly}.
 Also note that you must add chords (@code{< >} brackets)
 around each @code{\parenthesize} statement.
 
+@seealso
 
-
+Snippets: @rlsr{Percussion}.