Geometric Series

;;;a simple rhythm generator based on geometric series, execute it using 'Grace';;

(define (ritm-2 grad int)
  (append (list 0) (segs 2 int 2 grad)))
;;s e g s;;

;;first load the instrument 'fullmix' from the snd library;;
(load "fullmix.scm")

;;give the pathname for a soundfile, you want to use;;
;;and run;;
(with-sound (:channels 2)
  (do ((grad 4.0 (- grad .5));;the fourth argument of segs is time-varying;;
       (int 1)
       (k 0 (+ k int))
       (end 60));;the amount of bangs;;
    ((= k end))
    (let* ((lis (ritm-2 (modulo grad 4) int))
           (norma (/ k end))
           (loop for m in lis
                 do
                 (fullmix :in-file "~/tabla-1.aif" :beg (+ m k)))))))

a  s a m p l e  t o  l i s t e n  



;;midi version;;
(do ((grad 4.0 (- grad .5))
     (int 1)
     (k 0 (+ k int))
     (end 60))
  ((= k end))
  (let* ((lis (ritm-2 (modulo grad 4) int))
         (norma (/ k end)))
    (loop for m in lis
          do
          (send "mp:midi" :time (+ m k) :key 65 :dur (* m 1.2)))))


Creative Commons License
geometric-series2rhythm by Aykut Caglayan is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.

Comments

Popular Posts