Next: , Previous: Piano, Up: Top


Percussion

adding-drum-parts.ly

LilyPond makes drums input quite easy, with powerful pre-configured tools such as the \drummode function and the DrumStaff context: drums are placed to their own staff positions (with a special clef symbol) and have note heads according to the drum. You can easily attach an extra symbol to the drum, and restrict the number of lines.

drh = \drummode { cymc4.^"crash" hhc16^"h.h." hh \repeat "unfold" 5 {hhc8 hho hhc8 hh16 hh} hhc4 r4 r2 }
drl = \drummode {\repeat "unfold" 3 {bd4 sn8 bd bd4 << bd ss >> } bd8 tommh tommh bd toml toml bd tomfh16 tomfh }
timb = \drummode { \repeat "unfold" 2 {timh4 ssh timl8 ssh r timh r4 ssh8 timl r4 cb8 cb} }

\score {
  \repeat "volta" 2 {
    <<
      \new DrumStaff \with {
	drumStyleTable = #timbales-style
	\override StaffSymbol #'line-count = #2
	\override BarLine #'bar-size = #2
      } <<
	\set Staff.instrumentName = "timbales"
	\timb
      >>
      \new DrumStaff <<
	\set Staff.instrumentName = "drums"
	\new DrumVoice {\stemUp \drh }
	\new DrumVoice {\stemDown \drl }
      >>
    >>
  }
  \layout {}

  \midi {
    \context {
      \Score
      tempoWholesPerMinute = #(ly:make-moment 120 4)
      }
    }


}

[image of music]

heavily-customized-polymetric-time-signatures.ly

Though the set-time-signature thing was not the most essential here, it has been included to show the beat of this piece (which is a template of a real balkan song!).

#(define (compound-time one two three four five six seven eight nine ten num)
  (markup #:override '(baseline-skip . 0) #:number 
   (#:line ((#:column (one num)) #:vcenter "+" (#:column (two num)) #:vcenter "+" (#:column (three num)) #:vcenter "+" (#:column (four num)) #:vcenter "+" (#:column (five num)) #:vcenter "+" (#:column (six num)) #:vcenter "+" (#:column (seven num)) #:vcenter "+" (#:column (eight num)) #:vcenter "+" (#:column (nine num)) #:vcenter "+" (#:column (ten num))))))


melody =
{         \relative c'' {
        \set Staff.instrumentName = "Bb Sop."
        \key g \major \time 25/8
	  \override Staff.TimeSignature #'stencil = #ly:text-interface::print
  \override Staff.TimeSignature #'text = #(compound-time "3" "2" "2" "3" "2" "2" "2" "3" "2" "2" "8" )
        c8[ c c] d4 c8[ c] b[ c b] a4 g fis8[ e d c] b'[ c d] e4-^ fis8[ g] | \break
        c,4. d4 c4 d4. c4 d c2 d4. e4-^ d4 |
        c4. d4 c4 d4. c4 d c2 d4. e4-^ d4 | \break
        c4. d4 c4 d4. c4 d c2 d4. e4-^ d4 |
        c4. d4 c4 d4. c4 d c2 d4. e4-^ d4 | \break }
}
drum = {
        \new DrumStaff \drummode
        {
                \bar "|:" bd4. ^\markup { "Drums" } sn4 bd \bar ":" sn4. bd4 sn \bar ":"
                bd sn bd4. sn4 bd \bar ":|" 
        }
}

{
 \melody 
 \drum 
}

[image of music]

jazz-combo-template.ly

Jazz tune for combo (horns, guitar, piano, bass, drums).


[image of music]

printing-music-with-different-time-signatures.ly

In the following snippet, two parts have a completely different time signature, and yet keep synchronized.

This can be achieved with the \compressMusic command, as demonstrated here.

The barlines can't be printed at the Score level anymore, so you have to remove the Barline_engraver and put it in the Staff context.

% Thanks to Adam James Wilson for this snippet

\paper {
       indent = #0
       ragged-right = ##t
}

global = { \time 3/4 { s2. * 3 } \bar "" \break { s2. * 3 }}

\layout {
       \context { \Score
               \remove "Timing_translator"
               \remove "Time_signature_engraver"
               \remove "Default_bar_line_engraver"
               \override SpacingSpanner #'uniform-stretching = ##t
               \override SpacingSpanner #'strict-note-spacing = ##t
               proportionalNotationDuration = #(ly:make-moment 1 64)
       }
       \context { \Staff
               \consists "Timing_translator"
               \consists "Default_bar_line_engraver"
               \consists "Time_signature_engraver"
       }
       \context { \Voice
               \remove Forbid_line_break_engraver
               tupletFullLength = ##t
       }
}


Bassklarinette =        \new Staff <<
               \global
               {
               \bar "|"
               \clef treble
               \time 3/8
               d''4.

               \bar "|"
               \time 3/4
               r8 des''2( c''8)

               \bar "|"
               \time 7/8
               r4. ees''2 ~

               \bar "|"
               \time 2/4
               \tupletUp
               \times 2/3 {ees''4 r4 d''4 ~}

               \bar "|"
               \time 3/8
               \tupletUp
               \times 3/4 {d''4 r4}

               \bar "|"
               \time 2/4
               e''2

               \bar "|"
               \time 3/8
       es''4.
\bar "|"
\time 3/4
r8 d''2 r8
\bar "|"
               }
       >>
Perkussion =    \new StaffGroup <<
               \new Staff <<
                       \global
                       {
                       \bar "|"
                       \clef percussion
                       \time 3/4
                       r4 c'2 ~

                       \bar "|"
                       c'2.

                       \bar "|"
                       R2.

                       \bar "|"
                       r2 g'4 ~

                       \bar "|"
                       g'2. ~

                       \bar "|"
                       g'2.
                       }
               >>
               \new Staff <<
                       \global
                       {
                       \bar "|"
                       \clef percussion
                       \time 3/4
                       R2.

                       \bar "|"
                       g'2. ~

                       \bar "|"
                       g'2.

                       \bar "|"
                       r4 g'2 ~

                       \bar "|"
                       g'2 r4

                       \bar "|"
                       g'2.
                       }
               >>
       >>

\score { <<  \Bassklarinette \Perkussion >>

}

[image of music]



Next: , Previous: Piano, Up: Top

This page is for LilyPond-2.11.40 (development-branch).

Report errors to http://post.gmane.org/post.php?group=gmane.comp.gnu.lilypond.bugs.

Your suggestions for the documentation are welcome.