indeed, lots of love expressed on the forum for those vids.
personally i find it very hard to learn from videos and have never managed to sit through one of these. (but, i have been using supercollider since v1 in 1998 - a very differnet beast! - and am therefore not the target audience.)
but at the risk of stating the obvious, start with the extensive builtin help files in the supercolider IDE:
- open a new file
- type
DiskOut
and select it
- hit ctl-D
you get an HTML help file, usually with runnable examples. the help files vary in depth and quality but most are quite thorough and clear. there are also help files for system-level overviews, such as "Client vs Server"
which IMHO is mandatory if you are going to use this software.
you can do this with any Class
or .method
name. ctl+I will take you directly to class implementations. (classes are sometimes are thin wrappers around compiled implementations, but often are just implemented in SC themselves.)
anyways, here’s a little class that performs a simple capture of the stereo inputs:
SimpleStereoCapture {
var ioBuf;
var captureSynth;
var server;
*new { arg server;
^super.new.alloc(server);
}
alloc { arg s;
server = s;
ioBuf = Buffer.alloc(server, 65536, 2);
// register a new synthdef on the server
SynthDef.new(\simpleStereoCapture, {
arg buf;
DiskOut.ar(buf, SoundIn.ar([0, 1]));
}).send(server);
}
start { arg path;
// write the IO buffer and leave it open
ioBuf.write(path, "wav", "int24" , 0, 0, true);
captureSynth = Synth.new(\simpleStereoCapture, [\buf, ioBuf], server);
}
stop {
// free the capture synth
captureSynth.free;
// close the sound file
ioBuf.close;
}
}
here’s a test to be evaluated line-by-line with appropriate paths:
~cap = SimpleStereoCapture.new(Server.default);
~cap.start("/home/emb/Desktop/capture-test-1.wav");
~cap.stop;
~cap.start("/home/emb/Desktop/capture-test-2.wav");
~cap.stop;
you could stick a SimpleStereoCapture
in your engine and register commands to control it from lua.
eh… guess i should say, this is not ready to use as written. it needs safety checks: when starting a capture, check if captureSynth
is nil; otherwise free the old one and close the IO buffer before opening the buffer and creating a new synth. exercise for reader