- (omit-root (and (pair? rest) (car rest)))
- (pitches (map (lambda (x) (ly:music-property x 'pitch))
- (filter
- (lambda (y) (memq 'note-event
- (ly:music-property y 'types)))
- elts)))
- (sorted (sort pitches ly:pitch<?))
- (root (car sorted))
-
- ;; ugh?
- ;;(diff (ly:pitch-diff root (ly:make-pitch -1 0 0)))
- ;; FIXME. This results in #<Pitch c> ...,
- ;; but that is what we need because default octave for
- ;; \chords has changed to c' too?
- (diff (ly:pitch-diff root (ly:make-pitch 0 0 0)))
- (normalized (map (lambda (x) (ly:pitch-diff x diff)) sorted))
- (texts (map (lambda (x) (ly:music-property x 'text))
- (filter
- (lambda (y) (memq 'text-script-event
- (ly:music-property y 'types)))
- elts)))
-
- (text (if (null? texts) #f (if omit-root (car texts) texts))))
+ (omit-root (and (pair? rest) (car rest)))
+ (pitches (map (lambda (x) (ly:music-property x 'pitch))
+ (filter
+ (lambda (y) (memq 'note-event
+ (ly:music-property y 'types)))
+ elts)))
+ (sorted (sort pitches ly:pitch<?))
+ (root (car sorted))
+
+ ;; ugh?
+ ;;(diff (ly:pitch-diff root (ly:make-pitch -1 0 0)))
+ ;; FIXME. This results in #<Pitch c> ...,
+ ;; but that is what we need because default octave for
+ ;; \chords has changed to c' too?
+ (diff (ly:pitch-diff root (ly:make-pitch 0 0 0)))
+ (normalized (map (lambda (x) (ly:pitch-diff x diff)) sorted))
+ (texts (map (lambda (x) (ly:music-property x 'text))
+ (filter
+ (lambda (y) (memq 'text-script-event
+ (ly:music-property y 'types)))
+ elts)))
+
+ (text (if (null? texts) #f (if omit-root (car texts) texts))))