TouchOSC controlled mixer in Supercollider

Hi all. I'm a beginner and I was wondering if anyone has any experience with building a mixer in Supercollider and/or controlling it with touchOSC?

var w, spec;
spec = \db.asSpec;
w = Window("Mixer v0.1", Rect(240, 240, 300, 500)).front;

w.view.layout = HLayout(*~dirt.orbits.collect { |x|
    var val = spec.unmap(x.get(\amp).ampdb);
    Slider().value_(val).action_({ |v| x.set(\amp, spec.map(v.value)) })
});

Starting with this code i picked up, sorry i can't remember where, I have a GUI mixer that controls the volume of each orbit, albeit in an inverted fashion (pushing them up turns the orbit volume down IIRC)

With 8 of these OSCDefs i am receiving data from faders in touchOSC and posting it in the post window.

n = NetAddr("192.168.0.50");

OSCdef.new(
    \fader2,
    {

	    arg msg, time, addr, port;

	    msg[1].postln;

     },
    '/1/fader2',
    n,
    8000
);

n is the network address of my phone. 8000 is the default outgoing port from touchOSC to avoid clashing with the default port used for Tidal.

I am hoping more experienced people can help me with connecting these OSCDefs to the Sliders (and putting them the right way up) so that I can control the Sliders with touchOSC on my phone and maybe we can start a more general discussion about building mixers for our live Tidal setups in Supercollider along the way. I will update this thread as I discover new information and share the development of my own mixer.

3 Likes

After a bit of messing around I got this working:

~dirt.orbits.collect { |x, i|
	var path = '/osc/slider' ++ (i + 1); // change this
	OSCdef(path.asSymbol, { |msg| x.set(\amp, msg[1]); }, path);
}

You may need to change the path variable to match the OSC addresses defined on your sliders. You need to put your computer's IP address and SuperCollider port (57120 by default) into TouchOSC (or whatever app you want to use – I used OSC Controller which is free on Android). You don't need to put the phone's address into SuperCollider as we're not sending messages to the phone. You can add that to your startup file after SuperDirt is started.

I'd love to be able to use touch controls more naturally with Tidal. I'm imagining a way of typing some code in the Tidal editor that simultaneously creates a control on the phone and maps the value to a parameter in Tidal, like a super-powered cF.

5 Likes

You absolute legend. It's all working now, many thanks for that and hope you had a great Christmas and New Year!