3

I'm trying to write a 12/8 drum score in Lilypond, with a lot of 32nd note phrasing, and the default beam grouping looks a bit ugly to me:

default 32nd note beam grouping (Here's the above example in LilyBin: http://lilybin.com/w0s4nh/2)

I'd like it to be subdivided into 8th note groups, like this:

enter image description here

As can be seen on the LilyBin link I pasted above (line 36), I tried modifying the baseMoment parameter as per the documentation, but it doesn't matter what I set, the beaming always stays the same.

Is there anything else I should be doing here?

3
  • Er, just curious here, but didn't you get it to beam the way you want in the second picture there?
    – Neal
    Commented Jan 12, 2018 at 14:32
  • Hahaha, I'm actually copying a drum sheet to make it fit in fewer pages using lilypond, and the original beaming seems a lot prettier to me. The second picture comes from the original PDF I'm copying =).
    – nunks
    Commented Jan 12, 2018 at 14:38
  • Aha. Thanks. That's what I get for not paying close enough attention. :)
    – Neal
    Commented Jan 12, 2018 at 15:11

1 Answer 1

4

Here's a good start.

\layout {
  \context {
    \DrumStaff
      drumStyleTable = #(alist->hash-table drum-table)
      subdivideBeams = ##t
      baseMoment = #(ly:make-moment 1/8)
      beatStructure = #'(3 3 3 3)
  }
}
top = \drummode {
  cymc8 \repeat unfold 5 { cymr }
  cymr16 \repeat unfold 8 { sn32 }
  \repeat unfold 6 { toml }
  \repeat unfold 8 { tomfl }
}
bot = \drummode {
  bd4 bd16 bd
  sn bd sn bd sn bd
  bd8 \repeat unfold 5 { hhp }
}
\score {
  \new DrumStaff <<
    \new DrumVoice {
      \voiceOne \time 12/8 \top
    }
    \new DrumVoice {
      \voiceTwo \time 12/8 \bot
    }
  >>
  \layout {}
}

enter image description here

What this does end up doing is separating your code into more manageable parts: music is just music, layout is just layout, and score is just score. (Well, for the most part). So, when you need to make a change, you can pinpoint a lot more quickly where the change needs to happen.

In a case like this, you might need to temporarily intermix the music and the layout for only one Voice:

\layout {
  \context {
    \DrumStaff
      drumStyleTable = #(alist->hash-table drum-table)
  }
}
top = \drummode {
  \set Voice.subdivideBeams = ##t
  \set Voice.baseMoment = #(ly:make-moment 1/8)
  \set Voice.beatStructure = #'(3 3 3 3)
  cymc8 \repeat unfold 5 { cymr }
  cymr16 \repeat unfold 8 { sn32 }
  \repeat unfold 6 { toml }
  \repeat unfold 8 { tomfl }
}
bot = \drummode {
  bd4 bd16 bd
  sn bd sn bd sn bd
  bd8 \repeat unfold 5 { hhp }
}
\score {
  \new DrumStaff <<
    \new DrumVoice {
      \voiceOne \time 12/8 \top
    }
    \new DrumVoice {
      \voiceTwo \time 12/8 \bot
    }
  >>
  \layout {}
}

enter image description here

In my opinion, where you can achieve something "programmatically" like the first example, that is preferable. But, in a pinch, or where necessary, the second example can work.

1
  • Thanks! It's always nice to have separation of concerns. I see I still have a lot to learn about the different contexts in LilyPond, this isn't the first time I got all confused trying to change Score definitions when they should actually be Staff or Voice definitions. I updated the LilyBin example (lilybin.com/w0s4nh/3) for future reference. Thanks again! =)
    – nunks
    Commented Jan 12, 2018 at 16:10

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.