Thanks for the confirmation that it is "difficult". I won't give up just yet 
but have a lot to learn before taking the next step.


  _____  

From: David Nalesnik [mailto:david.nales...@gmail.com] 
Sent: Thursday, November 27, 2014 8:40 PM
To: Peter Gentry
Cc: lilypond-user
Subject: Re: Chapter 3 of "LilyPond Extending" document


Hi Peter, 

On Thu, Nov 27, 2014 at 11:35 AM, Peter Gentry <peter.gen...@sunscales.co.uk> 
wrote:



You are spot on David. I spend a lot of time transposing music for a small band 
of amateur wind players.  I use the said snippet as
an include file "enharmonic.ly" to tidy up the accidentals. My issue is that 
the tidy up takes no account of the current key
signature and so sometimes you are left with a Gb say when there is F# in the 
key signature. I am trying to get at the list of
sharps and flats from the keysignature interface use to force the Gb to F# (and 
adjust any other unpleasant accidentals).
 
I can see that there is such data lurking about but so far I haven't been able 
to extract it.  This has lead me into a crash course
of C++ and Scheme which at 73 is proving interesting but time consuming - (I 
was brought up on Basic and Fortran)


The trouble here is that details about the key signature are stored as context 
properties which, as far as I know, are not directly
accessible from within a music function.

You could search the music expression for context modifications.  Don't think 
it will be pretty. 

A simpler solution would be to add an argument which specifies the key you want 
to "naturalize" against.  This could be annoying if
you have multiple key signatures in the course of the piece--you'd need to call 
\naturalizeMusic each time.

Hope this is somewhat helpful,
David


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

Reply via email to