[CM] Receiving OSC

Kjetil S. Matheussen k.s.matheussen at notam02.no
Thu Oct 23 08:32:34 PDT 2008

I'm no expert in OSC, but I think using a C library, such as
liblo would be easier to use in Snd than OscPack,
which is a C++ library.

Here's an example client: 

Using eval-c, the example (up to the first "send" command only
and without the "blob"), can be written like this:

(eval-c-add-int-type "int32_t")
(eval-c "-llo"
         "#include <lo/lo.h>"
          "lo_address lo_address_new(const char *host, const char *port);
           int lo_send_message (lo_address targ, const char *path, lo_message msg);
           lo_message lo_message_new (void);
           void lo_message_free (lo_message m);
           void lo_message_add_int32 (lo_message m, int32_t a);
           void lo_message_add_float (lo_message m, float a);
           void lo_message_add_string (lo_message m, const char *a);"))

(define t (lo_address_new #f "7770"))

(define message (lo_message_new))

(lo_message_add_float message 0.12345678)
(lo_message_add_float message 23.0)

(define result (lo_send_message t "/foo/bar" message))

I don't know how easy it is to receive OSC though. That's probably
a lot harder, but by using "in" to poll a ringbuffer, it isn't
impossible to do without having to modify snd itself.

On Wed, 22 Oct 2008, Heinrich Taube wrote:

> I thnk the right way to do this is to link to the OscPack library.
> This would not be hard to do in scheme.
> Im trying mightily to get cm3 running in s7 scheme together with
> sndlib  inside a juce framework, ive only taken some baby steps but
> its looking good so far.
> On Oct 22, 2008, at 12:55 PM, errordeveloper at gmail.com wrote:
>> i'd really like to have OSC in snd as well!
>> i have got an idea of using puredata as a processing host,
>> so snd would send it a message and it would open a file (which
>> represent
>> a selection in snd) and process it then it'd send a msg back to snd
>> that
>> it's done and snd would put that back into the sound.
>> there different ways of how you can go about doing it in pd..
>> now i'm thinking of shell script which will send it all to pd via
>> pdsend
>> and then wait for pd to return something and then when the script has
>> exited snd will take the file back ..
>> _______________________________________________
>> Cmdist mailing list
>> Cmdist at ccrma.stanford.edu
>> http://ccrma-mail.stanford.edu/mailman/listinfo/cmdist
> _______________________________________________
> Cmdist mailing list
> Cmdist at ccrma.stanford.edu
> http://ccrma-mail.stanford.edu/mailman/listinfo/cmdist

More information about the Cmdist mailing list