anneVideotracking4

a much improved version of my old max application anneVideotracking

with this version you can use 12 zones on a webcamera video input to trigger midi, soundfiles, audio input (mics) and osc messages (send to supercollider for example).
the zones include filters and different types of thresholds and calibration. the data can be on/off triggers and or continuous values.

(sorry for the terrible gui design.)

download the mac standalone from here.

and here's the updated supercollider example that demonstrates how to use the osc data to control some sine oscillators.

//to start: select all & cmd+enter
//to stop: cmd + .
(
n= 12;
s.latency= 0.05;
s.waitForBoot{
        var dlast= 0.dup(n);
        d= {Bus.control(s, 1)}.dup(n);
        e= {Bus.control(s, 1)}.dup(n);
        OSCFunc({|m|
                var index= m[1], val= m[2], diff= (val-dlast[index]).abs;
                //m.postln;
                d[index].set(val);
                e[index].set(diff);
                dlast.put(index, val);
        }, \anneVideoTracking);
        CmdPeriod.doOnce({d.do{|x| x.free}; e.do{|x| x.free}});
        SynthDef(\annetest, {
                var src= Mix({|i| SinOsc.ar(i*100+400, 0, LagUD.kr(In.kr(e[i].index), 0.01, 0.1))}.dup(n));
                Out.ar(0, Pan2.ar(src));
        }).add;
        s.sync;
        Synth(\annetest);
};
)