Skip to content

Instantly share code, notes, and snippets.

@catfact
catfact / ftrack.scd
Last active April 2, 2016 13:54
cmf 4track (sc)
//-- top level sound directory
d = (thisProcess.platform.recordingsDir ++ "/ftrack/").standardizePath;
//-- dictionary associating subdir names to path arrays
p = Dictionary.new;
PathName(d).folders.do({ |f| p.add(f.folderName.asSymbol -> f.files); });
//-- runtime state stored in this Event
e = (
@catfact
catfact / wave_view.scd
Last active June 25, 2016 19:54
supercollider wave view
s = Server.local;
s.waitForBoot {
~bufsize = s.sampleRate;
~graphsize = ~bufsize / 100;
~buf = Buffer.alloc(s, ~bufsize, 1);
~in = { RecordBuf.ar(SoundIn.ar(0), ~buf.bufnum); }.play;
~delta = 0.5;
// testing audible differences between VOsc.ar and Osc.ar under frequency/phase modulation
// press '1' to hear VOsc, '2' to hear Osc
// drag mouse on window to change mod hz and depth
// VOsc is set to interpolate between identical sine buffers
Routine {
SynthDef.new(\vosc_test, {
arg out=0, buf=0, amp=0.25, hz_car=240, hz_mod=60, mod_idx=1.0, fade=0.0;
var mod, car;
@catfact
catfact / aleph-svf-test.scd
Created November 3, 2016 22:58
filter excitation signal generator
Routine {
/* // continuous white noise
~noise = { arg out=1, amp=0.125; Out.ar(out, WhiteNoise.ar * amp) }.play;
~noise.free;
*/
SynthDef.new(\ping_noise_decay, {
arg out=1, amp=0.25, atk=0.0, rel=0.001;
Out.ar(out,
WhiteNoise.ar
@catfact
catfact / gist:95bd414785ded64ce1d008164be2ce18
Created August 24, 2017 18:48
supercollider class for raw monome grid
CfGridRaw {
var <>p; // serial port
var <>q; // rx data queue
var <>r; // rx read loop
// responder functions
var <>keyUp, <>keyDown;
*new { arg port_ = '/dev/ttyUSB0', baud_ = 115200;
^super.new.init(port_, baud_);
@catfact
catfact / sines.scd
Last active October 3, 2017 04:14
simple waveform audio files in supercollider
// function to make a sine
var export_sine = {
arg hz, dur, amp = 0.5, sr = 48000;
var sf, path;
var cycles = dur * hz;
var samplesPerCycle = sr / hz;
// specify some other array of harmonics here for richer waveforms
var signal = Signal.sineFill(samplesPerCycle, [1.0]) * amp;
@catfact
catfact / Engine_SimplePassThru.sc
Last active April 25, 2022 10:53
norns passthru example
Engine_SimplePassThru : CroneEngine {
var amp=0;
var <synth;
// this is your constructor. the 'context' arg is a CroneAudioContext.
// it provides input and output busses and groups.
// see its implementation for details.
*new { arg context, doneCallback;
^super.new(context, doneCallback);
@catfact
catfact / bark-envelope-pitch-thing.scd
Last active September 12, 2020 18:40
bark scaled multiband envelope follower and freaky vocodder
Routine {
s = Server.default;
s.waitForBoot;
// bark band table.
// each entry: [bark number, cutoff, center, bandwidth]
~bark = [
[ 1, 60, 100, 80 ],
[ 2, 150, 200, 100 ],
Routine {
s = Server.default;
s.waitForBoot;
// max buffer duration
~dur = 8.0;
// 4-channel buffer: pitch, clar, amp, flatness
~buf = Buffer.alloc(s, s.sampleRate * ~dur, 4);
// outlets: input index, output index, connection value
outlets = 3;
sketch.default2d();
// I/O count, should be an argument
var num_ins = 4;
var num_outs = 4;
// mouse state (world coordinates)