1
0
Fork 0
mirror of https://github.com/kastdeur/lilydrum.git synced 2025-05-17 13:29:12 +02:00

Updated README file, renamed folder

This commit is contained in:
Eric Teunis de Boone 2017-05-03 13:16:58 +02:00
parent a555d378d1
commit 36782f48b0
9 changed files with 63 additions and 42 deletions

89
lib/embellishments.ily Normal file
View file

@ -0,0 +1,89 @@
% ================================================= %
% Flams, Drags & the sort %
% ================================================= %
drumgrace = #(define-music-function (parser location notes ) ( ly:music? ) #{
% Set settings
\stemUp
\once \override Beam.positions = #'(2 . 2)
\once \override DrumStaff.Stem.length = #5
\override Flag.stroke-style = #"grace"
\override Score.GraceSpacing #'spacing-increment = #0
\override Score.Stem #'beamlet-max-length-proportion = #'(0.5 . 0.5)
% Print notes
\small \grace $notes
% Revert back
\revert Score.Stem #'beamlet-default-length
\revert Flag.stroke-style
\stemNeutral
#})
% Flams
flamd = \drummode { \drumgrace { g8 } } % Flam right
flamg = \drummode { \drumgrace { d8 } } % Flam left
flamddr = \drummode { \drumgrace { g8\dr } } % Flam right with start repeat
flamgdr = \drummode { \drumgrace { d8\dr } } % Flam left with start repeat
% Drags
dragd = \drummode { \drumgrace { g16[ g] } } % Drag right
dragg = \drummode { \drumgrace { d16[ d] } } % Drag left
dragddr = \drummode { \drumgrace { g16[\dr g] } } % Drag right with start repeat
draggdr = \drummode { \drumgrace { d16[\dr d] } } % Drag left with start repeat
% Open Drags
odragd = \drummode { \drumgrace { g16[ <>^"o" g] } } % Open Drag right
odragg = \drummode { \drumgrace { d16[ <>^"o" d] } } % Open Drag left
odragddr = \drummode { \drumgrace { g16[\dr <>^"o" g] } } % Open Drag right with start repeat
odraggdr = \drummode { \drumgrace { d16[\dr <>^"o" d] } } % Open Drag left with start repeat
% Ruff
ruffg = \drummode { \drumgrace { g16[ d g] } } % Ruff right
ruffd = \drummode { \drumgrace { d16[ g d] } } % Ruff left
ruffgdr = \drummode { \drumgrace { g16[\dr d g] } } % Ruff right with start repeat
ruffddr = \drummode { \drumgrace { d16[\dr g d] } } % Ruff left with start repeat
% Swiss Ruff
sruffg = \drummode { \drumgrace { g16[ d d] } } % Swiss Ruff right
sruffd = \drummode { \drumgrace { d16[ g g] } } % Swiss Ruff left
sruffgdr = \drummode { \drumgrace { g16[\dr d d] } } % Swiss Ruff right with start repeat
sruffddr = \drummode { \drumgrace { d16[\dr g g] } } % Swiss Ruff left with start repeat
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Embellishment functions, automatic left or right %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#(define (autohandFunc left right)
(define-music-function (parser location note) (ly:music? )
#{
#(newline)
#(display "Fix autohand function for arbitrary depth")
#(if (string=? (symbol->string (ly:music-property note 'drum-type)) "left-hand")
#{ $left #}
#{ $right #})
% print the note, else it won't show up
$note
#}
)
)
% Flam
flam = #(autohandFunc flamg flamd)
flamdr = #(autohandFunc flamgdr flamddr )
% Drag
drag = #(autohandFunc dragg dragd )
dragdr = #(autohandFunc draggdr dragddr )
% Open Drag
odrag = #(autohandFunc odragg odragd )
odragdr = #(autohandFunc odraggdr odragddr )
% Ruff
ruff = #(autohandFunc ruffg ruffd )
ruffdr = #(autohandFunc ruffgdr ruffddr )
% Swiss Ruff
sruff = #(autohandFunc sruffg sruffd )
sruffdr = #(autohandFunc sruffgdr sruffddr )

358
lib/flourishing.ily Normal file
View file

