On 02/12/2013 08:41 PM, David Kastrup wrote:
If you want different passages in music behave differently when included in a single \transpose command, that more or less means that they need to use different callbacks at least in some anchoring expressions (like we use a relative-callback for doing \relative on diverse expressions). But how would one deal with quoted music?
By default, you'd use the rule that had been set for the music being quoted, rather than that which has been set in the current staff/voice. You'd probably need to have an override option to choose the opposite (i.e. to use the current staff/voice rules and not those set in the quoted music).
Think of it this way: if I quote a tonal passage in the middle of a part whose own music is chromatic/atonal, I still want that quoted passage to behave tonally (and vice versa).
One implementation strategy might be to _not_ use callbacks for transposing at all, but instead have a callback for cleaning up after transposition. Those callbacks would then be exercised only when scorifying (meaning that they would not bother about correcting accidentals to the printable range when transposing back and forth). Everything before that stage would not be restricted concerning its accidentals (like having 4 sharps on a note).
I certainly think there's some value in having the cleanup done after all transposition has been completed.
In that sense there are at least 2 ways that you can go about things. One is of course just to "normalize" alterations that are greater than some interval (depending on the note -- c, e, f and b need different rules to d, g and a). This would be most appropriate for chromatic music. For tonal music, it might be handy if the cleanup process could anticipate enharmonic equivalences and hence infer transpositions that would clean up the excessive accidentals.
E.g. suppose I have a passage in the key of G flat major (6 sharps), and one part is for clarinet in A. The strict minor-third transposition from a to c' would see this appearing in B-double-flat major. Could a cleanup process reasonably infer "I should implicitly insert a transposition from B-double-flat to A"? Could it do so in the absence of an explicit key signature?
N.B. there does exist music with triple sharps and flats out there ... _______________________________________________ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user