homo-play-midi-note   scheme


Defined in:  https://github.com/digego/extempore/tree/v0.8.9/libs/external/portmidi.xtm

Implementation

;; homophonic playnote
(impc:aot:do-or-emit
 (define homo-play-midi-note
   (let ((notes (make-vector 127 0)))
     (lambda (time device pitch velocity duration channel)
       (if (> time (vector-ref notes pitch))
           (let ((dur (- duration (* 2 *au:block-size*))))
             (vector-set! notes pitch (+ time dur))
             (callback time 'pm_send device *midi-note-on* channel pitch velocity)
             (callback (+ time duration) 'pm_send device *midi-note-off* channel pitch velocity)))))))


Back to Index

Similar Entries