I've improved my patch. This line gives correct MIDI key signatures for all plausibly authentic scenarios:
(apply + (map (lambda (p) (round (* (cdr p) 2))) pitch-list)) ) It would give the wrong result for a key signature with double sharps or flats in 19 note equal temperament. Graham _______________________________________________ lilypond-devel mailing list lilypond-devel@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-devel