lilypond-user
[Top][All Lists]
Advanced

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

Re: scheme engraver and multiple voices


From: David Nalesnik
Subject: Re: scheme engraver and multiple voices
Date: Fri, 4 Jan 2013 12:28:08 -0600

Hi Jan-Peter,

On Fri, Jan 4, 2013 at 8:37 AM, Jan-Peter Voigt <address@hidden> wrote:
Hi David,

yes, stop-translation-timestep is called and so is process-music, but if I want to change properties, like in an override, it has to happen in start-translation-timestep, or am I missing something?


I did get results with the following code, which applies an override within process-music, but the override takes effect in the next timestep.  Furthermore, since the context numbered 2 doesn't exist yet at #<Mom 1/4> in the first measure, no change happens at #<Mom 1/2>...

Sorry I can't help more.

-David

\version "2.16.0"

#(define (ly:moment=? a b)
 (and (not (ly:moment<? a b))
      (not (ly:moment<? b a))))

\layout {
  \context {
  \Voice
  \consists #(let ((ccid 1))
    (lambda (context)
      (let ((id ccid))
        (set! ccid (+ 1 ccid))
        `((process-music .
            ,(lambda (trans)
              (let ((pos (ly:context-property context 'measurePosition)))
                (if (and (ly:moment=? pos (ly:make-moment 1 4))
                         (= id 2))
                    (ly:context-pushpop-property context 'NoteHead 'color red)
                    (ly:context-pushpop-property context 'NoteHead 'color)))))))))
  }
}

\score {
  \relative c'' {
    c d << { e f e f e f } \\ { c d c d c d } >>
  }
}

reply via email to

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