;
;
;; PLAYK
;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Wrapper around Play, to make it quicker to play drum sounds
; Defaults: dur = 1/16 , midi CH = 9
;
; Args:
; --------
; 1st: [OPTIONAL:offset default = 0]
; 2nd: pitch
; 3rd: velocity/ vol
;
; Example:
; --------
; (let ((beat (*metro* 'get-beat)))
; (playk k1 90)
; )
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;
(impc:aot:do-or-emit
(define-macro (playk . args)
(if (length-equal? args 2)
; no offset
`(play-midi-note (*metro* beat)
*mididevice*
(helper:midi-val (eval ,(car args)))
(helper:midi-val (eval ,(cadr args)))
(*metro* 'dur 1/16) ;; dur 1/8
8) ;; midi always 8 == 9 in LIVE
; 3 args, = it's an offset
`(play-midi-note (*metro* (+ beat ,(car args)))
*mididevice*
(helper:midi-val (eval ,(cadr args)))
(helper:midi-val (eval ,(car (cddr args))))
(*metro* 'dur 1/16)
8)))
)