Removable tutti's can be pulled off using the tag in the \dr and \fr variables
This commit is contained in:
Eric Teunis de Boone 2018-02-27 23:33:31 +01:00
parent 44c4d3ae99
commit ee97c53178
1 changed files with 13 additions and 20 deletions

View File

@ -37,8 +37,8 @@ v = #(define-event-function (parser location) () #{ \upbow #})
#(define (text-spanner-start-stop mus) #(define (text-spanner-start-stop mus)
(let ((elts (ly:music-property mus 'elements))) (let ((elts (ly:music-property mus 'elements)))
(make-music 'SequentialMusic 'elements (make-music 'SequentialMusic 'elements
(append (append
(list (make-music 'TextSpanEvent 'span-direction -1)) (list (make-music 'TextSpanEvent 'span-direction -1))
(reverse (cdr (reverse elts))) (reverse (cdr (reverse elts)))
(list (make-music 'TextSpanEvent 'span-direction 1)) (list (make-music 'TextSpanEvent 'span-direction 1))
@ -83,10 +83,10 @@ dynLine = #(define-music-function
%fr = { <>\="unison"\stopTextSpan } %fr = { <>\="unison"\stopTextSpan }
%odr = { \unisonbracket <>\="unison"\startTextSpan } %odr = { \unisonbracket <>\="unison"\startTextSpan }
%ofr = { <>\="unison"\stopTextSpan } %ofr = { <>\="unison"\stopTextSpan }
dr = #(define-event-function (parser location) () #{ \startGroup #}) dr = #(define-event-function (parser location) () #{ -\tag #'tutti \startGroup #})
fr = #(define-event-function (parser location) () #{ \stopGroup #}) fr = #(define-event-function (parser location) () #{ -\tag #'tutti \stopGroup #})
odr = #(define-event-function (parser location) () #{ \startGroup #}) odr = #(define-event-function (parser location) () #{ -\tag #'tutti \startGroup #})
ofr = #(define-event-function (parser location) () #{ \stopGroup #}) ofr = #(define-event-function (parser location) () #{ -\tag #'tutti \stopGroup #})
#(define (allbutlastnote mus) #(define (allbutlastnote mus)
(let ((elts (ly:music-property mus 'elements))) (let ((elts (ly:music-property mus 'elements)))
@ -99,19 +99,12 @@ ofr = #(define-event-function (parser location) () #{ \stopGroup #})
) )
) )
% TODO: check whether on one note % TODO: check whether on one note
tutti = #(define-music-function (music) (ly:music?) tutti = #(define-music-function (music) (ly:music?)
#{ #{
<< \override HorizontalBracket.connect-to-neighbor = #'(#t #t)
\tag #'tutti { <>\dr
\override HorizontalBracket.connect-to-neighbor = #'(#t #t) #(allbutlastnote music)
<>\dr <>\fr
#(skip-of-length (allbutlastnote music)) #(lastnote music)
<>\fr \revert HorizontalBracket.connect-to-neighbor
#(skip-of-length (lastnote music))
\revert HorizontalBracket.connect-to-neighbor
}
{
$music
}
>>
#}) #})