On 2023-04-26 16:24, [email protected] wrote:
Hi,

I'm just getting started with lilypond so I hope this issue is not obvious. As 
I'm playing the drums, many tutorials I found regarding lilypond do not quite 
apply in the details. So far the two things I've found 
arehttps://lilypondcookbook.com/toc  and the 
docshttps://lilypond.org/doc/v2.23/Documentation/notation/common-notation-for-percussion
  (if you've got additional nice tutorials, I'd be glad to have some more).

The thing I struggle the most is how to properly "organize" the lilypond code. 
Typically music (drum stuff especially when just writing a rough scheme) has lots of 
repetitions.

The problem I've got on this end is that when writing for drums usually you use 
two voices for the two hands (in one staff) e.g.

% from the tutorial I linked above
up = \drummode {
% Stems Up notes go here
}
down = \drummode {
% Stems Down notes go here
}
\score {<< \new DrumStaff <<
     \new DrumVoice { \voiceOne \up }
     \new DrumVoice { \voiceTwo \down }
}
. So to be able to use repetitions, I need lots of `<< \new Drumvoice{ \drummode{ 
\voiceOne content here }} \new Drumvoice{ \drummode{ \voiceTwo content here }} >>`. 
This looks so ugly and verbose (see the larger example below) that I'm wondering if I'm 
doing something wrong. Am I?

Does anyone of you has any experience working with drums in lilypond? Any 
examples (not as small as in the docs/simple tutorials where the issue of 
complexity does not arise but preferably not too large) I could have a look at? 
Any advices for me as a lilypond beginner?


PS:
Everything I state is just how I've read/learnt it so far and I'm just starting 
to get familiar with lilypond. So there might be errors in my statements.

I hope what I write is understandable (I'm no expert in music and technical 
terminology in a foreign language is always particularly difficult)



-----------------

An excerpt of my writing (just writing a sheet for a song, no composing) (and 
see the attached image for the output):

\repeat volta 2 {
   \repeat percent 3 {
     <<
       \new DrumVoice{
         \drummode{
           \voiceOne
           \repeat unfold 12 hh8
         }
       }
       \new DrumVoice{
         \drummode{
           \voiceTwo
           bd4 r8 sn4 r8
           bd4 r8 sn4 bd8
         }
       }
     >>
   }
}
\alternative{
   {
     <<
       \new DrumVoice{
         \drummode{
           \voiceOne
           \repeat unfold 11 hh8
         }
       }
       \new DrumVoice{
         \drummode{
           \voiceTwo
           bd4 r8 sn4 r8
           bd16 bd8 bd16 sn8 sn4 tomml16 tomml16
         }
       }
     >>
   }
   {
     <<
       \new DrumVoice{
         \drummode{
           \voiceOne
           \repeat unfold 11 hh8
         }
       }
       \new DrumVoice{
         \drummode{
           \voiceTwo
           bd4 r8 sn8 sn8 bd8
           bd16 bd8 bd16 sn8 sn8. sn16 sn16 sn16
         }
       }
     >>
   }
}

I think this is quite a codebase for such a small piece on the sheet and the 
only thing (apart from maybe using quite a lot newlines) blowing this up is 
that `\new Drumvoice` etc is being used everywhere
I've been writing drum scores for many years and I'm still learning new ways of doing things.

My approach is to use includes and variables as much as possible to reduce duplicating everything.

Taking bar 1 from your example, here's a simplified structure that I use:

_*Song_LetterSizePaper.ly*_

\version "2.24.0"

\include "Title.ly"
\include "../SetPaperSizeLetter.ly"
\include "../Variables.ly"
\include "CyDr.ly"

\header {
title = \thisTitle
subtitle = "     "  %% to force a space under the title
}

\score {
  \new DrumStaff
  <<
    \new DrumVoice { \voiceOne \Cy }
    \new DrumVoice { \voiceTwo \Dr }
  >>
  \layout { indent = 0.0\cm ragged-last = ##t }
}  % end of score

The includes:

_*Title.ly*_
\version "2.24.0"
thisTitle = "Title - Artist"

_*SetPaperSizeLetter.ly (One directory up so that other scores can use it)*_

\version "2.24.0"
\paper {
  #(set-paper-size "letter")
  % Centre the score with 1 inch left and right margins:
  left-margin = 1\in
  line-width = 6.5\in
  % That leaves 1 inch for the right margin.
}

_*Variables.ly (One directory up so that other scores can use it)*_

HHSix = \drummode { \repeat unfold 6 hh8 }

_*CyDr.ly*_

\version "2.24.0"

Cy = \drummode {
\HHSix
}

Dr = \drummode {
 \time 6/8
 \tempo 4 = 140             % or maybe 4. = 140?
 bd4. sn
}

As you learn, you will probably want to use your own definitions in your own DrumStaff.drumStyleTable, but to get going, try some simple scores and progress from there.

Reply via email to