Skip to content

Instantly share code, notes, and snippets.

// polyform lite - nb editon v.0.1 @sonoCircuit
// supercollider class based on the skilled labour study written by ezra buchla & dani derks for monome.org
NB_PolyForm {
// classvar <voiceKeys,
classvar <synthParams, <synthGroup, <synthVoices;
// do these all need to be classvars?
// [eb] it strikes me as a little weird to make everything classvars, which are global
// (so these Groups are always present in the background, forever)
//This is a manual to assemble an analog synth,
//called Tocante, and a musical simulator of its
//Capacitors that tune it! Thus the relationship
//of comment to code is like soldering to music.
//general procedure is to insert components in order,
//solder one leg of each from top, then flip the board.
//this way you can nip the leads flush to the fancy board,
//and finish solder nice flat rounded domes there.
@catfact
catfact / bmt-freeze.scd
Created April 26, 2025 17:53
bmt freezer
~out = 4;
~nfftpoints = 8192;
~nfftbands = (~nfftpoints / 2) + 1;
s = Server.default;
s.waitForBoot {
SynthDef.new(\freeze_smear_magbands_stereo, {
var input = In.ar(\in.kr, 2);
var chain = FFT(LocalBuf(~nfftpoints.dup, 1), input);
@catfact
catfact / cut_sync.lua
Last active January 30, 2025 19:00
minimal stereo looper to test softcut voice drift
--- test softcut voice sync
--- extremely basic stereo looper
---
--- K2: toggle recording
--- K3: reset to loop start
local s = softcut
local BUFFER_OFFSET = 0.1

//---------------------------------------------------- //--- state variables and parameters

n = 8; // number of "beats" (really 1/8 notes i guesss) d = 6; // ticks per beat. should be LCM of all desired possible divisions

//-- main sequence data, an array of beats q = Array.fill(n, {( activeDown: false, // active on "downbeat"? activeOff: false, // active on "offbeat"?

~nfftpoints = 2048;
~nfftbands = (~nfftpoints / 2) + 1;
s = Server.default;
s.waitForBoot {
SynthDef.new(\freeze_smear_magbands_stereo, {
var input = In.ar(\in.kr, 2);
var chain = FFT(LocalBuf(~nfftpoints.dup, 1), input);
var frozen = PV_MagFreeze(chain, \freeze.kr(0));
local cc_desc = {}
describe_midi_cc = function(num) return cc_desc[num] end
cc_desc[. 0] = "Bank Select (MSB)"
cc_desc[ 1] = "Modulation Wheel"
cc_desc[ 2] = "Breath controller"
cc_desc[ 3] = "Undefined"
cc_desc[ 4] = "Foot Pedal (MSB)"
cc_desc[ 5] = "Portamento Time (MSB)"
//--------------
// 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