@ -0,0 +1,358 @@
% ================================================= %
% Tenor Flourishing %
% ================================================= %
% Part of lilydrum
%---------------------------------------------------%
% Single note flourish definitions
%---------------------------------------------------%
splitTheFeather = ^\markup \center-column { \musicglyph #"noteheads.s2xcircle"}
cartWheel = ^\markup \center-column { \musicglyph #"timesig.neomensural94" }
up = ^\markup \center-column {% Arrow-head and line do not line up nicely most of the time
\fontsize #5
\override #'(thickness . 2)
%\center-column {
\combine
% \musicglyph #"arrowheads.open.11"
\arrow-head #Y #UP ##f
\draw-line #'(0 . -3) % draw stick
%}
}
bfly = ^\markup \center-column { \char ##x221E }
rblfy = ^\markup \center-column {
\line{
\combine
\arrow-head #X #LEFT ##f
\draw-line #'(3 . 0 )
}
\line { \char ##x221E }
}
rthrow = ^\markup \center-column {
\postscript #"
/width 2 def
/radius .4 def
/filled 1 def
/height .6 def
/fwidth width radius add def
/closedpoint {
radius 0 360 arc
gsave filled neg
setgray fill
grestore
stroke } def
/dotstick {
0 0 moveto
0 0 closedpoint
0 0 moveto
fwidth neg 0 lineto
fwidth neg height neg moveto
fwidth neg height lineto
stroke } def
newpath
fwidth height translate
0 0 dotstick
stroke
"
}
lthrow = ^\markup \center-column {
\postscript #"
/width 2 def
/radius .4 def
/filled 1 def
/height .6 def
/fwidth width radius add def
/closedpoint {
radius 0 360 arc
gsave filled neg
setgray fill
grestore
stroke } def
/dotstick {
radius 0 closedpoint
radius 0 moveto
fwidth 0 lineto
fwidth height neg moveto
fwidth height lineto
stroke } def
newpath
0 height translate
0 0 dotstick
stroke
"
}
bthrow = ^\markup \center-column {
\postscript #"
/width 2 def
/radius .4 def
/filled 1 def
/height .6 def
/fwidth width radius add def
/closedpoint {
radius 0 360 arc
gsave filled neg
setgray fill
grestore
stroke } def
/dotstick {
fwidth 0 closedpoint
fwidth 0 moveto
0 0 lineto
0 height neg moveto
0 height lineto
stroke } def
newpath
fwidth height translate
0 0 dotstick
180 rotate
fwidth 0 dotstick
stroke
"
}
rpush = ^\markup \center-column {
\postscript #"
/width 2 def
/radius .4 def
/filled 1 def
/height .6 def
/fwidth width radius add def
/closedpoint {
radius 0 360 arc
gsave filled neg
setgray fill
grestore
stroke } def
/dotstick {
0 0 moveto
0 0 closedpoint
0 0 moveto
fwidth neg 0 lineto
fwidth radius add 2 div neg 0 moveto
fwidth radius add 2 div neg radius neg
radius 90 450 arc
gsave filled
setgray fill
grestore
fwidth neg height neg moveto
fwidth neg height lineto
stroke } def
newpath
fwidth height translate
0 0 dotstick
stroke
"
}
lpush = ^\markup \center-column {
\postscript #"
/width 2 def
/radius .4 def
/filled 1 def
/height .6 def
/fwidth width radius add def
/closedpoint {
radius 0 360 arc
gsave filled neg
setgray fill
grestore
stroke } def
/dotstick {
radius 0 closedpoint
radius 0 moveto
fwidth 0 lineto
fwidth radius add 2 div 0 moveto
fwidth radius add 2 div radius neg
radius 90 450 arc
gsave filled
setgray fill
grestore
fwidth height neg moveto
fwidth height lineto
stroke } def
newpath
0 height translate
0 0 dotstick
stroke
" }
bpush = ^\markup \center-column {
\postscript #"
/width 2 def
/radius .4 def
/filled 1 def
/height .6 def
/fwidth width radius add def
/closedpoint {
radius 0 360 arc
gsave filled neg
setgray fill
grestore
stroke } def
/dotstick {
fwidth 0 closedpoint
fwidth 0 moveto
0 0 lineto
fwidth sub 2 div 0 moveto
fwidth radius sub 2 div radius neg
radius 90 450 arc
gsave filled
setgray fill
grestore
0 height neg moveto
0 height lineto
stroke } def
newpath
fwidth height translate
0 0 dotstick
-1 1 scale
fwidth 0 dotstick
stroke
"
}
andrewStop = ^\markup \center-column {
\postscript #"
/width .4 def
/radius width def
/filled 1 def
/height 2 def
/fheight height radius add def
/closedpoint {
radius 0 360 arc
gsave filled neg
setgray fill
grestore
stroke } def
/dotstick {
0 fheight closedpoint
0 fheight moveto
0 0 lineto
width neg 0 lineto
width 0 lineto
stroke } def
newpath
0 0 translate
-45 rotate
newpath
0 0 dotstick
stroke
45 rotate
fheight .5 sqrt mul 0 translate
45 rotate
0 0 dotstick
stroke
"
}
quiggs = ^\markup \center-column {
%\with-dimensions #'(-0.2 . 2.0) #'(0 . 2.0)
\postscript #"
/width 1 def
/radius .4 def
/filled 1 def
/height 2 def
/fheight height radius add def
/closedpoint {
radius 0 360 arc
gsave filled neg
setgray fill
grestore
stroke } def
/dotstick {
0 height closedpoint
0 height moveto
0 0 lineto
stroke } def
/invdotstick {
0 radius closedpoint
0 radius moveto
0 fheight lineto
stroke } def
newpath
0 0 dotstick
stroke
width 0 translate
newpath
0 0 invdotstick
stroke
"
}
stop = ^\markup \center-column {
%\with-dimensions #'(-0.2 . 2.0) #'(0 . 2.0)
\postscript #"
/height 2 def
/width .4 def
/radius width def
/filled 0 def
/fheight height radius add def
width 0 translate
newpath
0 fheight radius 0 360 arc gsave filled neg setgray fill grestore stroke
0 fheight moveto 0 0 lineto
width neg 0 moveto width 0 lineto
stroke
"
}
%---------------------------------------------------%
% Multiple note flourish definitions
%---------------------------------------------------%
flourish = #(define-music-function (parser location notes) (ly:music?)
#{
\temporary \override Staff.NoteHead.style = #'cross
$notes
\revert Staff.NoteHead.style
#})
scoop = ^\markup {
\path #.2 #'( (moveto 0 0 )
(lineto 3 1 )
(lineto 6 0 )
)
}
scoopo = #(define-music-function (parser location beg notes) (ly:music? ly:music?)
#{
%Set spanner from first to last note
$beg
\startGroup
$notes
\stopGroup
#})
%---------------------------------------------------%
% music function definitions
%---------------------------------------------------%
#(define (buildFlourishFunc flourish)
(define-music-function (parser location note) (ly:music? )
#{
<>-$flourish $note
#}
)
)
cart = #(buildFlourishFunc cartWheel)
stf = #(buildFlourishFunc splitTheFeather)

113
lib/layout_tweaks.ily Normal file
View file

@ -0,0 +1,113 @@
% =================================================== %
% Layout tweaks for good defaults %
% =================================================== %
#(newline)
#(display "Layout tweaks loaded")
% Note name defs :
% "d" for the right hand ("droite") and
% "g" for the left hand ("gauche")
drumPitchNames =
#(append '(
(d . right-hand)
(g . left-hand)
(right . right-hand)
(left . left-hand)
)
drumPitchNames
)
% Position according to the line : right hand above and left hand below
#(define pipeband-style '(
(right-hand () #f 1)
(left-hand () #f -1)
)
)
\layout {
\context {
\DrumStaff
\name PipeBandDrumStaff
\alias DrumStaff
drumStyleTable = #(alist->hash-table pipeband-style)
% one line per staff
\override StaffSymbol.line-positions = #'(0)
% bar line height
\override BarLine.bar-extent = #'(-2 . 2)
% stems
\override Stem.direction = #DOWN % stems down
\override Stem.length = #8.5 % unbeamed stems length
\override Stem.stemlet-length = #1 % short stem length
% beams
\override Beam.beam-thickness = #0.4 % beam-thickness
\override Beam.positions = #'(-3.8 . -3.8) % fix beams on one height
% slurs and ties
\override Slur.direction = #UP % Slurs on top
\override Tie.direction = #UP % Ties on top
% dynamics up
\dynamicUp
% This does not work nicely together with marking up flourishes
% slurs below rolls number
%\override TextScript.outside-staff-priority = ##f
%\override TextScript.side-axis = #0
%\override TextScript.staff-padding = #3
%\override TextScript.X-offset = #1 % padding to stems
%\override TextScript.extra-offset = #'(-0.3 . 0)
% tremolos (rolls)
\override StemTremolo.slope = #0.5 % slope
\override StemTremolo.beam-width = #1.5 % beam-width
\override StemTremolo.beam-thickness = #0.3 % beam-thickness
\override StemTremolo.extra-offset = #'(0 . 0.3) % vertical pos. position
\override TupletBracket.bracket-visibility = #'if-no-beams
% unison brackets
\consists "Horizontal_bracket_engraver"
\override HorizontalBracket.staff-padding = #3.5 % staff-padding
\override HorizontalBracket.direction = #UP % brackets above the staff
\override HorizontalBracket.bracket-flare = #'(0 . 0) % vertical brackets
subdivideBeams = ##t
strictBeatBeaming = ##t
\numericTimeSignature
%Because it's funny
\override Clef.stencil = #
(lambda (grob)(grob-interpret-markup grob
#{ \markup\combine
\musicglyph #"clefs.percussion"
\translate #'(2 . 0)
\override #'(baseline-skip . 1)
\column {
"R"
"L"
}
#}
))
}
\context {
\Score
\accepts "PipeBandDrumStaff"
\override RehearsalMark.break-align-symbols = #'(clef)
\override RehearsalMark.padding = #3
\override VoltaBracket.edge-height = #'(1.5 . 1.5)
}
\context {
\StaffGroup
\accepts "PipeBandDrumStaff"
}
}
% Explicit bar lines (End + Repeat)
#(define-bar-line ".|:-|." "|." ".|:" "|.")

72
lib/midi.ily Normal file
View file

@ -0,0 +1,72 @@
% Add standard midi support, preferably able to
% switch instruments for different staves
#(newline)
#(display "Midi Support loaded")
bassPitchOne = #(ly:make-pitch -2 0 NATURAL)
bassPitchTwo = #(ly:make-pitch -3 6 NATURAL)
sidePitchOne = #(ly:make-pitch -2 2 DOUBLE-FLAT)
sidePitchTwo = #(ly:make-pitch -2 1 NATURAL)
tenorPitchOne = #(ly:make-pitch -2 3 NATURAL)
tenorPitchTwo = #(ly:make-pitch -2 4 NATURAL)
tenorPitchThree = #(ly:make-pitch -2 5 NATURAL)%
tenorPitchFour = #(ly:make-pitch -2 6 NATURAL)%
tenorPitchFive = #(ly:make-pitch -1 0 NATURAL)%Seems the nicest
tenorPitchSix = #(ly:make-pitch -1 1 NATURAL)%
tenorPitchSeven = #(ly:make-pitch -2 3 NATURAL)
tenorPitchEight = #(ly:make-pitch -2 3 NATURAL)
tenorPitchNine = #(ly:make-pitch -2 3 NATURAL)
tenorPitchTen = #(ly:make-pitch -2 3 NATURAL)
tenorPitchEleven = #(ly:make-pitch -2 3 NATURAL)
% Default Pitches
sideDefault = \sidePitchTwo
bassDefault = \bassPitchTwo
tenorDefault = \tenorPitchFive
midiDrumPitches.right-hand = \sideDefault
midiDrumPitches.left-hand = \sideDefault
midiTenor = {
\set midiDrumPitches.right-hand = \tenorDefault
\set midiDrumPitches.left-hand = \tenorDefault
}
\midi {
\context {
\DrumStaff
\name PipeBandDrumStaff
\alias DrumStaff
% trying midi are you?
midiInstrument = #"drums"
drumPitchTable = #(alist->hash-table midiDrumPitches)
}
\context {
\Score
\accepts "PipeBandDrumStaff"
}
\context {
\StaffGroup
\accepts "PipeBandDrumStaff"
}
}
%setMidiHands =
%#(define-music-function
% (parser location pitch)
% (ly:pitch?)
% (
% (display "Set Hands to pitch")
% #{
% midiDrumPitches.right-hand = #pitch
% midiDrumPitches.left-hand = #pitch
%
% drumPitchTable = #(alist->hash-table midiDrumPitches)
% #}
% )
%)

