;; genereate a melody from a list of steps in a (pc) pitch class
(define pc:melody-by-step
(lambda (starting-pitch steps pc . args)
(if (null? steps)
(reverse (car args))
(if (null? args)
(pc:melody-by-step starting-pitch steps pc (cons starting-pitch args))
(pc:melody-by-step (pc:relative starting-pitch (car steps) pc)
(cdr steps)
pc
(cons (pc:relative starting-pitch (car steps) pc) (car args)))))))