Skip to content

Instantly share code, notes, and snippets.

View madskjeldgaard's full-sized avatar

Mads Kjeldgaard madskjeldgaard

View GitHub Profile
@madskjeldgaard
madskjeldgaard / default-synth.scd
Created October 18, 2019 10:49
An alternative default synth for SuperCollider
/*
The default synth def sound in SC can be tiresome.
You can change it simply by making a new SynthDef called \default which will overwrite the other one.
To make this change permanent, add it to your startup file.
*/
// A simple triangle wave synth in stereo with panning and a simple low pass filter
(
@madskjeldgaard
madskjeldgaard / safe-benjolin.scd
Last active July 1, 2024 11:38
A safer version of Alejandro Olartes benjolin

/* Instrument inspired from Rob Hordijk's Benjolin, it requires sc3-plugins (PulseDPW, SVF and DFM1)

outSignal: 1-triangle osc1, 2-square osc1, 3-triangle osc2, 4-pulse osc2, 5-XOR output, 6-Filter output

(
// This will automatically create a bus and map it accordingly in the Pbind
// Try changing each node proxy and listen to the pattern change
// You still have to do all operations to the lfo's data inside of the
// nodeproxies
Ndef(\lfo1, {SinOsc.kr(0.1)});
Ndef(\mousefreq, {MouseX.kr().exprange(20,12000)});
Pbind(
\amp, Ndef(\lfo),
@madskjeldgaard
madskjeldgaard / balintthelivecoder.scd
Created June 21, 2019 16:57
Livecoding time stretch
// Try live coding this, Balint! Change some parameters and then reevalute
(
Ndef(\balintthedragon, {
arg buffer, // If you don't set the buffer argument, it will automatically take whatever buffer you have loaded in your server
grainsize=0.5,
rate=0.001,
freqScale=0.25,
volume=1,
rand=0.1;
@madskjeldgaard
madskjeldgaard / particularlybalint.scd
Last active June 21, 2019 16:30
Particular example for Balint
// boot server
s.boot;
// Init particular
p = Particular.new;
// Load a buffer with sound
b = Buffer.read(s, "~/path/to/sound.wav");
// Number of outputs, this can be fun play with in patterns
snippet h "header"
/*
`!v expand('%:t')`
`!v strftime("%Y-%m-%d")`
By: `!v g:snips_author`, `!v g:snips_contact`
*/
endsnippet
# vim:fileencoding=utf-8:ft=conf:foldmethod=marker
#: Fonts {{{
#: kitty has very powerful font management. You can configure
#: individual font faces and even specify special fonts for particular
#: characters.
font_family Source Code Variable
# bold_font auto
set runtimepath^=~/.vim runtimepath+=~/.vim/after
let &packpath = &runtimepath
source ~/.vimrc
call plug#begin()
" SuperCollider
Plug 'davidgranstrom/scnvim'
" Csound
@madskjeldgaard
madskjeldgaard / Collatz.sc
Created March 19, 2019 09:51
Code from SuperCollider meetup Oslo march 2019
Collatz{
*new {
^super.new.init;
}
init{
"Im in init".postln;
}
*calculate{arg number;