support for third party environments

77 views
Skip to first unread message

Marinos Koutsomichalis

unread,
Mar 31, 2011, 10:50:03 AM3/31/11
to field-de...@googlegroups.com
I noticed that there is support for a vast number of other languages and even 3d party apps .. like Java, Max/Msp, Processing, Clojure..

I am of course in my very first field steps, but
I was wandering how difficult would it be to add some kind of support for another 3d party environment ??

I already mentioned that I use supercollider for sound synthesis for years so my first concern was to establish an OSC connection between field - which I did easily,
but prior to start porting code to python and since supercollider can be interfaced from several IDEs ( emacs, gedit, VI ) it seems to me that it won' t be too difficult to make field a proper sc IDE

I am not at all experienced in that sort of things
but I could try porting the emacs code as an exercise at some point - who knows.. I might succeed..

what I' d like to ask is if there are any guidelines ? What is the usual procedure to add support for a 3d party piece of software ??


--
Marinos Koutsomichalis
Music Research Center, University of York
Contemporary Music Research Centre (CMRC)
Faculty of Music Technology & Acoustics - TEI of Crete
www.marinoskoutsomichalis.com

j milo taylor

unread,
Mar 31, 2011, 11:02:03 AM3/31/11
to field-de...@googlegroups.com
Hi everyone,

Just introducing myself - Dr J Milo Taylor - installation artist,
musician, producer, improvisor, academic.
Currently working on a project with motion capture at Uni of Sussex and
hoping to get into field to create a collaborative performance with dancers.

Keep up the great work,

Best,
Milo

> Faculty of Music Technology& Acoustics - TEI of Crete
> www.marinoskoutsomichalis.com
>
>
>
>
>
>
>

Marc Downie

unread,
Mar 31, 2011, 9:30:38 PM3/31/11
to field-de...@googlegroups.com, Marinos Koutsomichalis
On Thu, Mar 31, 2011 at 9:50 AM, Marinos Koutsomichalis <mar...@agxivatein.com> wrote:
I noticed that there is support for a vast number of other languages  and even 3d party apps .. like Java, Max/Msp, Processing, Clojure..

I am of course in my very first field steps, but
I was wandering how difficult would it be to add some kind of support for another 3d party environment ??

I've done 3 of these pretty recently — Ruby / Clojure, remote JavaScript and "remote Field applications" and a pattern is emerging concerning the kinds of levels of integration that a foreign runtime can have with Field.

1. The first level of integration is as you say — some kind of data transfer. OSC helps here, but also straight ahead sockets — either Python sockets or Java sockets via Python. Then you write code to send data at "interesting times".

2. The second is remote code execution (Max plugin, Javascript, the other languages like Ruby and Clojure). This is much more fun. The first step for doing that — which you ought to be able to do without writing a Field plugin — is a text transform. This is just a python function that you define that, when deployed as a text transform in Field, ends up getting what you write in the transform given to it as a big string — see http://openendedgroup.com/field/wiki/MayaIntegration#Texttransformarea

If you can conspire to have something embedded inside the remote environment that interprets data as code to be executed then you can reuse your method from '1' to send code to it this way.

3. The next stage is a full on plugin. This will give you the opportunity to "start" and "stop" boxes with option-click and do completion and introspection. We don't have a particularly nice template for cooking these plugins up now, but we ought to have — at this point its relatively settled what has to be done. If you want to dig into it, take a look at the sources for the Max Plugin or perhaps the Processing plugin.

I suspect that you could do all three of these with Supercollider — although I haven't played with supercollider for ~10 years, so I don't know accessible the compiler is from the runtime. It certainly looks dynamic enough.
 
I already mentioned that I use supercollider for sound synthesis for years so my first concern was to establish an OSC connection between field - which I did easily,
but prior to start porting code to python and since supercollider can be interfaced from several IDEs ( emacs, gedit, VI ) it seems to me that it won' t be too difficult to make field a proper sc IDE

I am not at all experienced in that sort of things
but I could try porting the emacs code as an exercise at some point - who knows.. I might succeed..

what  I' d like to ask is if there are any guidelines ? What is the usual procedure to add support for a 3d party piece of software ??

Let me know if the above helps.

If you end up hitting a wall then try to reduce the problem to a description that looks like:

1. send this String to this socket inside a packet that looks like this and it will be executed in the SC runtime
2. send this particular String to list the contents of an object or "print" it.
3. this is the kind of string you'd send to "start" something and then "stop" it. (To see some Javascript code for making a Field style "animation loop" see the online plugin tutorial here — http://openendedgroup.com/field/wiki/OnlinePlugin

