;; returns a scale type based on a given root
(define pc:scale
(lambda (root type)
(if (string? type) (set! type (string->symbol type)))
(if (assoc type *pc:scales*)
(let loop ((l (cdr (assoc type *pc:scales*)))
(current (modulo root 12))
(newlst '()))
(if (null? l)
(reverse (cons current newlst))
(loop (cdr l) (modulo (+ current (car l)) 12) (cons current newlst))))
(begin (log-info "Scale type not found." *pc:scales*) #f))))