;; generate a meldoy from a list of intervals
(define ivl:melody-by-ivl
(lambda (starting-pitch ivls . args)
(if (null? ivls)
(reverse (car args))
(if (null? args)
(ivl:melody-by-ivl starting-pitch ivls (cons starting-pitch args))
(ivl:melody-by-ivl (+ starting-pitch (car ivls)) (cdr ivls)
(cons (+ starting-pitch (car ivls)) (car args)))))))