;; 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))))