SETOMTServer


2008

Till Bovermann 

Neuroinformatics Group, Bielefeld University, Germany


a server fullfilling the TUIO-Specs.

Uses the proprietary OSC protocol for the Mutlitouch surface implemented by mayan.

Format has to be the following:

/mt "set" <numItems> <id> <x> <y> <id> <x> <y> ...

the used format String (explained in SETObject) is then 

'_ixy'


*new(netaddr, setoClass)

netaddr a netaddr, default nil; listening to all. 

setoClass the Class of the created objects. 

Must be a subclass of SETObject, defaults to SETObject.

start

starts listening

stop

stops litening

gui

creates a gui representing recognized objects (2D for now and no rotation)

(

t = SETOMTServer(nil, SETOdump); // listen to all messages from anywhere

t.start;


g = t.gui;



// send it messages

n = NetAddr.localAddr;


n.sendMsg('/mt', \set, 1, 400, 400); 

i.update

)


t.stop;


///////////////////////

o = OSCresponder(NetAddr("192.168.0.20", nil), "/client", {|time, resp, msg| msg.postln})

o.add

o.remove




------------------

basic tonal example


SynthDef(\testTUIO, {|freq = 400, out = 0, amp = 0, vol = 0.25, famp=1|

Out.ar([out, out+1], SinOsc.ar(freq, 0, (amp.lag(0.01)*vol*famp)))

}).send(s);


q = ();

(

q.synths = IdentityDictionary.new; // a storage for synths


JITseto.action = {|me|

s.bind{

// make sure there is a synth

q.synths[me].isNil.if{

q.synths[me] = Synth(\testTUIO, [\vol, 0.2, \amp, 0])

};

s.sync;

me.visible.if({

q.synths[me].set(

\freq, me.pos[0].linexp(0, 1, 300, 800),

\amp, me.pos[1]

)

}, {

q.synths[me].set(

\amp, 0

)

})

}

}

)


// instantiate SETOServer

t = SETOMTServer(nil, JITseto); // listen to all messages from anywhere

t.gui;

t.start;

t.stop;