- (let* ((vs1 (car (voice-states now-state)))
- (vs2 (cdr (voice-states now-state)))
- (notes1 (note-events vs1))
- (durs1 (sort (map (lambda (x) (ly:event-property x 'duration))
- notes1)
- ly:duration<?))
- (pitches1 (sort (map (lambda (x) (ly:event-property x 'pitch))
- notes1)
- ly:pitch<?))
- (notes2 (note-events vs2))
- (durs2 (sort (map (lambda (x) (ly:event-property x 'duration))
- notes2)
- ly:duration<?))
- (pitches2 (sort (map (lambda (x) (ly:event-property x 'pitch))
- notes2)
- ly:pitch<?)))
- (cond ((> (length notes1) 1) (put 'apart))
- ((> (length notes2) 1) (put 'apart))
- ((= 1 (+ (length notes2) (length notes1))) (put 'apart))
- ((and (= (length durs1) 1)
- (= (length durs2) 1)
- (not (equal? (car durs1) (car durs2))))
- (put 'apart))
- (else
- (if (and (= (length pitches1) (length pitches2)))
- (if (and (pair? pitches1)
- (pair? pitches2)
- (or
- (< chord-threshold (ly:pitch-steps
- (ly:pitch-diff (car pitches1)
- (car pitches2))))
-
- ;; voice crossings:
- (> 0 (ly:pitch-steps (ly:pitch-diff (car pitches1)
- (car pitches2))))
- ))
- (put 'apart)
- ;; copy previous split state from spanner state
- (begin
- (if (previous-voice-state vs1)
- (copy-state-from voice-state-vec1
- (previous-voice-state vs1)))
- (if (previous-voice-state vs2)
- (copy-state-from voice-state-vec2
- (previous-voice-state vs2)))
- (if (and (null? (span-state vs1)) (null? (span-state vs2)))
- (put 'chords)))))))))
+ (let* ((vs1 (car (voice-states now-state)))
+ (vs2 (cdr (voice-states now-state)))
+ (notes1 (note-events vs1))
+ (durs1 (sort (map (lambda (x) (ly:event-property x 'duration))
+ notes1)
+ ly:duration<?))
+ (pitches1 (sort (map (lambda (x) (ly:event-property x 'pitch))
+ notes1)
+ ly:pitch<?))
+ (notes2 (note-events vs2))
+ (durs2 (sort (map (lambda (x) (ly:event-property x 'duration))
+ notes2)
+ ly:duration<?))
+ (pitches2 (sort (map (lambda (x) (ly:event-property x 'pitch))
+ notes2)
+ ly:pitch<?)))
+ (cond ((> (length notes1) 1) (put 'apart))
+ ((> (length notes2) 1) (put 'apart))
+ ((= 1 (+ (length notes2) (length notes1))) (put 'apart))
+ ((and (= (length durs1) 1)
+ (= (length durs2) 1)
+ (not (equal? (car durs1) (car durs2))))
+ (put 'apart))
+ (else
+ (if (and (= (length pitches1) (length pitches2)))
+ (if (and (pair? pitches1)
+ (pair? pitches2)
+ (or
+ (< chord-threshold (ly:pitch-steps
+ (ly:pitch-diff (car pitches1)
+ (car pitches2))))
+
+ ;; voice crossings:
+ (> 0 (ly:pitch-steps (ly:pitch-diff (car pitches1)
+ (car pitches2))))
+ ))
+ (put 'apart)
+ ;; copy previous split state from spanner state
+ (begin
+ (if (previous-voice-state vs1)
+ (copy-state-from voice-state-vec1
+ (previous-voice-state vs1)))
+ (if (previous-voice-state vs2)
+ (copy-state-from voice-state-vec2
+ (previous-voice-state vs2)))
+ (if (and (null? (span-state vs1)) (null? (span-state vs2)))
+ (put 'chords)))))))))