;;; -*- syntax: Lisp; font-size: 20; theme: "Emacs"; -*- ;; ==================================================== ;; ==================== LINUX SIDE ==================== ;; ==================================================== ;; 1. open the MIDI input port for your keyboard (port ;; numbers are zero-based and reflect the order of ;; devices listed in your Audio>Midi In> menu) (mp:open :in 1) ;; 2. open OSC port with, say, input=7779 and output ;; 7770 on your networked mac machine. When you open a ;; remote host you use a string "host:port". Im using ;; 128.174.102.101 for a machine in my lab, you need to ;; change that number to the ip number of your mac...) (osc:open 7779 "128.174.102.101:7770") ;; 2. define a MIDI IN receiver that routes Ons/Offs ;; to your mac via OSC: (define (midi-to-osc args) (cond ((= (first args) mm:on) ;; send path chan key vel (osc:message "/midi/on" (second args) (third args) (fourth args))) ((= (first args) mm:off) ;; send path chan key vel (osc:message "/midi/off" (second args) (third args) (fourth args)) ))) ;; set MIDI receive hook (mp:receive midi-to-osc) ;; when you are done to clear hook and stop do: ;; (mp:receive) ;; (osc:close) ;; ==================================================== ;; ==================== MAC SIDE ==================== ;; ==================================================== ;; 1. open MIDI output port (mp:open :out 1) ;; 2. open OSC port with input= 7770. (We wont use the ;; output connection) (osc:open 7770 7779) ;; set an OSC receiver to send MIDI (define (osc-to-midi args) (cond ((equal? (first args) "/midi/on") (mp:on 0 :key (third args) :vel (fourth args) :chan (second args))) ((equal? (first args) "/midi/off") (mp:off 0 :key (third args) :chan (second args)) ))) (osc:receive osc-to-midi) ;; when you are done to clear hook and stop do: ;; (mp:receive) ;; (osc:receive) ;; (osc:close)