Skip to content

Instantly share code, notes, and snippets.

//--------------
// describe one thing
/*
first difficulty: classes
SC has a flexible and heterogenous class system, with innumerable classes inherited from `Object`, compared to the limited number of data types in MATLAB. there is no concept of primitive or literal types.
so, our "describe" function needs to explicitly handle types of objects for which numerical description makes sense.
@catfact
catfact / scdoc.css
Created April 7, 2024 16:36
wip - matching dark theme for scide help
*, *::before, *::after {
box-sizing: inherit;
}
html, body {
position: relative;
box-sizing: border-box;
height: 100%;
padding: 0;
margin: 0;
@catfact
catfact / delay_micro
Last active April 5, 2024 00:38
scrappy interpolated delay in JSFX
// This effect Copyright (C) 2024 Ezra Buchla
// License: CC BY-SA 4.0 - https://creativecommons.org/licenses/by-sa/4.0/deed.en
desc: micro delay
// tags: delay
// author: a moth object
slider1:0<0,1000,1>Integer Sample Delay
slider2:0<0,1,0.001>Sub-sample Interpolation
slider3:0<0,2,1>Interpolation Mode
postln("stereoize hello");
s = Server.default;
s.waitForBoot {
r = Routine {
// note that the bands here are not phase-corrected...
SynthDef.new(\splitDelay, {
@catfact
catfact / Engine_AmpPollTest.sc
Last active April 1, 2024 18:33
norns amplitude poll test
Engine_AmpPollTest : CroneEngine {
var <synth;
*new { arg context, doneCallback;
^super.new(context, doneCallback);
}
alloc {
synth = SynthDef.new(\amp_poll_test, {
arg out=0, amp=0.125, which = 0;
@catfact
catfact / chimes.scd
Last active April 3, 2024 03:04
sines and noise windchimes
s = Server.default;
s.waitForBoot {
r = Routine {
SynthDef.new(\sine_pair_perc, {
var hz = \hz.kr(200);
var beatrate = \beatrate.kr(2);
var beatrate_2 = beatrate/2;
var amp = \amp.kr(-30.dbamp);
@catfact
catfact / timbertest.lua
Last active January 19, 2024 22:48
timber loop mode test
local timber = include("timber/lib/timber_engine")
engine.name = "Timber"
local sample_paths = {
_path.audio .. "/common/808/808-BD.wav",
_path.audio .. "/common/808/808-SD.wav"
}
function init()
@catfact
catfact / noise_vs_buf.scd
Last active January 13, 2024 00:18
noise_vs_buf
n = 1000;
m = 20;
d = 0.1;
a = 0.1 / n;
h = Array.newClear(m);
s.waitForBoot { Routine {
i = 0;
@catfact
catfact / SimpleInputCapture.sc
Created January 5, 2024 00:51
simple input capture class for SuperCollider
SimpleStereoCapture {
classvar <bufSize;
classvar <synth;
classvar <buf;
classvar <oscFunc;
*initClass {
var s = Server.default;
@catfact
catfact / gist:5ed463d82701330c96024fa17aa9f39c
Created December 28, 2023 21:46
ji / 12tet pulse demo
s = Server.default;
s.waitForBoot { Routine {
SynthDef.new(\pan_pulse, {
var pos = Line.ar(\pos.kr(0), 0, \dur.kr(5));
var snd = Pulse.ar(\hz.kr(110));
snd = Pan2.ar(snd * \amp.kr(0.1), pos);
Out.ar(\out.kr(0), snd);
}).send(s);