then the last bit wouldn't take me any time at all to finish.

best,

Marc.


 

--
Marinos Koutsomichalis
Music Research Center, University of York
Contemporary Music Research Centre (CMRC)
Faculty of Music Technology & Acoustics - TEI of Crete
www.marinoskoutsomichalis.com







--
You received this message because you are subscribed to the Google Groups "Field-development" group.
To post to this group, send email to field-de...@googlegroups.com.
To unsubscribe from this group, send email to field-developm...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/field-development?hl=en.


Marc Downie

unread,
Apr 24, 2011, 8:39:05 PM4/24/11
to field-de...@googlegroups.com

I already mentioned that I use supercollider for sound synthesis for years so my first concern was to establish an OSC connection between field - which I did easily,
but prior to start porting code to python and since supercollider can be interfaced from several IDEs ( emacs, gedit, VI ) it seems to me that it won' t be too difficult to make field a proper sc IDE

This project, if you haven't seen it, looks pretty interesting:


Field already has rudimentary Clojure support and it might be interesting to take a close look at how this project drives SC's compiler dynamically.

best,

Marc.

liubo borissov

unread,
Apr 24, 2011, 10:10:37 PM4/24/11
to field-de...@googlegroups.com
i'm very interested in this but have very little experience with clojure. have you actually tried to use overtone from field? if so, could you post something saying which jars and dependencies need to go where to get things to make noise. thanks



Al Matthews

unread,
Apr 25, 2011, 10:28:26 AM4/25/11
to field-de...@googlegroups.com
> i'm very interested in this but have very little experience with clojure. have you actually tried to use overtone from field? if so, could you post something saying which jars and dependencies need to go where to get things to make noise. thanks

Me too.

Following on, since from the Overtone roadmap there appears:

> * include libscsynth in jar file and boot server in process
> * Link directly with the SuperCollider library and start the server in the same process as the JVM so we can have lower latency osc communication, and direct access to buffers of audio data for real-time visualization,

, and given clojure's reputation for ease of concurrency, some
clojure-jna work around sc-server seems like a great idea, maybe on a
general scale.

Perhaps now is also the proper time to raise as also interesting
https://github.com/Sciss/ScalaCollider. It seems to be a scala-based
redesign or rewrite of sclang, which is the language with which one
typically interacts with sc-server the supercollider server.

A little matrix of comparison:

Overtone appears to use clojure-jna to wrap sc-server into a jvm process ?
ScalaCollider seems based on the JavaCollider java bindings, to sc-server

Overtone appears to layer an entire environment upon the sc-server "engine"
ScalaCollider seems to concentrate on reworking the sclang composition layer

Supposing this encapsulated the options, then there could variously be

a) a javacollider jar in field
b) scalacollider likewise, in field
c) clojure-jna work against sc-server

I'd like to think the javacollider layer in scalacollider may be
abstracted out.

Might that not open the door to SuperCollider work in Field in either
sclang or scala, against c)?

--
Al Matthews

Marc Downie

unread,
Apr 29, 2011, 3:18:41 PM4/29/11
to field-de...@googlegroups.com
On Mon, Apr 25, 2011 at 9:28 AM, Al Matthews <prol...@gmail.com> wrote:
>
> > i'm very interested in this but have very little experience with clojure. have you actually tried to use overtone from field? if so, could you post something saying which jars and dependencies need to go where to get things to make noise. thanks

Finally had an hour to hack on this and I have something with Overtone
working fine in Field.

Brief story (it's pretty much as you'd expect):

follow the install instructions at
https://github.com/overtone/overtone until you can get the whole thing
working (i.e. lein repl , ((synth (out 0 (pan2 (sin-osc 440))))) makes
sound come out of your speakers ).

you'll end up with a directory ..../overtone/lib and ..../overton/src in it.

Now you need to tell Field's plugin manager about these dirs. The
first is a "add directory full of jars to classpath" and the second is
a "add jar/directory to classpath".

Now you can write:

