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 {}
}
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 {}
}
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.