X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=ly%2Fmusic-functions-init.ly;h=3f9ad80c5ddbf04a20c2f879ff9e5da8ae0e452d;hb=6624794da3756c49a3f912a26026e308cfc9804d;hp=8360dcbe84b7f7e6e938ff99dc7f1f4b874cb657;hpb=5225c5f57f7120683be517c7eea8e391c976004a;p=lilypond.git diff --git a/ly/music-functions-init.ly b/ly/music-functions-init.ly index 8360dcbe84..3f9ad80c5d 100644 --- a/ly/music-functions-init.ly +++ b/ly/music-functions-init.ly @@ -144,7 +144,7 @@ breathe = 'elements (list (make-music 'BreathingEvent)))) bendAfter = -#(define-music-function (parser location delta) (integer?) +#(define-music-function (parser location delta) (real?) (make-music 'BendAfterEvent 'delta-step delta)) @@ -298,7 +298,15 @@ killCues = (if (string? (ly:music-property mus 'quoted-music-name)) (ly:music-property mus 'element) mus)) music)) - + +label = +#(define-music-function (parser location label) (symbol?) + (_i "Place a bookmarking label, either at top-level or inside music.") + (make-music 'EventChord + 'page-marker #t + 'page-label label + 'elements (list (make-music 'LabelEvent + 'page-label label)))) makeClusters = #(define-music-function @@ -468,7 +476,16 @@ parenthesize = #(define-music-function (parser loc arg) (ly:music?) (_i "Tag @var{arg} to be parenthesized.") - (set! (ly:music-property arg 'parenthesize) #t) + (if (memq 'event-chord (ly:music-property arg 'types)) + ; arg is an EventChord -> set the parenthesize property on all child notes and rests + (map + (lambda (ev) + (if (or (memq 'note-event (ly:music-property ev 'types)) + (memq 'rest-event (ly:music-property ev 'types))) + (set! (ly:music-property ev 'parenthesize) #t))) + (ly:music-property arg 'elements)) + ; No chord, simply set property for this expression: + (set! (ly:music-property arg 'parenthesize) #t)) arg) %% for lambda*