cyrilcode / cyril

The Cyril programming language is designed for fast prototyping of visualisations and live coding visuals.
http://cyrilcode.com
Other
145 stars 21 forks source link

Any thoughts on OSC support? #18

Closed josephwilk closed 9 years ago

josephwilk commented 10 years ago

Hi,

Any thoughts on Cyril supporting Open Sound Control protocol? I've been experimenting with controlling visuals from Clojure programs using OSC and a combination of Fluxus (http://www.pawfal.org/fluxus/) and Shadertone (https://github.com/overtone/shadertone). Cyril looks very nice and smooth but I would need some kind of OSC handlers so I could send all my timing signals (from Overtone) to Cyril.

Any thoughts? Thanks, Joseph Wilk

darrenmothersele commented 10 years ago

yes, it's something I've been looking at, and Cyril user @danhett has been working on something too.

danhett commented 10 years ago

Hey!

I've started looking at a rough implementation at getting OSC into Cyril, it's less of a technical issue and more of an approach thing - what do we want to control with OSC, should it be user-configurable, etc.

My plan was to come up with a bunch of predefined constants and an accompanying TouchOSC panel that's tightly linked to Cyril, then users would have something to build on. Alternatively we could have a configuration somewhere (I believe we're bringing back settings.xml for projects?) where things could be defined in more detail. This is more complex though, I'm still leaning towards the simple approach at first!

Keen to hear your thoughts though.

josephwilk commented 10 years ago

Here is an example of how I use OSC now with Fluxus. Maybe that might provide some ideas:

What I'm looking for in an OSC message at the simplest possible level is to sync the visualisation with the beat of my music while I live code. In effect this is often just sending an incrementing int on every beat change.

Then on the OSC graphic side I have a listener which sets a var with that beat when it gets the OSC message. In turn I use this var to do some calculation to sync beats.

A small example in Fluxus using OSC might be:

(osc-source "6543")
  (every-frame
    (with-state
     (when (osc-msg "/beat-strike")
       (translate (vector 0 0 (osc 0))))
  (draw-cube)))

And the message sending would be:

(send "/beat-strike" 1)
(send "/beat-strike" 2)
(send "/beat-strike" 3)
...
lisongx commented 10 years ago

any update on this issue?

danhett commented 10 years ago

I believe a few people (myself included) have noodled with OSC for Cyril, but there's no concrete plan laid out or anything as of yet.

I got as far as adding a few values into the language, using an OSC panel running on an iPad (so you can now use IN1/IN2/IN3 as variables in the language).

This works for MY use case, but I'm not enough of an expert in OSC stuff to know exactly how people would want this configured to be of most use.

darrenmothersele commented 10 years ago

Initially I think we'll have some predefined variables in the language that map to OSC inputs, as per Dan's suggestion. I'd also like to have predefined controllers to start/stop the different Cyril buffers. Perhaps a set of "speed" variables that automatically oscillate as per the wave() function but at a rate determined by the OSC input?

I'd like to make this configurable, so that you can create variables that make sense for your application. For example I have a hacked MindFlex that outputs a pre-FFT'ed EEG value for meditation and attention, and I'd like these to appear as variables in the language. For this I'd suggest getting settings.xml working again so that these can be defined outside of the code.

danhett commented 10 years ago

I'd also like to throw my hat into the ring and suggest a nice big INTENSITY multiplier that can be attached to a big dial somehow. :D

darrenmothersele commented 9 years ago

I've added a new beta release (6) that has basic hard-coded OSC support. Plan to make this configurable by adding a settings.xml configuration file. Check this other issue for details of what's been implemented now, and further development: #24

josephwilk commented 9 years ago

Oh nice! Thanks