>>>>> "Jay" == Jay Anderson <[EMAIL PROTECTED]> writes:

Jay> A couple of weeks ago I recall reading about someone trying to
Jay> get midi trills working. The key needed to be understood so that
Jay> it could figure out the correct note to trill to. I can't find
Jay> the thread to see if it was resolved. Are there some functions
Jay> out there for doing this?

That was me.  I'm still trying to work things out in a general way,
but have a hack that works `well enough' for my current purpose.
Basically, I rely on noting keychange events, and assuming the
starting key is c major.  The current key is in ac:current-key



#(define (ac:up note)
  (let* ((pitch (ly:music-property note 'pitch))
         (notename (ly:pitch-notename pitch))
         (new-notename (if (eq? notename 6) 0 (+ 1 notename)))
         (alterations (ly:music-property ac:current-key 'pitch-alist))
         (new-alteration (cdr (assq new-notename alterations)))
         (new-octave (if (eq? new-notename 0) (+ 1 (ly:pitch-octave pitch))
                      (ly:pitch-octave pitch)))
       )
   (set! (ly:music-property note 'pitch)(ly:make-pitch new-octave new-notename 
new-alteration))))



Jay> In a few functions I've written they either work correctly inside
Jay> a \relative section or correctly outside but not both. Is there a
Jay> standard way to make them work in both? 

Not that I know of.

--
Dr Peter Chubb  http://www.gelato.unsw.edu.au  peterc AT gelato.unsw.edu.au
http://www.ertos.nicta.com.au           ERTOS within National ICT Australia
A university is a non-profit organisation only in the sense that it
spends everything it gets  ... Luca Turin.


_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to