pc:scale-from-chord   scheme


Defined in:  https://github.com/digego/extempore/tree/v0.8.9/libs/core/pc_ivl.xtm

Implementation

;; attempts to return a reasonable scale based on the chord and root provided
(define pc:scale-from-chord
   (lambda (root chord)
      (let ((res (cl:find-if (lambda (v)
                                (equal? (car v) chord))
                             (map (lambda (scale)
                                     (cons (cl:intersection chord scale) scale))
                                  (map (lambda (type)
                                          (pc:scale root type))
                                       '(ionian aeolian mixolydian lydian phrygian locrian
                                                dorian lydian-mixolydian wholetone chromatic))))))
         (if (pair? res)
             (cdr res)
             chord))))


Back to Index