lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Function to add a drone staff?


From: Gilles
Subject: Re: Function to add a drone staff?
Date: Tue, 14 Apr 2015 20:00:08 +0200
User-agent: Scarlet Webmail

Hello.

On Tue, 14 Apr 2015 10:51:49 -0700 (MST), Paul Morris wrote:
Gilles Sadowski wrote
It works almost fine: no more stops between bars.

However I sometimes stumbled upon another problem: "dronified" full
measure
rests ("R") generate a bar check warning. It seems wrong because when
I
changed "R" into "r" (and touched nothing else), the warning
disappeared
(but so did the printed rests, of course).

I couldn't yet define a small example as the error comes and goes as I
add
bars to the score! :-{

Hi Gilles, That's strange... I added support for "R" (multi-measure-rest) to the latest version of the dronify code (below). Maybe this will prevents
those warnings?

Yes; that version fixes it!

Thanks a lot,
Gilles


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)))





reply via email to

[Prev in Thread] Current Thread [Next in Thread]