Jump to content

Recommended Posts

Posted

I am currently learning Max MSP for a project, but I would like to use a part of computing structures that I can generate much easier in Opusmodus. So I write code in OM (sorting algorithms for some clicks), test it (and modify my code), then export it to a library in Max MSP. I can now call up/coordinate the MIDI files in realtime etc ... in Max MSP.

 

(Workflow as a beginner in Max MSP...)

 

 

 

 

 

 

Posted

You can also utilise Live Coding here. Opusmodus can control any sound source, with Max serving as the sound source in this instance.

Posted

Yes, but I will control/trigger the MIDI files and their change in real time, via audio and filter thresholds (live-electronics). So this can only be done in Max MSP. 

 

My greatest wish: OM would be "integrated" in Max MSP. In the past there were some LISP-implementations in Max MSP, unfortunately no longer. I would be happy to expect certain processes in lists within Max (within a real time processes) and LISP/OM is optimal for this - this is much more cumbersome directly in MaxMSP

Another way would be to let OM and Max MSP run in parallel and to be able to evaluate a function in OM at a Cue from Max and then be able to use the result again in Max. Can you already do about OSC but is that very complex? Or does someone practice that?

Posted

I totally agree, that would be significant improvement. I have thoughts that maybe it's not possible since computing time is quite long in OM?

 

Andre, have you already done this with OSC?

Posted

hi there, i tried it NOW with receiving OSC (sending works fine), but i don't know to do it for RECEIVE... here is a sketch, but don^t work, any help?? i think it could be very very useful!!! janusz? 😄 

 

SENDING - works fine!! you can send ANY messages (data format) via OSC (more open then the original OM-version)

 


(defun osc-send (&rest args)
  (let*
      ((host #(127 0 0 1)) ;; host
       (port 7500) ;; port
       (s (usocket:socket-connect host port
                           :protocol :datagram
                           :element-type '(unsigned-byte 8)))
        (b (apply' osc:encode-message args)))
    (format t "sending to ~a on port ~A~%~%" host port)
    (unwind-protect
         (usocket:socket-send s b (length b))
      (when s (usocket:socket-close s)))))


(osc-send  "/player" "120" 1 1 1)
(osc-send "/beat" "defer" 0 "duration" 1 "pattern" 12)

 

 

RECEIVING - error/crash/don't stop receiving?  (i'm a bad programmer for such things :-)) i tried to adapt a function from the NET

 

(defun osc-receive-test (port)
  (let* ((host #(127 0 0 1)) ;; host
       (port 7500) ;; port
       (s (usocket:socket-connect host port
                           :protocol :datagram
                           :element-type '(unsigned-byte 8)))
	(buffer (make-sequence '(vector (unsigned-byte 8)) 1024)))
    (format t "listening on localhost port ~A~%~%" host port)
    (unwind-protect
	 (loop do
	      (usocket:socket-receive s buffer (length buffer))
	      (format t "received -=> ~S~%" (osc:decode-bundle buffer)))
      (when s (usocket:socket-close s)))))

 (osc-receive-test 7500) ;; never closing/stoping

 

 

here is the MAX-HELP to check this side

 

max-osc-help.maxpat

Posted

to receive data from Max MSP to...

 

1) start/eval functions  by MAX  in OM

2) to produce "new lists" (and sending it back to Max) based on data received from MAX (could be any data, internal processes , sensor data, whatever)... 

 

so you could produce data for future processes in MAX (for realtime) based on incoming data... 

 

years ago there were some LISP-inplementations in MAX (don't work anymore), but perhaps the communication via OSC would work too... and could be a simple solution. just having an "INTERFACE"

 

SITES.MUSIC.COLUMBIA.EDU
GITHUB.COM

Lisper is an easy to use interface between Max/MSP and Common Lisp - thealexgraham/lisper

 

Posted

What data is required, and how should it be interpreted for evaluation? How would you input new data into a function? To assess this functionality, I need concrete examples, including both input and output.

Posted

A convulsive example could be: I have a process running in Max MSP (pulse in constantly changing current values), these are influenced via an audio signal. If a certain value is reached (threshold value), MaxMSP should send the last 20 values to OM. OM then sorts these values in a new sequence, sends them back to Max and reads them again as a current values.

 

Instead of sorting, other complex functions of OM could also be applied to these values and then reinterpreted.

I think you could use the specific skills of the platforms and have them interacted.

 

just sending LISTS between the platforms and starting to EVAL in OM

 

MAX send could be a just MESSAGE, receiving too.  one MAX-bang should send  a "message", like shown in the MAX-patch

Posted

Andre, I need examples, function examples. What data comes in and where. I am talking about imaginery function of course.

I am not looking for Max lesson 🙂

Example:
 

(osc-prompt (vector-map '(.4 .5 .3 .2) (osc-receive "values")) "triger-id")

 

or

 

(setf osc-data1 (gen-osc-data 4 (osc-recive "values")
                              :time '(1/2 1/4 1/12 1/12 1/12)
                              :min 0.0
                              :max 1.0
                              :bpm 120))
(defparameter max '(127.0.0.1 10000))
(setf thd1 (create-osc-thread "thread1" Max))
(osc-prompt (send-osc-data thd1 osc-data1) "trigger-id") ; nil or t or ?

 

Something like that. Concrete examples of use.

Posted (edited)

this is the working example for send. very basic, i can send all in my FORMAT, i used i for several pieces... (but just SEND)

 

;; the function

(defun osc-send (&rest args)
  (let*
      ((host #(127 0 0 1)) ;; host
       (port 7500) ;; port
       (s (usocket:socket-connect host port
                           :protocol :datagram
                           :element-type '(unsigned-byte 8)))
        (b (apply' osc:encode-message args)))
    (format t "sending to ~a on port ~A~%~%" host port)
    (unwind-protect
         (usocket:socket-send s b (length b))
      (when s (usocket:socket-close s)))))

;; the examples - i'm sending the data the receiver needs / open, a non-pretermined ... 

(osc-send  "/player" "120" 1 1 1)
(osc-send "/beat" "defer" 0 "duration" 1 "pattern" 12)

;; could also be/new?:  (osc-send '(1 2 3 4 5))

 

 

RECEIVE VALUES - for me, two main ideas

 

;;; DATA RECEIVE - with port host
;;;(osc-receive)
;; for example: 
;; sended in OSC: "1 4.5 5000 n" => comes in in OM as '(1 4.5 5000 n) or as a string "1 4.5 5000 n"
;;;(setf alist (osc-receive))

;;; EVAL RECEIVE - with port host
;;; for example when sended in OSC "eval", then the function OM inside evaluates...
;;; (osc-eval (gen-sort '(rnd-order '(3 3 6 5 4 3 1)))
;;; => 

 

such a formated datastructure  is too restrective to use OSC really "OPEN"... it makes sense for some "reaktor"... it is interesting too keep it open?

"
...
:time '(1/2 1/4 1/12 1/12 1/12)
                              :min 0.0
                              :max 1.0
                              :bpm 120))

...
"

 

Edited by AM

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

Terms of Use Privacy Policy