For parts where the percussionist switches from vibraphone to maracas, for example, is there a way to combine the two on the same staff? IIRC, LilyPond treats normal staves and percussion staffs completely separately.

  • Did you check the Lilypond Documentation online (lilypond.org/doc/v2.18/Documentation/notation/…)? It is totally possible to combine different percussion instruments in one staff. If the documentation does not contain your specific problem, please explain a bit more detailed what you want to achieve. Oct 14, 2019 at 17:53
  • I was specifically referring to pitches and unpitched instruments sharing a staff. \drummode is completely useless for the vibraphone sections of the part: the vibes need normal note entry.
    – cjm
    Oct 14, 2019 at 19:45
  • Okay, I understand. But I fear the only thing you can try is just using a pitched staff for the maracas as well. If you need midi output you can add an invisible additional drum staff that is just used for midi output. Oct 14, 2019 at 21:11
  • Say the maracas are a B-flat and override the staff to have one line and give an x notehead?
    – cjm
    Oct 14, 2019 at 22:01

1 Answer 1


I fear the only thing you can try is to just use a pitched staff for the maracas. You can adjust the visibility of accidentals and the line count of the system with overrides.

I am not fully sure, how your score will look in the end, but perhaps you could start like this:

\version "2.18.2"

startMaracas = {
  \override Staff.StaffSymbol.line-count = #1
  \override Staff.Accidental.stencil = ##f
  \override NoteHead.style = #'cross
  \once \override Staff.BarLine.bar-extent = #'(-2 . 2)

endMaracas = {
  \revert Staff.StaffSymbol.line-count
  \revert Staff.Accidental.stencil
  \revert NoteHead.style

\score {
  \new Staff {
    c'4^\markup{ "Vibraphone" } d' e' f' 
    c'4 d' e' f' 
    bes'4^\markup{ "Maracas" } bes' bes' bes'
    bes'4 bes' bes' bes'
    c'4^\markup{ "Vibraphone" } d' e' f' 
    c'4 d' e' f' 

Rendering as:

enter image description here

You can add the following function to your code if you want to use \changeInstrument "maracas" or \changeInstrument "somethingelse" instead of the defined macros:

changeInstrument = #(define-music-function (parser location instrument) (string?)
  (if (equal? instrument "maracas") 
    #{ \startMaracas #}
    #{ \endMaracas #} ) 
  • Could \startMaracas and \endMaracas be refactored to \instrumentSwitch "vibes" and \instrumentSwitch "maracas" (with the accompanying instrument switch definitions more or less identical to your start & end maracas definitions)?
    – cjm
    Oct 15, 2019 at 2:41
  • You could add a short scheme function to redefine your code. See my edit. Oct 15, 2019 at 8:41
  • 2
    I've been studying the score for a concert band piece lately (Shadow Rituals by Michael Markowski), and in that piece, I've seen unpitched percussion instruments share five-line staves with pitched percussion instruments.
    – Dekkadeci
    Oct 15, 2019 at 10:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.