lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

On creating a new all-encompassing drum mode (with example)


From: Mike J. Bell
Subject: On creating a new all-encompassing drum mode (with example)
Date: Wed, 8 Jun 2011 08:36:41 -0400

(reposted from lilypond-user at the suggestion of one of the readers, and includes my script)

I'm interested in making a custom drum mode that more accurately reflects the rules in Weinberg's Guide To Standardized Drumset Notation.  Some of the pieces seem to be straightforward, others not so much.  I made an example file that was as close as I could get it, but there are a number of problems with my approach.  In particular, one notehead uses custom postscript; two others use standard lilypond noteheads that aren't quite right; and there are other expressive marks or articulations that aren't 100%.  So not only am I not getting exactly the output I want, it's also moderately difficult to enter the notes themselves in some cases.

Has anyone already looked into updating lilypond's drum features to be compliant with GSDN?  If not, is there anyone out there that's put extensive time/effort into customizing their drum modes that would be willing to share their work so I might see best (or better!) practices on how to approach this?

Specific notes on some of the major problems with my approach:

1) I'd like the halfopen articulation to be a 0 with line straight up-and-down through it instead of slanted...my guess is this mark is embedded in the font and hard to change
2) The staccatissimo articulation appears directly over the choked cymbal note, instead of slightly behind (to the right) of it
3) The rimshot slash is rendered with custom postscript per notehead
4) There is no "circled default" notehead, so I used xcircle instead
5) The triangle notehead isn't the proper orientation for percussion (wide isosceles with base parallel to staff lines)
6) The acciaccatura I use for flams doesn't put the slur line in the direction I wish (it's over instead of under)
7) The grace I used for ruffs and drags doesn't put the slur line in the direction I wish (but I think I can override this)

These are mostly appearance-related.  Functional- or use-related issues are that I'd really like to be able to make new note names that are like macros so I don't need to be so specific at invocation.  I kind of want something like (pardon the pseudocode):

(define bell cymr->)
(define choke cymc-|)
(define rimshot sn^\markup { \postscript #"gsave 0.25 setlinewidth -0.2 -1.3 rmoveto 1.7 -1.7 rlineto stroke grestore" })
(define ghost < \parenthesize sn >)
(define flam \acciaccatura { sn8 } sn)
(define drag \grace { sn16[\( sn] } sn4\))

Except of course that each of those would need to put the note value in the correct place and be a valid _expression_, etc.

Here's my example:



\version "2.14.0"  % necessary for upgrading to future LilyPond versions.

#(define mydrums '(
         (bassdrum        default   #f          -3)
         (snare           default   #f           1)
         (hightom         default   #f           4)
         (himidtom        default   #f           3)
         (lowmidtom       default   #f           2)
         (lowtom          default   #f           0)
         (highfloortom    default   #f          -1)
         (lowfloortom     default   #f          -2)
         (hihat           cross     #f           5)
         (halfopenhihat   cross     "halfopen"   5)
         (openhihat       cross     "open"       5)
         (closedhihat     cross     "stopped"    5)
         (pedalhihat      cross     #f          -5)
         (longwhistle     cross     "open"      -5)
         (crashcymbal     cross     #f           6)
         (splashcymbal    cross     #f           7)
         (chinesecymbal   cross     #f           8)
         (ridecymbal      cross     #f           4)
         (electricsnare   diamond   #f           1)
         (sidestick       xcircle   #f           1)
         (triangle        triangle  #f           6)
         (mutetriangle    triangle  "stopped"    6)
         (cowbell         triangle  #f           3)
         (hiwoodblock     triangle  #f           2)
         (lowoodblock     triangle  #f           1)
         (tamtam          triangle  #f          -4)
))

% longwhistle == pedalhihatsplash
% electricsnare == rimshot (should be default with line through)
% tamtam is a gong

up = \drummode {
    s1
    sn4_\markup { \tiny "snare" } sn sn sn
    \times 2/3 { tomh4_\markup { \tiny "toms" } tommh tomml } \times 2/3 { toml tomfh tomfl }
    hh4_\markup { \tiny "hihat" } hhho hho hhc
    s1
    cymc4_\markup { \tiny "crash" } cyms_\markup { \tiny "splash" }
        cymch_\markup { \tiny "china" } cymr_\markup { \tiny "ride" }
    cymr4->_\markup { \tiny "bell" } cymr cymr->_\markup { \tiny "bell" } cymr     % use accent for ride bell
    cymc4-|_\markup { \tiny "choke" } cyms cymc-|_\markup { \tiny "choke" } cymch  % use pipe for choke
    sn4^\markup { \postscript #"gsave 0.25 setlinewidth -0.2 -1.3 rmoveto 1.7 -1.7 rlineto stroke grestore" }^\markup { \tiny "rim." } ss_\markup { \tiny "cross." }
        < \parenthesize sn >^\markup { \tiny "ghost" } sn-+_\markup { \tiny "stop" }
                                                                                  % use plus for stopped drum
    sn4^"R" sn^"L" sn^"R" sn^"L"
    tri4^\markup { \tiny "tri." } trim^\markup { \tiny "mute" } cb_\markup { \tiny "cowbell" } cb
    wbh4^\markup { \tiny "hi bl." } wbl^\markup { \tiny "low bl." } tt_\markup { \tiny "gong" } tt
    sn4:8^\markup { \tiny "rolls and equivalents" } sn8 sn s2
    sn4:16 sn16 sn sn sn s2
    \set subdivideBeams = ##t
    \set baseMoment = #(ly:make-moment 1 8)
    \set beatStructure = #'(2 2 2 2)
    sn4:32 sn32 sn sn sn sn sn sn sn s2
    \set subdivideBeams = ##f
    \times 2/3 { sn4:8 s8 } \times 2/3 { sn8 sn sn s } s4 \times 2/3 { s8 s }
    sn2:8 sn8 sn sn sn
    sn4.:8 s8 sn8 sn sn s
    \acciaccatura { sn8 } sn4^\markup { \tiny "flams" } s2 \acciaccatura { tommh8 } sn4   % flams
    \grace { sn16[\( sn] } sn4\)_\markup { \tiny "drag" } s2.                            % drags
    \grace { sn16[\(^\markup { \tiny R } sn]^\markup { \tiny L } }
        sn4\)_\markup { \tiny "ruff" } s2.                                     % ruffs
}
down = \drummode {
    bd4^\markup { \tiny "kick" } bd bd bd
    s1    s1    s1
    hhp4^\markup { \tiny "foot hat" } hhp whl^\markup { \tiny "hat splash" } whl
    s1    s1    s1    s1
    bd4_"R" bd_"L" bd_"R" bd_"L"
    s1    s1    s1    s1    s1    s1    s1    s1
    s2 \acciaccatura { bd8 } bd4 s4        % flams

}

\new DrumStaff \with {
    \consists "Parenthesis_engraver"
}
<<
  \set DrumStaff.drumStyleTable = #(alist->hash-table mydrums)
  \new DrumVoice { \voiceOne \up }
  \new DrumVoice { \voiceTwo \down }
>>




--
Mike J. Bell on gmail

reply via email to

[Prev in Thread] Current Thread [Next in Thread]