Compare commits

...

5 Commits

Author SHA1 Message Date
Eric Teunis de Boone bafcc6ef6f Remove internal functions file 2023-08-18 13:58:06 +02:00
Eric Teunis de Boone 3b3844d7cb Update README 2023-08-18 13:58:03 +02:00
Eric Teunis de Boone a627bafd2a Closes #19: deprecation warnings due to property paths 2023-08-18 13:52:38 +02:00
Eric Teunis de Boone 5440780bb0 Put subfiles into subdirectory with the package name
This allows someone to use `\include lilydrum/embellishments.ily` if needed.
2023-08-18 13:52:38 +02:00
Eric Teunis de Boone 50da682fb6 Move internal functions into separate file for deprecation 2023-08-18 13:52:30 +02:00
9 changed files with 59 additions and 99 deletions

View File

@ -1,19 +1,25 @@
# Lilydrum (pipeband-drumming notation) # Lilydrum (pipeband-drumming notation)
Somehow, the drums part in lilypond does not cover a notation with only right and left hands [Lilypond](http://lilypond.org) does not cover drum notation for pipebands out of the box.
(also known as Swiss style drum notation). That is, right is above the line and left is below it. \
That is, right is above the line and left is below it. In the same manner as the bagpipe.ly file included with Lilypond, this library allows to easily use this notation with opt-in elements.
In the same manner as the bagpipe.ly file included with lilypond, flams and drags are defined as a shortcut. See the [cheatsheet](./cheatsheet.pdf) ([ly](./cheatsheet.ly), [pdf](./cheatsheet.pdf)) for a handful of definitions.
There has been such a lilypond include file earlier, made by Simon Froger ![preview of the score](./example.preview.png) \
(which includes all of the above). *(see [./example.ly](./example.ly) for fully annotated code and its [score](./example.pdf))*
This repository builds on 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). There has been such a Lilypond include file earlier, made by Simon Froger. This repository builds on his work.
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:
@ -53,48 +59,6 @@ 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

@ -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, Seaforth Highlanders of Holland (seaforth.nl) Substantial changes by ET de Boone (https://etdeboone.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 "lib/layout_tweaks.ily" \include "lilydrum/layout_tweaks.ily"
\include "lib/musical_functions.ily" \include "lilydrum/musical_functions.ily"
\include "lib/embellishments.ily" \include "lilydrum/embellishments.ily"
\include "lib/flourishing.ily" \include "lilydrum/flourishing.ily"
\include "lib/special_sticking.ily" \include "lilydrum/special_sticking.ily"
\include "lib/rehearsal_marks.ily" \include "lilydrum/rehearsal_marks.ily"
\include "lib/midi.ily" \include "lilydrum/midi.ily"

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,18 +63,12 @@ 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 #}
@ -98,6 +92,7 @@ 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

@ -335,13 +335,26 @@ 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)
<>^"scoop"\startGroup (let ((eventname (ly:music-property event 'name)))
#(allbutlastnote music) (not (eq? eventname 'GraceMusic))))
<>\stopGroup (let*
#(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,18 +91,6 @@ 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)
@ -115,8 +103,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?) #{