;; returns the pitch in plst that is closest to the pc set
;; if multiple pitches in plst are the closest return the first
(define pc:find-closest
(lambda (plst pc)
(cdar (cl:sort (map (lambda (p)
(cons (pc:distance p pc) p))
plst)
(lambda (a b) (if (< (car a) (car b)) #t #f))))))