:midicc   macro


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

Implementation

;
;; :MIDICC
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; midi control change shortcut
;; Uses default *mididevice* symbol 
;; Values are set in real-time using now() // [not beat]
;;
;; Args:
; --------
; - control change 
; - value
; - ch midi [optional - default is *mcc-default-channel*]
;
;; Example:
; --------
; (:midicc 49 127) 
; 
;
;; TIP: In order to set up mappings in Live:
 ; 1 - turn on midi learn in Live, select a control 
 ; 2 - send :mcc signal to store mapping
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(impc:aot:do-or-emit
    (define-macro (:midicc . args)
                (if (length-equal? args 2) 
                    ; arg1:cc arg2:value / channel default=0  ==> good for Ableton LIVE
                    `(send-midi-cc (now) ;;(*metro* beat) 
                        *mididevice*
                        (real->integer ,(car args))    ;; control change
                        (real->integer ,(cadr args))   ;; value
                        *mcc-default-channel* ;; channel
                        )
                    ; arg1:cc arg2:value arg3:channel number 0-based
                    `(send-midi-cc (now) ;;(*metro* beat)  
                        *mididevice*
                        (real->integer ,(car args))            ;; control change
                        (real->integer ,(cadr args))           ;; value
                        (real->integer ,(caddr args))     ;; channel 
                        )))
    )


Back to Index