Submit
Browse
Anonymous
Login
RSS
SuperCollider Code
Fork Code: OSC recorder
name
code content
( var beginTime; e = e ? (); e.oscMsgs = []; thisProcess.addOSCRecvFunc({|time, netAddr, msg| var relTime , cmd, sep; beginTime = beginTime ? time; relTime = time - beginTime; #cmd ... msg = msg; #sep ... cmd = cmd.asString; e.oscMsgs = e.oscMsgs ++ [[relTime, [cmd] ++ msg]]; // debug // [time -beginTime, netAddr, msg.collect{|it| format("% (: %)", it, it.class)}].postln }) ) // send messages... // show message array e.oscMsgs.do{|osc| osc.postln}; "" ( // write object file f = File("~/tmp/oscRecorderOut.txt".standardizePath,"w"); f.write(e.oscMsgs.asCompileString); f.close; // ) // write csv file FileWriter.write(e.oscMsgs.collect{|row| row.flatten}, "~/tmp/oscRecorderOut.csv".standardizePath); // write tab-delimited file file FileWriter.write(e.oscMsgs.collect{|row| row.flatten}, "~/tmp/oscRecorderOut.tdv".standardizePath, "\t"); // write OSC file Score.write(e.oscMsgs, "~/tmp/oscRecorderOut.osc".standardizePath) ( // write zipped txt a = ZArchive.write("~/tmp/oscRecorderOut.zscar".standardizePath); a.writeItem(e.oscMsgs); a.writeClose ) // test: n = NetAddr.localAddr; n.sendMsg("/test2", 100.rand, "dfkljsdflkjsdflksdjflsdkfjlsdkfjsd".scramble);
code description
basic OSC recorder, writes messages to zipped files.
use markdown for formating
category tags
comma separated, i.g. "wild, siren" (do not enter default SC class names, please)
ancestor(s)
comma separated identificators, i.g. "1-C,1-1,1-4M,1-x"
Private?
the code will be accessible by direct url and not visible in public activity
signup to submit public code without captcha
comment of change