AM Posted January 10 Share Posted January 10 dear all  as so often i try out strange things i switch on midi-entry, read the pitches which i enter from a keyboard. everything clear so far. I am now trying to do this in a 2-second-loop (with sleep-function), so that variable X would always be assigned new values. at the end of the loop sequence, however, X is NIL. only when I evaluate X again are the values assigned. (see video)  (the idea is... to IMPORT live-midi into a "realtime-process")  some ideas?  thanx andré  clip.mov    Quote Link to comment Share on other sites More sharing options...
JulioHerrlein Posted January 10 Share Posted January 10 I don´t know if I got the whole idea but you can send a bunch of midi notes from any DAW to Opusmodus using a virtual midi cable. Record whatever you like onto reaper, logic, ableton live, etc and set a virtual midi output port to Opusmodus. You can send this midi notes at 3x the speed of original tempo if you like. The length information can be obtained only by import midi, however. Best, Julio  It´s a sort of "mechamical solution" but I like it Quote Link to comment Share on other sites More sharing options...
AM Posted January 10 Author Share Posted January 10 thanx! but... it's "only a LISP problem"  with LOOP and SLEEP my code should read X (the midi-values) every 2 seconds - (sleep 2). i don't know why "LISP don't safe" variable X inside the loop when i'm doing "midi-entry".... JulioHerrlein 1 Quote Link to comment Share on other sites More sharing options...
opmo Posted January 11 Share Posted January 11 Nothing to do with MIDI Entry - I wonder if this is possible with in the loop. Quote Link to comment Share on other sites More sharing options...
AM Posted January 11 Author Share Posted January 11 with OSC - (with the external osc-library i've sended you) - it should work similiar? loop-function which PRINT the revcevied osc-values over and over (it works). i would like to do that with MIDI  but i'm not a lisp pro.... (code not by me)   (defparameter *in-port* 9999) (defparameter *in-socket* (make-socket :type :datagram :local-port *in-port* :format :binary)) (setq *osc-receive* (process-run-function "osc-receive-process" #'(lambda () (loop do (print (osc::decode-message (receive-from *in-socket* 2048)) #.*terminal-io*))))) (process-kill *osc-receive*) ;; Prozess wieder anhalten  Quote Link to comment Share on other sites More sharing options...
AM Posted January 12 Author Share Posted January 12 I have now found a SOLUTION that might be also interesting for LIVE CODING:  With the APP OSCulator you can convert midi-input (by an external keyboard) into OSC and then read it in real time (via osc-library + code) in OPMO (see video).  Of course, it could also be done directly from OSC (then via an APP such as TouchOSC from the mobile or tablet). you just have to reread the values (by a loop-function) as you can see in the video; in this way, certain parameters of the LIVE-CODING could be controlled / influenced from the outside.  LINKS:  OSC to LISP: GitHub - zzkt/osc: a common lisp implementation of the Open Sound Control protocol aka OSC GITHUB.COM a common lisp implementation of the Open Sound Control protocol aka OSC - GitHub - zzkt/osc: a common lisp implementation of the Open Sound Control protocol aka OSC  OSCulator: Home | OSCulator OSCULATOR.NET Links your controllers to your favorite music and video software. Works with Nintendo Wiimote, iPhone and more.  TouchOSC: TouchOSC | hexler.net HEXLER.NET   VIDEO:  left-  PROTOKOL to see what's MIDI-in right - midi to osc (OSCulator) bottom - OPMO with midi-data PRINT in the listener  midi via osc to opmo.mov  BASIC CODE:  (defparameter *remote-host* "127.0.0.1") (defparameter *in-port* 1234) (defparameter *in-socket* (make-socket :type :datagram :local-port *in-port* :format :binary)) (setq *osc-receive* (process-run-function "osc-receive-process" #'(lambda () (loop do (print (osc::decode-message (receive-from *in-socket* 2048)) #.*terminal-io*))))) ;; instead of PRINT you could use SETF (process-kill *osc-receive*) ;; STOP "listening process" ;;; CODE by philippe kocher   Quote Link to comment Share on other sites More sharing options...
AM Posted January 12 Author Share Posted January 12 here is a short sketch of how you can integrate a midi keyboard into live coding. evaluate the BASIC SETUP as before but in a LOOP (here 10 times) the LIVE-CODING setup, so a new value X (the PITCH (midi number) from the external keyboard) is always read in (which comes from the keyboard)...   these values can now be used on various parameters. for this sketch only pitch + tempo (see: tempo (list (* x 3))  VIDEO: at the beginnig you see data coming in from midi keyboard  midi keyboard to live-coding.mov   some code/sketch  (defparameter *remote-host* "127.0.0.1") (defparameter *in-port* 1234) (defparameter *in-socket* (make-socket :type :datagram :local-port *in-port* :format :binary)) (setq *osc-receive* (process-run-function "osc-receive-process" #'(lambda () (loop do (print (setf x (second (osc::decode-message (receive-from *in-socket* 2048)))) #.*terminal-io*))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (loop repeat 10 do (progn (def-score test1 (:key-signature '(c maj) :time-signature '(4 4) :tempo (list (* x 3)) :start 1 :end 4) (part1 :omn (make-omn :pitch (list (midi-to-pitch x)) :length (gen-length-cartesian 1 1 'n 'n 'q '(2 3) '(13 4) '(1 2 3 4 5 6)) :span :length) :port 4 :channel 1 :sound 'gm :program 0 :volume 127)) (live-coding-midi (compile-score 'test1))) do (print x) do (sleep 3)) (process-kill *osc-receive*) ;; Prozess wieder anhalten  Quote Link to comment Share on other sites More sharing options...
opmo Posted January 12 Share Posted January 12 It is no clear how all this work and where is the midi (x) coming from. Quote Link to comment Share on other sites More sharing options...
AM Posted January 12 Author Share Posted January 12 MIDI KEYBOARD to OSCulator (translates MIDI to OSC) to OPMO (reading pitch (midi number) and set to variable X)  1) evaluate (setq *osc-receive*.......) 2) start/evaluate LOOP-section 3) start LIVE-CODE 4) play your midi-keyboard  => in every cycle of LIVE-CODING the "keyboard-pitch" will be read --- to variable X -> tempo and pitch are changing (by new cycle start)  5) stop all, incl.  evaluate (process-kill *osc-receive*) opmo 1 Quote Link to comment Share on other sites More sharing options...
JulioHerrlein Posted January 12 Share Posted January 12 It´s also possible (using MAX or Pure Data) to convert audio impulses to length values using a value in milliseconds as reference for beats and then convert the results to OMN syntax.  Nice Solution, Andre ! AM 1 Quote Link to comment Share on other sites More sharing options...
AM Posted January 12 Author Share Posted January 12 i know, of course, that LISP is not an environment for REALTIME actions (pure data / max would be much more suitable) - so I had to outsmart the system a little to import data (from a modularsynth and other applications) almost "on the fly" to generate a LIVE-SCORE (with the influence of this datas) at the concert/on the stage....  maybe i should learn MAX... for more smart-coded REALTIME things   JulioHerrlein 1 Quote Link to comment Share on other sites More sharing options...
JulioHerrlein Posted January 12 Share Posted January 12 Dear André,  Here is a project I did some years ago, with PD and Lilypond. Kind of realtime converter of beats to rhythmic notation.   AM 1 Quote Link to comment Share on other sites More sharing options...
AM Posted January 13 Author Share Posted January 13 thanks, julio!! JulioHerrlein 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.