Cheers,
-Paul
%%%%%%%%%
dronify =
#(define-music-function (parser location drone-pitch melody)
(ly:pitch? ly:music?)
(let ((art '())
(prev-note-or-rest #{ #}))
(music-map
(lambda (m)
(if (and (music-is-of-type? m 'note-event)
(ly:pitch? (ly:music-property m 'pitch)))
;; ...do note events ever not have a pitch?
;; ...are there any other kinds of events to dronify?
(begin
(ly:music-set-property! m 'pitch drone-pitch)
(if (music-is-of-type? prev-note-or-rest 'note-event)
;; add tie to previous note, don't overwrite
existing
articulations
(begin
(set! art (ly:music-property prev-note-or-rest
'articulations '()))
(ly:music-set-property! prev-note-or-rest
'articulations
(append art (list (make-music 'TieEvent))))))))
(if (or (music-is-of-type? m 'note-event)
(music-is-of-type? m 'rest-event)
(music-is-of-type? m 'multi-measure-rest))
;; ...should there be more types of events here?
(set! prev-note-or-rest m))
m)
melody)))