;
;
;; inner function for :arp
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; eg
; (helper:arpeggio (*metro* 'get-beat) 0
; '(c4 f4 g4 c5) 3 90 3) ;; durs/vols do not need to be a list
; (helper:arpeggio (*metro* 'get-beat) 0
; '(c4 f4 g4 c5) '(3) '(90) 3) ;; a list works too
(define helper:arpeggio
(lambda (beat offset notes durations volumes ch)
(let* ((durs (cl:expand-list2 durations (len notes)))
(vols (cl:expand-list2 volumes (len notes)))
(total_dur (sum_list durs))
(wait (car durs)))
(when #f (println notes durs))
(play (eval offset) ch (eval (car notes)) (car vols) total_dur )
(if (not (null? (cdr notes)))
(callback (*metro* (+ beat (* 1/2 wait)))
'helper:arpeggio (+ beat wait) offset
(rest notes) (rest durs) (rest vols) ch)))))