;; find the pc that is closest to given pitch
;; useful for finding next step for pitch given a chord
(define pc:closest-pc
(lambda (pitch pc)
(cdar (cl:sort (map (lambda (class) (cons (pc:distance pitch class) class)) pc)
(lambda (a b) (< (car a) (car b)))))))