Jason (jcreed) wrote,

It is the weekend so I had a whole day to mess about with that "Supercollider" thing I posted about before. It is the most hilariously-baroque-yet-usable programming environment yet I have come across for doing realtime synthesis.

It does some things right, and some things crazy.

Right things include: on linux, nice integration with emacs, so that you can very easily copypasta single lines from the documentation into your buffer, and you are two keystrokes away from hearing what it sounds like. I'm to understand it's like this on other platforms too, only without emacs. Lots of functional programming combinators, though no types, of course.

Bad things include: holy shit too much TMTOWTDI. Hard to be sure you are deallocating all the things you need to deallocate. Different synth units interact via numbered busses.

Here is some of "my" code, but it's really just documentation copypasta with a few choice parameter settings:

SynthDef(\sawpulse, { |out, freq = 440, gate = 0.5, plfofreq = 6, mw = 0, ffreq = 2000,
rq = 0.3, freqlag = 0.05, amp = 1|
var sig, plfo, fcurve;
plfo = SinOsc.kr(plfofreq, mul:mw, add:1);
freq = Lag.kr(freq, freqlag) * plfo;
fcurve = EnvGen.kr(Env.adsr(0, 0.3, 0.1, 20), gate);
fcurve = (fcurve - 1).madd(0.7, 1) * ffreq;
sig = Mix.ar([Pulse.ar(freq, 0.9), Saw.ar(freq*1.007)]);
sig = RLPF.ar(sig, fcurve, rq)
* EnvGen.kr(Env.adsr(0.04, 0.2, 0.6, 0.1), gate, doneAction:2)
* amp;
Out.ar(out, sig ! 2)

SynthDef("help-Diskin-2chan", { arg bufnum = 0;
Out.ar(0, DiskIn.ar(2, bufnum));

SynthDef("help-Diskout", {arg bufnum;
DiskOut.ar(bufnum, In.ar(0,2));

p = PmonoArtic(\sawpulse, \dur, 0.2, \freq, Pwhite(1,8) * 100, \mw, 0.8, \plfofreq,
8, \gate, 0, \rq, 0.05, \freqlag, 0.0001, \legato, Pwrand(#[0.5, 1.0], #[0.1, 0.9], inf) ).play;

q = Pbind(\instrument, \sawpulse, \delta, 3, \dur, 3, \mw, 0.9, \plfofreq, 19,
\freq, 220, \rq, 0.05, \ffreq, Pseq([200, 200, 180, 180], inf), \amp, 1).play;

b= Buffer.alloc(s, 65536, 2);
b.write("/tmp/rec.wav".standardizePath, "wav", "float", 0, 0, true);
d = Synth.tail(nil, "help-Diskout", ["bufnum", b]);

x = Synth.basicNew("help-Diskin-2chan");
m = { arg buf; x.addToHeadMsg(nil, [\bufnum,buf])};
b = Buffer.cueSoundFile(s,"/tmp/rec.wav".standardizePath, 0, 2, completionMessage: m);

Here is what it sounds like: http://soundcloud.com/jcreed/jurassic-wugs-in-peril


Another thing I learned today: road bikes are not suitable for biking in snowstorms ahahaha. I think I'ma just take the bus back home.
Tags: music, supercollider

  • (no subject)

    Something that's bugged me for a long time is this: How many paths, starting at the origin, taking N steps either up, down, left or right, end up at…

  • (no subject)

    Still sad that SAC seems to end up being as complicated as it is. Surely there's some deeper duality between…

  • (no subject)

    I had already been meaning to dig into JaneSt's "Incremental" library, which bills itself as a practical implementation (in ocaml) of the ideas in…

  • Post a new comment


    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded