[Top][All Lists]

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

Re: Special Accidental Macro needed.

From: Rune Zedeler
Subject: Re: Special Accidental Macro needed.
Date: Wed, 11 Dec 2002 18:29:36 +0100

Matthias Geier wrote:

> When I use ties, the second note of the tie gets the accidental again.

Yikes, this is getting more and more ugly.
Well, This one works better. Now you also don't get new accidentals
after rests - i.e. after cis r cis you would befer get a new sharp sign
- and now you don't.

#(define usep '())
#(define buildp '()) 
#(define seen #f)
#(define ((schoenberg-accidentals clear) music)
  (let* ((es (ly:get-mus-property music 'elements))
         (e (ly:get-mus-property music 'element))
         (p  (ly:get-mus-property music 'pitch))
         (ts  (ly:get-mus-property music 'types)))

    (if (memq 'note-event ts) 
          (set! seen #t)
          (set! buildp (cons p buildp))
          (if (not (member p usep))
              (ly:set-mus-property! music 'force-accidental #t))

    (if (ly:music? e)
         music 'element
         ((schoenberg-accidentals clear) e)))

    (if (pair? es)
         music 'elements
         (map (schoenberg-accidentals (memq 'sequential-music ts)) es)))

    (if (and clear seen) (begin (set! seen #f) (set! usep buildp) (set!
buildp '())))



reply via email to

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