1
0
Fork 0
mirror of https://github.com/kastdeur/lilydrum.git synced 2025-06-18 04:46:37 +02:00

Compare commits

..

No commits in common. "bafcc6ef6f307e469929b0a38e47bcbc1ad9055a" and "04633ac833cc532fff387b64597d61859be8d5ec" have entirely different histories.

9 changed files with 99 additions and 59 deletions

View file

@ -1,25 +1,19 @@
# Lilydrum (pipeband-drumming notation) # Lilydrum (pipeband-drumming notation)
[Lilypond](http://lilypond.org) does not cover drum notation for pipebands out of the box. Somehow, the drums part in lilypond does not cover a notation with only right and left hands
That is, right is above the line and left is below it. \ (also known as Swiss style drum notation).
In the same manner as the bagpipe.ly file included with Lilypond, this library allows to easily use this notation with opt-in elements. That is, right is above the line and left is below it.
See the [cheatsheet](./cheatsheet.pdf) ([ly](./cheatsheet.ly), [pdf](./cheatsheet.pdf)) for a handful of definitions. In the same manner as the bagpipe.ly file included with lilypond, flams and drags are defined as a shortcut.
![preview of the score](./example.preview.png) \ There has been such a lilypond include file earlier, made by Simon Froger
*(see [./example.ly](./example.ly) for fully annotated code and its [score](./example.pdf))* (which includes all of the above).
This repository builds on work.
There has been such a Lilypond include file earlier, made by Simon Froger. This repository builds on his work. The original file can still be found at [http://lsr.di.unimi.it/LSR/Snippet?id=970](http://lsr.di.unimi.it/LSR/Snippet?id=970).
The ~~original~~ (updated) file can be found at [http://lsr.di.unimi.it/LSR/Snippet?id=970](http://lsr.di.unimi.it/LSR/Snippet?id=970).
[His website (French) can be found here](https://simonfroger.wordpress.com/lilypond/caisse-claire-ecossaise/) [His website (French) can be found here](https://simonfroger.wordpress.com/lilypond/caisse-claire-ecossaise/)
This repository has also been converted into a [lyp](https://github.com/noteflakes/lyp) package: [lyp/lilydrum](https://github.com/lyp-packages/lilydrum). This repository has also been converted into a [lyp](https://github.com/noteflakes/lyp) package: [lyp/lilydrum](https://github.com/lyp-packages/lilydrum).
*shameless plug:* \
An example of scores typeset with this library can be found in
[kastdeur/pipeband-music](https://github.com/kastdeur/pipeband-music)
or
[on my website (pdf)](https://deboone.nl/scores/pipeband).
## How to use ## How to use
Add the following line to include the definitions for use in your document: Add the following line to include the definitions for use in your document:
@ -59,6 +53,48 @@ To make a pipeband drumstaff (a `DrumStaff` with a few specific changes) you can
*You do not need to use PipeBandDrumStaff to use the music definitions.* *You do not need to use PipeBandDrumStaff to use the music definitions.*
## Example piece
*(see [./example.ly](./example.ly) for fully annotated code and its [score](./example.pdf))*
![preview of the score](./example.preview.png)
This was generated by the following code.
```lilypond
\include "lilydrum.ly"
\header { title = "Standards 6/8" }
\score {
\new PipeBandDrumStaff {
\drummode {
\time 6/8
\repeat volta 2 {
\partial 8 d8:32( |
g8.)[ g16 \drag d8] d8.[ d16 \drag g8] |
g8.[ \drag d16 d8] d8.[ d16 \drag g8] |
\tutti {
\flam d8. d16 g8 d4.:32( |
d8.) g16 d8 \flam g4
}
d8:32( |
g8.)[ g16 \drag d8] d8.[ d16 \drag g8] |
g8.[ \drag d16 d8] d8.[ d16 \drag g8] |
\tutti{
\flam d8. d16:64( d8) \flam d8. d16 \flam g8 |
d8.:32( d16) \flam g8 \flam d4
}
}
}
}
}
```
### Embellishments (Side Drum) ### Embellishments (Side Drum)
Flams and Drags can be added using `\flam` and `\drag`. Flams and Drags can be added using `\flam` and `\drag`.
They can determine whether to be left or right by themselves for simple expressions. They can determine whether to be left or right by themselves for simple expressions.

View file

@ -8,8 +8,8 @@ drumgrace = #(define-music-function (parser location notes ) ( ly:music? ) #{
\once \override Beam.positions = #'(2 . 2) \once \override Beam.positions = #'(2 . 2)
\once \override DrumStaff.Stem.length = #5 \once \override DrumStaff.Stem.length = #5
\override Flag.stroke-style = #"grace" \override Flag.stroke-style = #"grace"
\override Score.GraceSpacing.spacing-increment = #0 \override Score.GraceSpacing #'spacing-increment = #0
\override Score.Stem.beamlet-max-length-proportion = #'(0.5 . 0.5) \override Score.Stem #'beamlet-max-length-proportion = #'(0.5 . 0.5)
% Print notes % Print notes
% Grace note timing is scaled, so they do not wander off too % Grace note timing is scaled, so they do not wander off too
@ -18,7 +18,7 @@ drumgrace = #(define-music-function (parser location notes ) ( ly:music? ) #{
\times 1/4 { \grace $notes } \times 1/4 { \grace $notes }
% Revert back % Revert back
\revert Score.Stem.beamlet-default-length \revert Score.Stem #'beamlet-default-length
\revert Flag.stroke-style \revert Flag.stroke-style
\stemNeutral \stemNeutral
#}) #})
@ -42,10 +42,10 @@ dragddr = \drummode { \drumgrace { g16[\dr g] } } % Drag right with start repea
draggdr = \drummode { \drumgrace { d16[\dr d] } } % Drag left with start repeat draggdr = \drummode { \drumgrace { d16[\dr d] } } % Drag left with start repeat
% Open Drags % Open Drags
odragd = \drummode { \drumgrace { << { g16[ g] } { s16 s32^\markup { \musicglyph #"scripts.open" } } >> } } % Open Drag right odragd = \drummode { \drumgrace { << { g16[ g] } { s16 s32^\markup { \musicglyph #"scripts.open" } } >> } } % Open Drag right
odragg = \drummode { \drumgrace { << { d16[ d] } { s16 s32^\markup { \musicglyph #"scripts.open" } } >> } } % Open Drag left odragg = \drummode { \drumgrace { << { d16[ d] } { s16 s32^\markup { \musicglyph #"scripts.open" } } >> } } % Open Drag left
odragddr = \drummode { \drumgrace { << { d16[\dr d] } { s16 s32^\markup { \musicglyph #"scripts.open" } } >> } } % Open Drag right with start repeat odragddr = \drummode { \drumgrace { << { d16[\dr d] } { s16 s32^\markup { \musicglyph #"scripts.open" } } >> } } % Open Drag right with start repeat
odraggdr = \drummode { \drumgrace { << { g16[\dr g] } { s16 s32^\markup { \musicglyph #"scripts.open" } } >> } } % Open Drag left with start repeat odraggdr = \drummode { \drumgrace { << { g16[\dr g] } { s16 s32^\markup { \musicglyph #"scripts.open" } } >> } } % Open Drag left with start repeat
% Ruff % Ruff
ruffg = \drummode { \drumgrace { d16[ g d] } } % Ruff right ruffg = \drummode { \drumgrace { d16[ g d] } } % Ruff right
@ -63,12 +63,18 @@ sruffddr = \drummode { \drumgrace { d16[\dr g g] } } % Swiss Ruff left with sta
%% Embellishment functions, automatic left or right %% %% Embellishment functions, automatic left or right %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
get-first-note = #(define-music-function (music) (ly:music?)
"Get the first note-event in @var{music}"
(let ((note (car (extract-typed-music music 'note-event))))
note
)
)
#(define (autohandFunc left right) #(define (autohandFunc left right)
"Return a music function that prepends @var{left} if the first next note-event is of type 'left-hand, "Return a music function that prepends @var{left} if the first next note-event is of type 'left-hand,
else it will prepend @var{right}" else it will prepend @var{right}"
(define-music-function (parser location music) (ly:music? ) (define-music-function (parser location music) (ly:music? )
(let ((note (_get-first-note music))) (let ((note (get-first-note music)))
#{ #{
#(if (string=? (symbol->string (ly:music-property note 'drum-type)) "left-hand") #(if (string=? (symbol->string (ly:music-property note 'drum-type)) "left-hand")
#{ $left #} #{ $left #}
@ -92,7 +98,6 @@ optflamdr = #(autohandFunc optflamgdr optflamddr )
% Drag % Drag
drag = #(autohandFunc dragg dragd ) drag = #(autohandFunc dragg dragd )
dragdr = #(autohandFunc draggdr dragddr ) dragdr = #(autohandFunc draggdr dragddr )
% Open Drag % Open Drag
odrag = #(autohandFunc odragg odragd ) odrag = #(autohandFunc odragg odragd )
odragdr = #(autohandFunc odraggdr odragddr ) odragdr = #(autohandFunc odraggdr odragddr )

View file

@ -336,25 +336,12 @@ flourish = #(define-music-function (parser location notes) (ly:music?)
% See issue #4 (https://github.com/kastdeur/lilydrum/issues/4) % See issue #4 (https://github.com/kastdeur/lilydrum/issues/4)
scoop = #(define-music-function (music) (ly:music?) scoop = #(define-music-function (music) (ly:music?)
(define (grace-music-filter event) #{
(let ((eventname (ly:music-property event 'name))) <>^"scoop"\startGroup
(not (eq? eventname 'GraceMusic)))) #(allbutlastnote music)
(let* <>\stopGroup
( #(lastnote music)
(music-copy (ly:music-deep-copy music)) #})
(es (extract-typed-music (music-filter grace-music-filter music-copy) 'note-event))
)
(if (< (length es) 2)
(ly:message "A scoop requires at least two notes for positioning"))
; do it anyway
#{
<>
-\tweak HorizontalBracketText.text "scoop"
-\tweak HorizontalBracketText.whiteout 1
\startGroup
#music
\stopGroup
#}))
%---------------------------------------------------% %---------------------------------------------------%
% music function definitions % music function definitions
%---------------------------------------------------% %---------------------------------------------------%

View file

@ -91,6 +91,18 @@ odr = #(define-event-function (parser location) () #{ -\tag #'tutti \startGroup
ofr = #(define-event-function (parser location) () #{ -\tag #'tutti \stopGroup #}) ofr = #(define-event-function (parser location) () #{ -\tag #'tutti \stopGroup #})
rn = #(define-event-function (parser location) () #{ -\tag #'tutti ^\markup \path #0.1 #'((moveto 0 0)(rlineto 0 1)(rlineto 4 0)(rlineto 0 -1)) #}) rn = #(define-event-function (parser location) () #{ -\tag #'tutti ^\markup \path #0.1 #'((moveto 0 0)(rlineto 0 1)(rlineto 4 0)(rlineto 0 -1)) #})
#(define (allbutlastnote mus)
"Reverse the elements, Pop of (cdr) the first element, Reverse again, put it in a SequentialMusic"
(let ((elts (ly:music-property mus 'elements)))
(make-music 'SequentialMusic 'elements (reverse (cdr (reverse elts))))
)
)
#(define (lastnote mus)
"Get the last element, make it a list, put it in a SequentialMusic"
(let ((elts (ly:music-property mus 'elements)))
(make-music 'SequentialMusic 'elements (list (last elts)))
)
)
tutti = tutti =
#(define-music-function (myMusic) (ly:music?) #(define-music-function (myMusic) (ly:music?)
(define (grace-music-filter event) (define (grace-music-filter event)
@ -103,8 +115,8 @@ tutti =
) )
(if (> (length es) 1) (if (> (length es) 1)
#{% multiple notes #{% multiple notes
<> \once \override HorizontalBracket.connect-to-neighbor = #'(#t #t)
\dr <>\dr
#myMusic #myMusic
\fr \fr
#} #}

View file

@ -4,20 +4,20 @@
% From Svenax's bagpipemusic % From Svenax's bagpipemusic
markText = #(define-music-function (parser location text) (string?) #{ markText = #(define-music-function (parser location text) (string?) #{
\once \override Score.RehearsalMark.self-alignment-X = #LEFT \once \override Score.RehearsalMark #'self-alignment-X = #LEFT
\mark \markup $text \mark \markup $text
#}) #})
markTextEol = #(define-music-function (parser location text) (string?) #{ markTextEol = #(define-music-function (parser location text) (string?) #{
\once \override Score.RehearsalMark.break-visibility = #end-of-line-visible \once \override Score.RehearsalMark #'break-visibility = #end-of-line-visible
\once \override Score.RehearsalMark.self-alignment-X = #RIGHT \once \override Score.RehearsalMark #'self-alignment-X = #RIGHT
\mark \markup $text \mark \markup $text
#}) #})
markTextEolDown = #(define-music-function (parser location text) (string?) #{ markTextEolDown = #(define-music-function (parser location text) (string?) #{
\once \override Score.RehearsalMark.break-visibility = #end-of-line-visible \once \override Score.RehearsalMark #'break-visibility = #end-of-line-visible
\once \override Score.RehearsalMark.self-alignment-X = #RIGHT \once \override Score.RehearsalMark #'self-alignment-X = #RIGHT
\once \override Score.RehearsalMark.direction = #DOWN \once \override Score.RehearsalMark #'direction = #DOWN
\mark \markup $text \mark \markup $text
#}) #})
altBracket = #(define-music-function (parser location tag) (string?) #{ altBracket = #(define-music-function (parser location tag) (string?) #{

View file

@ -6,7 +6,7 @@
This file builds on work done by Simon Froger. This file builds on work done by Simon Froger.
Substantial changes by ET de Boone (https://etdeboone.nl) Substantial changes by ET de Boone, Seaforth Highlanders of Holland (seaforth.nl)
Include by using : Include by using :
\include "[pathtothisfile]" e.g. "~/lilydrum.ly" \include "[pathtothisfile]" e.g. "~/lilydrum.ly"
@ -26,10 +26,10 @@
#(ly:set-option 'relative-includes #t) #(ly:set-option 'relative-includes #t)
\include "lilydrum/layout_tweaks.ily" \include "lib/layout_tweaks.ily"
\include "lilydrum/musical_functions.ily" \include "lib/musical_functions.ily"
\include "lilydrum/embellishments.ily" \include "lib/embellishments.ily"
\include "lilydrum/flourishing.ily" \include "lib/flourishing.ily"
\include "lilydrum/special_sticking.ily" \include "lib/special_sticking.ily"
\include "lilydrum/rehearsal_marks.ily" \include "lib/rehearsal_marks.ily"
\include "lilydrum/midi.ily" \include "lib/midi.ily"