playkr   macro


Defined in:  https://github.com/lambdamusic/extempore-extensions/blob/main/init/init_play.xtm

Implementation

;
;
; PLAYKR
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Legacy implentation of simple drum progressions. 
;; Dependency: 'kit' function
;
;
; Example
; (let ((beat (*metro* 'get-beat)))
;    (playkr k1 6 1/2 60))
;
; TODO 
; - Allow passing MIDI ch (now relies on `kit` hence default is ch-9 )
; - Provide more options and integrate with playk
; - BUG: if vol is not passed, fails with spacing < 1/2
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define-macro (playkr pitch hits spacing . vol)
  `(let loop ((i 0))
      (play (* i ,spacing) 9 ,pitch ,@vol 1/16)
      (if (< i (- ,hits 1)) (loop (+ i 1)))))


Back to Index

Similar Entries