[sc-users] better late than never
Julian Rohrhuber
rohrhuber at uni-hamburg.de
Wed Aug 30 21:00:09 PDT 2006
// sonification of your personal network latency
(
s = Server.local; // or a remote server
s.boot;
)
// approx. dirac impulse
(
SynthDef("dirac", { arg out=0, amp=1.0;
var trig;
trig = Impulse.ar;
FreeSelf.kr(trig);
OffsetOut.ar(out, trig * amp)
}, [\ir, \ir]).send(s);
);
// audification
(
var f = { s.sendMsg(9, \dirac, -1, 0) };
OSCresponder(s.addr, '/tr', f).add;
play { SendTrig.ar(In.ar) * 0.01 };
fork { 1.0.wait; f.value; };
)
// for a more pleasant experience, sonify the ping time and the
difference from average:
(
var f = { s.sendMsg(9, \dirac, -1, 0, 1, \out, 2) };
OSCresponder(s.addr, '/tr', f).add;
play {
var t = In.ar(2);
var freq = ZeroCrossing.ar(t);
var average = Lag.ar(freq, 4);
SendTrig.ar(t);
Ringz.ar(t, [freq * 4, (average - freq) * 500 + 1000], 0.1) * 0.1
};
fork { 1.0.wait; f.value; };
)
// literature:
http://ccrma.stanford.edu/groups/soundwire/
--
.
More information about the sc-users
mailing list