73
lib/musical_functions.ily Normal file
View file

@ -0,0 +1,73 @@
% ================================================= %
% Musical Functions %
% ================================================= %
% Part of lilydrum
eighthBeaming = {
\set baseMoment = #(ly:make-moment 1/8)
\set beatStructure = #'( 2 2 2 2)
}
eighthReelBeaming = {
\set baseMoment = #(ly:make-moment 1/8)
\set beatStructure = #'( 4 4 4 4)
}
eighthCompoundBeaming = {
\set baseMoment = #(ly:make-moment 1/8)
\set beatStructure = #'( 3 3 3 3)
}
sixteenthBeaming = {
\set baseMoment = #(ly:make-moment 1/16)
\set beatStructure = #'( 4 4 4 4)
}
sixteenthReelBeaming = {
\set baseMoment = #(ly:make-moment 1/16)
\set beatStructure = #'( 8 8 8 8)
}
sixteenthCompoundBeaming = {
\set baseMoment = #(ly:make-moment 1/16)
\set beatStructure = #'( 6 6 6 6)
}
% triplet
triplet = #(define-music-function (parser location notes) (ly:music?) #{ \tuplet 3/2 { $notes } #})
% dynamics
v = #(define-event-function (parser location) () #{ \upbow #})
% dynamics with extended lines
dynLine = #(define-music-function
(parser location text)
(markup?)
#{
\once \override TextSpanner.style = #'line
\once \override TextSpanner.bound-details.left.text = \markup {
\combine
\draw-line #'(0 . -1)
\draw-line #'(1 . 0)
\dynamic #text
}
\once \override TextSpanner.bound-details.right.text = \markup { \draw-line #'(0 . -1) }
#})
% unison brackets
% TODO: a little 'u'
% TODO: open ended brackets(\odr,\ofr)
dr = #(define-event-function (parser location) () #{ \startGroup #})
fr = #(define-event-function (parser location) () #{ \stopGroup #})
odr = #(define-event-function (parser location) () #{ \startGroup #})
ofr = #(define-event-function (parser location) () #{ \stopGroup #})
tutti = #(define-music-function (mus) (ly:music?)
; By Jan-Peter Voigt, Tue, 2 May 2017 11:10:46 +0200
(let* ((elms (ly:music-property mus 'elements))
; first and last music-element ...
(frst (first elms)) ; TODO test for list? and ly:music?
(lst (last elms)) ; TODO test for list? and ly:music?
(fartic (ly:music-property frst 'articulations '())) ; look
for eventchords ...
(lartic (ly:music-property lst 'articulations '()))
)
(ly:music-set-property! frst 'articulations `(,@fartic ,(make-music 'NoteGroupingEvent 'span-direction -1)))
(ly:music-set-property! lst 'articulations `(,@lartic ,(make-music 'NoteGroupingEvent 'span-direction 1)))
#{
#mus
#}))

32
lib/rehearsal_marks.ily Normal file
View file

@ -0,0 +1,32 @@
% ================================================= %
% Rehearsal Marks %
% ================================================= %
#(newline)
#(display "Midi Support loaded")
% From Svenax's bagpipemusic
markText = #(define-music-function (parser location text) (string?) #{
\once \override Score.RehearsalMark #'self-alignment-X = #LEFT
\mark \markup $text
#})
markTextEol = #(define-music-function (parser location text) (string?) #{
\once \override Score.RehearsalMark #'break-visibility = #end-of-line-visible
\once \override Score.RehearsalMark #'self-alignment-X = #RIGHT
\mark \markup $text
#})
markTextEolDown = #(define-music-function (parser location text) (string?) #{
\once \override Score.RehearsalMark #'break-visibility = #end-of-line-visible
\once \override Score.RehearsalMark #'self-alignment-X = #RIGHT
\once \override Score.RehearsalMark #'direction = #DOWN
\mark \markup $text
#})
altBracket = #(define-music-function (parser location tag) (string?) #{
\set Score.repeatCommands = #(list (list 'volta (markup #:text tag)))
#}
)
% Short al fine's and stuff
dacapoalfine = {\markTextEol "D.C. al fine" }

34
lib/special_sticking.ily Normal file
View file

@ -0,0 +1,34 @@
% ================================================= %
% Side Sticking (modifies note, or adds mark) %
% ================================================= %
% Part of lilydrum
backstick = #(define-music-function (parser location notes) (ly:music?)
#{
\temporary \override Staff.NoteHead.style = #'triangle
\temporary \override Staff.NoteHead.font-size = #1.2
$notes
\revert Staff.NoteHead.font-size
\revert Staff.NoteHead.style
#})
crossstick = #(define-music-function (parser location notes) (ly:music?)
#{
\temporary \override Staff.NoteHead.style = #'xcircle
\temporary \override Staff.NoteHead.font-size = #1.2
$notes
\revert Staff.NoteHead.font-size
\revert Staff.NoteHead.style
#})
rimshot = #(define-music-function (parser location notes) (ly:music?)
#{
\temporary \override Staff.NoteHead.font-size = #1.2
%\temporary \override Staff.NoteHead.stencil = #ly:text-interface::print
%\temporary \override Staff.NoteHead.text = \markup {
% \combine
% \halign #-0.7 \draw-circle #0.85 #0.2 ##f
% \musicglyph #"noteheads.normal"
%}
$notes
%\revert Staff.NoteHead.stencil
%\revert Staff.NoteHead.text
\revert Staff.NoteHead.font-size
#})