Skip to content
Snippets Groups Projects
Commit 1329d9fd authored by Reinhold Kainhofer's avatar Reinhold Kainhofer
Browse files

addArticulation function to add articulation to multiple notes

parent c8a05a23
No related branches found
No related tags found
No related merge requests found
......@@ -1158,6 +1158,32 @@ filterArticulations = #(define-music-function (parser location music) (ly:music?
%%% Add the same articulation to a longer sequence of notes:
#(define (make-script x)
(make-music 'ArticulationEvent
'articulation-type x))
#(define (add-articulation music art)
(map-some-music
(lambda (m)
(cond ((music-is-of-type? m 'event-chord)
(set! (ly:music-property m 'elements)
(append (ly:music-property m 'elements)
(list (make-script art))))
m)
((music-is-of-type? m 'note-event)
(set! (ly:music-property m 'articulations)
(append (ly:music-property m 'articulations)
(list (make-script art))))
m)
(else #f)))
music))
addArticulation = #(define-music-function (parser location type music)
(string? ly:music? )
(add-articulation music type))
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment