-Jeff
-Jeff
On Friday, February 24, 2012 at 9:34 PM, Richie Cyngler wrote:
> SuperCollider's communication is built on OSC, I'm not sure how Overtone interacts with OSC but I'm guessing you should be able to get Wiimotes talking to SC via OSC using Overtone as the interface? (Someone please fill in the huge gaps in knowledge here).
>
> On Fri, Feb 24, 2012 at 9:25 PM, Jeff Rose <ros...@gmail.com (mailto:ros...@gmail.com)> wrote:
> > Hi James,
> > It would be great to have game controller support for manipulating synths and other stuff in Overtone. If you get something put together let us know, and feel free to ask here if you run into problems. I did experiment with JInput in the past to hookup with a playstation rock band drum kit, and it worked fine. Unfortunately I can't find that code right now, but I'll look around.
> >
> > -Jeff
> >
> >
> > On Thursday, February 23, 2012 at 10:59 AM, James Petry wrote:
> >
> > > I watched Sam Aaron's latest Overtone video, very inspiring, many thanks!
> > >
> > > In fact it inspired a bit of a mad thought.
> > >
> > > Looking at the different kinds of controller devices in the video, I am wondering about all the buttons,
> > > triggers and sticks on the USB XBox controller that is plugged into my home PC.
> > >
> > > I'd like to get them connected somehow into Overtone.
> > >
> > > Has anyone done anything like this?
> > >
> > > If not, I'd like to have a go.
> > >
> > > I mainly code in java and C# at work but we are starting to use clojure too. Haven't coded with Overtone yet at all.
> > >
> > > A quick search shows there's a project called JInput for reading game controllers in java.
>
>
>
> --
> Richie
>
> www.glitchpop.com (http://www.glitchpop.com)
As I'm not an idiomatic clojure programmer yet, and completely new to Overtone and OSC,I'll build a throw-away bridge from my gamepad to OSC just to get working code.It looks like I could write it in java for now using JInput and java-osc for the client, talking to osc-clj.
Overtone speaks OSC to SuperCollider, but I think for game controllers we'll want direct communication from the underlying Java library to Overtone by registering a handler function that receives some kind of simple controller event map. That way we can use it to control anything, from sequencers to synthesizer controls or other abstract musical controls in clojure.
SuperCollider's communication is built on OSC, I'm not sure how Overtone interacts with OSC but I'm guessing you should be able to get Wiimotes talking to SC via OSC using Overtone as the interface? (Someone please fill in the huge gaps in knowledge here).
We were talking a month or so ago [1] about a more general controller
abstraction, we came up with a list of hardware devices we'd like to
support and I suppose we should be adding game controllers to it -
everything else on the list is conventional (or not so conventional)
music production hardware. I should have a bit more time to actually
try to code some of the support up, will post more when I have
something working.
Tom
[1] https://groups.google.com/d/topic/overtone/o-ce252vRC0/discussion
[1] https://groups.google.com/d/topic/overtone/o-ce252vRC0/discussion
Please do - I'd expect most game controller inputs to map to either
buttons, faders or endless encoders but you never know!
Tom
Overtone speaks OSC to SuperCollider, but I think for game controllers we'll want direct communication from the underlying Java library to Overtone by registering a handler function that receives some kind of simple controller event map. That way we can use it to control anything, from sequencers to synthesizer controls or other abstract musical controls in clojure.
I don't know if it's the 'official overtone way', if there is such a
thing, but the examples I posted recently using my audiocube library
work for me and seem elegant enough. The API is at
https://github.com/tomoinn/overtone.device.audiocubes and an example
project using it to modulate synth properties at
https://github.com/tomoinn/audiocube-overtone-demo.
I don't think Jeff is referring to a specific overtone API (please
correct me if I'm wrong!) and more the general approach of having a
simple callback mechanism that can be used to glue your device
specific code into other bits of overtone.
The google doc I linked refers to a more general approach (and would
then *be* such an API) where an additional abstraction layer in the
form of a virtual console (in the 'recording studio' rather than
'terminal' sense) is interposed between physical hardware and consumer
code, but we don't have that yet.
Tom
-Jeff
-Jeff
I think the API should be a bit smarter. MIDI has its own issues in
terms of resolution, but that's by the by and is largely fixed with
OSC. The more important point is that we want to track the state of
virtual controls, and both MIDI and OSC are event based protocols. I
think the API should be trapping these events and using them to both
call interested parties and update state of a software proxy to the
hardware and of an intermediate layer between the representation of
the actual device and the client code.
We need to handle and store state so that if I create e.g. a virtual
grid of 100x100 buttons which can be toggled, and want to surface that
onto a grid of 8x8 physical buttons + scroll keys (i.e. a launchpad or
small monome) there has to be somewhere to maintain the state of the
controls which aren't currently being made available so that when we
scroll across we can update the hardware appropriately. Client code
would bind to events from the 100x100 grid, and a mapping function
would manage the translation in both directions of events between the
client, through the virtual console, through the hardware's proxy and
to and from the actual device.
Given this someone could write code which required, say, a 4x5 button
grid, three rotary encoders and four faders, and depending on what
hardware you actually had on hand (degenerate case - mouse and screen
or keyboard) you could map one or many physical devices into this
virtual console. Those of us with home studios and lots of space get
to play with all the hands on controls, someone on a laptop still
accesses the control functionality through an on-screen or keyboard
mapped equivalent. It's also nicely modular in terms of effort, once
we have the virtual console protocols and types the work required to
add a new hardware device is a distinct package and can be done by
someone who actually owns one.
Tom
Have you looked at the supercollider HID support?
example here: http://whatsinthestew.blogspot.com/2006/09/week6-supercollider-hid.html
This is on top of the simple event layer though, rather than built
into it, because in many cases it is useful to have a raw interface to
easily hook into without any repercussions.
-Jeff
I think it would be ideal if the low level communication API worked
along the lines of the midi interface, where a handler function is
called with an event map. Then on top of this, we can build out some
more generalized abstractions for components like button grids, sets
of sliders / dials, keyboards, velocity sensitive drum pads for
percussion, etc. Seem reasonable?
-Jeff
> With the release of Overtone 0.7, I'll pick up the game controller stuff again and get it going with the global event stream.
That would be fantastic! Let me know if we can help in any way. I guess you'll be using jinput?
I just threw up the latest Jinput nightly:
https://clojars.org/jinput
let me know if it works for you.
Also, this is something I put together quite a while ago now:
https://github.com/samaaron/space-navigator/blob/master/src/space_navigator.clj
it may be of some use - ignore if if not :-)