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: Paul Morris
Subject: Re: Function to add a drone staff?
Date: Tue, 14 Apr 2015 10:51:49 -0700 (MST)

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?

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



--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/Function-to-add-a-drone-staff-tp174261p174517.html
Sent from the User mailing list archive at Nabble.com.



reply via email to

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