Skip to content

Instantly share code, notes, and snippets.

View schollz's full-sized avatar
🎺

Zack schollz

🎺
View GitHub Profile
@catfact
catfact / distributions.c
Last active December 12, 2023 00:49
approximating some distributions in C
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
// generate uniformly distributed random number in [0, 1]
float rand_float() {
return (float)rand() / RAND_MAX;
}
const int NORM_APPROX_STAGES = 12;
@nhthn
nhthn / generative-patch.scd
Created February 7, 2022 23:08
Generative SuperCollider patch
(
SynthDef(\kick, {
var snd;
snd = SinOsc.ar(50 * (1 + (8 * Env.perc(0.001, 0.05).ar) + (2 * Env.perc(0.001, 0.3).ar)));
snd = snd + (SinOsc.ar(200 * (1 + (3 * Env.perc(0.001, 0.05).ar))) * Env.perc(0.001, 0.05).ar);
snd = snd + (Hasher.ar(Sweep.ar) * Env.perc(0.001, 0.01).ar);
snd = snd.tanh;
snd = snd * Env.perc(0.001, 1.0).ar(Done.freeSelf);
snd = snd ! 2;
snd = snd * \amp.kr(1);
@trentgill
trentgill / bouncy.lua
Last active October 8, 2022 18:55
lil demo of ASL creating simple decaying oscillator tones
--- bouncy
-- tiny demo of ASL's dyn, generating a stream of bass notes from crow
-- little sequins of frequencies
PIT = sequins{ 110
, 110*1.5
, 110*1.25
, 110*1.666
, 110*1.333
}
//////// sunset 2020
(Ndef(\reverb, {|wet=0.85, dry=0.15, size=10|
var input = \in.ar([0, 0]);
var primes = (2..13).nthPrime;
var reverb = Mix.ar(primes.collect({|i|
var delay = SinOsc.ar(0.02.rrand(0.1), 0, 0.02.rand, i/100);
AllpassL.ar(input, 1/2, delay, size, 1/primes.size)
}));
(wet*(reverb + input)) + (dry*input);
});
@m-radzikowski
m-radzikowski / script-template.sh
Last active May 14, 2025 01:40
Minimal safe Bash script template - see the article with full description: https://betterdev.blog/minimal-safe-bash-script-template/
#!/usr/bin/env bash
set -Eeuo pipefail
trap cleanup SIGINT SIGTERM ERR EXIT
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
usage() {
cat <<EOF
Usage: $(basename "${BASH_SOURCE[0]}") [-h] [-v] [-f] -p param_value arg1 [arg2...]
@madskjeldgaard
madskjeldgaard / raspiaudiotune.sh
Last active February 1, 2024 12:28
Tune Raspberry Pi for audio
#!/usr/bin/env sh
# Install utils for cpu freq
sudo apt-get install cpufrequtils
sudo cpufreq-set -r -g performance
sudo echo "ENABLE="true"
GOVERNOR="performance"
MAX_SPEED="0"
MIN_SPEED="0" " | sudo tee -a /etc/default/cpufrequtils
@dndrks
dndrks / pattern_time-study.lua
Created March 29, 2020 22:22
pattern time study
-- pattern_time study
pattern_time = require 'pattern_time' -- use the pattern_time lib in this script
function init()
grid_pattern = pattern_time.new() -- establish a pattern recorder
grid_pattern.process = grid_pattern_execute -- assign the function to be executed when the pattern plays back
grid_redraw()
end
@karnpapon
karnpapon / againagain.scd
Last active May 24, 2022 12:36
Cadson Demak - again_again(TBC-interpretation)
/////////////////////////////////////////////////////////////////////////////////////////
************************************** INITIALIZE ***************************************
/////////////////////////////////////////////////////////////////////////////////////////
Server.default.options.outDevice = "Built-in Output";
s.options.numBuffers = 2048 * 16;
s.options.memSize = 8192 * 16;
s.options.maxNodes = 1024 * 32;
// s.options.numOutputBusChannels = 12;
s.options.numInputBusChannels = 0;
@furenku
furenku / audioSynths.scd
Created April 25, 2019 05:09
INSTRUMENT SynthDefs
SynthDef(\audioBus, {|inBus=99,outBus=99,amp=1,pan=0|
var sig = In.ar(inBus);
Out.ar(outBus, Pan2.ar(sig * amp,pan))
}).store;
SynthDef(\audioInput, {| inBus=0, out = 0, gate=1,amp=1|
@audionerd
audionerd / supersaw-shooter.scd
Last active May 5, 2025 17:33
SuperSaw (Roland JP-8000 and JP-8080) in SuperCollider
// via https://web.archive.org/web/20191104212834/https://www.nada.kth.se/utbildning/grukth/exjobb/rapportlistor/2010/rapporter10/szabo_adam_10131.pdf
(
{ | freq = 523.3572, mix=0.75, detune = 0.75 |
var detuneCurve = { |x|
(10028.7312891634*x.pow(11)) -
(50818.8652045924*x.pow(10)) +
(111363.4808729368*x.pow(9)) -
(138150.6761080548*x.pow(8)) +
(106649.6679158292*x.pow(7)) -