![]() |
GNU LilyPond-- -- |
||||||||||
|
Percussion stavesTo typeset more than one piece of percussion to be played by the same musician one typically uses a multiline staff where each staff position refers to a specific piece of percussion. LilyPond is shipped with a bunch of scheme functions which allows you to do this fairly easily. The system is based on the general midi drum-pitches.
In order to use the drum pitches you include
To typeset the music on a staff you apply the scheme function
\include "drumpitch-init.ly" up = \notes { crashcymbal4 hihat8 halfopenhihat hh hh hh openhihat } down = \notes { bassdrum4 snare8 bd r bd sn4 } \score { \apply #(drums->paper 'drums) \context Staff < \clef percussion \context Voice = up { \voiceOne \up } \context Voice = down { \voiceTwo \down } > } In the above example the music was transformed using the list 'drums .
Currently the following lists are defined in scm/drums.scm :
If you don't like any of the predefined lists you can define your own list at the top of your file: #(define mydrums `( (bassdrum default #f ,(ly:make-pitch -1 2 0)) (snare default #f ,(ly:make-pitch 0 1 0)) (hihat cross #f ,(ly:make-pitch 0 5 0)) (pedalhihat xcircle "stopped" ,(ly:make-pitch 0 5 0)) (lowtom diamond #f ,(ly:make-pitch -1 6 0)) )) \include "drumpitch-init.ly" up = \notes { hh8 hh hh hh hhp4 hhp } down = \notes { bd4 sn bd toml8 toml } \score { \apply #(drums->paper 'mydrums) \context Staff < \clef percussion \context Voice = up { \voiceOne \up } \context Voice = down { \voiceTwo \down } > } To use a modified existing list instead of building your own from scratch you can append your modifications to the start of the existing list: #(define mydrums (append `( (bassdrum default #f ,(ly:make-pitch -1 2 0)) (lowtom diamond #f ,(ly:make-pitch -1 6 0)) ) drums )) Percussion staves with normal stavesWhen you include \include "drumpitch-init.ly" up = \notes { crashcymbal4 hihat8 halfopenhihat hh hh hh openhihat } down = \notes { bassdrum4 snare8 bd r bd sn4 } \include "nederlands.ly" bass = \notes \transpose c c,, { a4. e8 r e g e } \score { < \apply #(drums->paper 'drums) \context Staff = drums < \clef percussion \context Voice = up { \voiceOne \up } \context Voice = down { \voiceTwo \down } > \context Staff = bass { \clef "F_8" \bass } > } Percussion midi outputIn order to produce correct midi output you need to produce two score
blocks - one for the paper and one for the midi.
To use the percussion channel you set the property \score { \apply #(drums->paper 'mydrums) \context Staff < \clef percussion \context Voice = up { \voiceOne \up } \context Voice = down { \voiceTwo \down } > \paper{} } \score { \context Staff < \property Staff.instrument = #'drums \up \down > \midi{} } BUGS This scheme is to be considered a temporary implementation. Even though the scheme will probably keep on working then the future might bring some other way of typesetting drums, and probably there will be made no great efforts in keeping things downwards compatible. |
||||||||||
Go back to index of LilyPond.
Please send GNU LilyPond questions and comments to lilypond-user@gnu.org. Please send comments on these web pages to (address unknown) Copyright (c) 1997--2002 Han-Wen Nienhuys and Jan Nieuwenhuizen. Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved. |
This page was built from LilyPond-1.7.14 (development-branch) by