(use 'overtone.live)

(definst sin-wave [freq 440 attack 0.01 sustain 0.4 release 0.1 vol 0.4]
  (* (env-gen (lin-env attack sustain release) 1 1 0 1 :free)
     (sin-osc freq)
     vol))
(sin-wave)

(definst spooky-house [freq 440 width 0.2
                         attack 0.3 sustain 4 release 0.3
                         vol 0.4]
  (* (env-gen (lin-env attack sustain release) 1 1 0 1 :free)
     (sin-osc (+ freq (* 20 (lf-pulse:kr 0.5 0 width))))
     vol))

(spooky-house)

---

Wrapped in a Clojure transform of course. That's basically the extent
of my testing right now.

Unfortunately you'll need the current repository version of Field
rather than a stock Field 12 (bug concerning how Field redirects
Clojure output — it seems that there's some serious voodo inside
Clojure about how *out* and *err* are bound). If anybody is desperate
to try this and isn't in the mood to build Field from source, give me
a shout and I'll make an interim build.

>
> Me too.
>
> Following on, since from the Overtone roadmap there appears:
>
> > * include libscsynth in jar file and boot server in process
> > * Link directly with the SuperCollider library and start the server in the same process as the JVM so we can have lower latency osc communication, and direct access to buffers of audio data for real-time visualization,

Yes, as far as I can tell this is what they are currently doing (I
certainly don't recall installing, and can't find, SC on this
partition).

>
> , and given clojure's reputation for ease of concurrency, some
> clojure-jna work around sc-server seems like a great idea, maybe on a
> general scale.
>
> Perhaps now is also the proper time to raise as also interesting
> https://github.com/Sciss/ScalaCollider. It seems to be a scala-based
> redesign or rewrite of sclang, which is the language with which one
> typically interacts with sc-server the supercollider server.
>
> A little matrix of comparison:
>
> Overtone appears to use clojure-jna to wrap sc-server into a jvm process ?
> ScalaCollider seems based on the JavaCollider java bindings, to sc-server
>
> Overtone appears to layer an entire environment upon the sc-server "engine"
> ScalaCollider seems to concentrate on reworking the sclang composition layer
>
> Supposing this encapsulated the options, then there could variously be
>
> a) a javacollider jar in field
> b) scalacollider likewise, in field
> c) clojure-jna work against sc-server
>
> I'd like to think the javacollider layer in scalacollider may be
> abstracted out.

I agree. But briefly looking at both projects shows a lot of sugar for
writing Supercollider code without writing it in the supercollider
language. I wouldn't want to sign up to supporting a Python version of
all that; cool as it would be.

It's also a good excuse to sharpen my Clojure (or Scala) skills and
the Field / Clojure interop.

Marc.

Al Matthews

unread,
Apr 29, 2011, 3:48:00 PM4/29/11
to field-de...@googlegroups.com
Thank you Marc.

> Yes, as far as I can tell this is what they are currently doing (I
> certainly don't recall installing, and can't find, SC on this
> partition).

Maybe the .so files in
~/.m2/overtone/lib/scsynth-jna-0.1.2-20100502.112537-1.jar, is all I
can figure

--
Al Matthews

liubo borissov

unread,
Sep 30, 2011, 4:37:22 PM9/30/11
to field-de...@googlegroups.com
hi, i have a problem trying out the tutorial from http://openendedgroup.com:8000/field/wiki/ExperimentsInOvertone.
i followed the steps and got everything in the right place (i think). i get 

javax.script.ScriptException: java.io.FileNotFoundException: Could not locate overtone/live__init.class or overtone/live.clj on classpath:  (NO_SOURCE_FILE:0) -1

when i try

(use 'overtone.live)

the same line works fine if i run overtone from the terminal. here's a brief video of my setup/problem:


any help would be appreciated.

Marc Downie

unread,
Sep 30, 2011, 6:31:08 PM9/30/11
to field-de...@googlegroups.com

Overtone is a new version ahead of that tutorial. Let me download their latest and see what's changed.

(Of course, many things about Clojure's namespace internals remain opaque to me, so it could well be my fault).

Marc.

Marc Downie

unread,
Sep 30, 2011, 11:24:34 PM9/30/11
to field-de...@googlegroups.com
On Fri, Sep 30, 2011 at 5:31 PM, Marc Downie <ma...@openendedgroup.com> wrote:

Overtone is a new version ahead of that tutorial. Let me download their latest and see what's changed.


Minor (but significant) updates to the tutorial for the latest versions of Overtone and a bugfix in Field. Liubo — if you wouldn't mind giving it giving it another whack with a nightly build. 

Should there be any Overtone / Clojure hackers itching for a working Field/Overtone unison, I'd be happy to send on a binary. It's definitely an area of Field that needs more eyeballs.

Marc.

Al Matthews

unread,
Oct 9, 2011, 8:06:05 AM10/9/11
to field-de...@googlegroups.com
Hey, look, Overtone is on page one of Hacker News for the last 14 hours or so.

--
Al Matthews

Reply all
Reply to author
Forward
0 new messages