diff --git a/lilydrum.ly b/lilydrum.ly index a08ddbe..4012e6f 100644 --- a/lilydrum.ly +++ b/lilydrum.ly @@ -6,7 +6,7 @@ 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 "[pathtothisfile]" e.g. "~/lilydrum.ly" @@ -26,8 +26,6 @@ #(ly:set-option 'relative-includes #t) -\include "lilydrum/internal_functions.ily" - \include "lilydrum/layout_tweaks.ily" \include "lilydrum/musical_functions.ily" \include "lilydrum/embellishments.ily" diff --git a/lilydrum/flourishing.ily b/lilydrum/flourishing.ily index 424984d..64ec6ce 100644 --- a/lilydrum/flourishing.ily +++ b/lilydrum/flourishing.ily @@ -335,13 +335,26 @@ flourish = #(define-music-function (parser location notes) (ly:music?) #}) % See issue #4 (https://github.com/kastdeur/lilydrum/issues/4) -scoop = #(define-music-function (music) (ly:music?) - #{ - <>^"scoop"\startGroup - #(_allbutlastnote music) - <>\stopGroup - #(_lastnote music) - #}) +scoop = #(define-music-function (music) (ly:music?) + (define (grace-music-filter event) + (let ((eventname (ly:music-property event 'name))) + (not (eq? eventname 'GraceMusic)))) + (let* + ( + (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 %---------------------------------------------------% diff --git a/lilydrum/internal_functions.ily b/lilydrum/internal_functions.ily deleted file mode 100644 index e885610..0000000 --- a/lilydrum/internal_functions.ily +++ /dev/null @@ -1,27 +0,0 @@ -% ================================================= % -% Internal Functions % -% as used by other files in this library % -% ================================================= % -% Part of lilydrum - -#(define ( _get-first-note mus) - "Get the first note-event in @var{music}" - (let ((note (car (extract-typed-music mus 'note-event)))) - note - ) -) - -#(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))) - ) -) - diff --git a/lilydrum/musical_functions.ily b/lilydrum/musical_functions.ily index 787eedb..572e81d 100644 --- a/lilydrum/musical_functions.ily +++ b/lilydrum/musical_functions.ily @@ -103,8 +103,8 @@ tutti = ) (if (> (length es) 1) #{% multiple notes - \once \override HorizontalBracket.connect-to-neighbor = #'(#t #t) - <>\dr + <> + \dr #myMusic \fr #}