pc:melody-by-step   scheme


Defined in:  https://github.com/digego/extempore/tree/v0.8.9/libs/core/pc_ivl.xtm

Implementation

;; 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)))))))


Back to Index