Skip to content

Instantly share code, notes, and snippets.

@edeleflie
edeleflie / gist:1005719
Created June 3, 2011 01:52
Problematic YAML
# REQUIRED: The credentials for creating/accessong your app's database
#
db_user: "#{app_name[0,16]}"
db_pass:
db_name: "#{app_name}_#{RUBBER_ENV}"
db_slave_user: "#{('slave_' + db_user)[0,16]}"
db_replicator_user: "#{('replicator_' + db_user)[0,16]}"
@edeleflie
edeleflie / gist:1005794
Created June 3, 2011 03:06
remote rubber-mysql.yml
# REQUIRED: The credentials for creating/accessong your app's database
#
db_user: "#{app_name[0,16]}"
db_pass:
db_name: "#{app_name}_#{RUBBER_ENV}"
db_slave_user: "#{('slave_' + db_user)[0,16]}"
db_replicator_user: "#{('replicator_' + db_user)[0,16]}"
# REQUIRED: The command to use to do a full backup of your database using
@edeleflie
edeleflie / gist:1110992
Created July 28, 2011 04:59
SuperCollider example 1
(
p = Pbind(
[\degree, \dur],
Pseq([[0, 0.1], [2, 0.1], [3, 0.1], [4, 0.1], [5, 1]], 1),
\amp, 0.08,
\octave, 6,
\instrument, \cfstring1
);
)
@edeleflie
edeleflie / gist:1111004
Created July 28, 2011 05:10
Synth required for SuperCollider example 1
(
SynthDef(\cfstring1.postln, { arg i_out, freq = 360, gate = 1, pan, amp=0.1;
var out, eg, fc, osc, a, b, w;
fc = LinExp.kr(LFNoise1.kr(Rand(0.25, 0.4)), -1, 1, 500, 2000);
osc = Mix.fill(8, {LFSaw.ar(freq * [Rand(0.99, 1.01), Rand(0.99, 1.01)], 0, amp) }).distort * 0.2;
eg = EnvGen.kr(Env.asr(1, 1, 1), gate, doneAction:2);
out = eg * RLPF.ar(osc, fc, 0.1);
#a, b = out;
Out.ar(i_out, Mix.ar(PanAz.ar(4, [a, b], [pan, pan+0.3])));
}).store;
@edeleflie
edeleflie / gist:1111460
Created July 28, 2011 12:36
SuperCollider Example 2
// This SynthDef does Granular Synthesis
(
SynthDef(\granularish, {arg speed = 1, sndbuf ;
var b = 10, trate, dur, clk, pos, pan;
trate = MouseY.kr(8,120,1);
dur = 12 / trate;
clk = Impulse.kr(trate);
pos = MouseX.kr(0,BufDur.kr(b)) + TRand.kr(0, 0.01, clk);
pan = WhiteNoise.kr(0.6);
@edeleflie
edeleflie / gist:1138857
Created August 11, 2011 03:34
The LoopSound synth
(
SynthDef("LoopSound", { arg out = 0, soundFile, speed = 1, triggerEvery = 1, startPos = 0, vol = 1, duration = 1;
var signal = GrainBuf.ar(1,
Impulse.kr(1 / triggerEvery), // trigger rate
duration, // duration
soundFile, // must be pre-loaded
speed, // or speed
startPos, // where to start playing
4);
@edeleflie
edeleflie / gist:1138863
Created August 11, 2011 03:39
auditory_s_s synth
(
SynthDef("auditory_s_s", { arg in, out, // input sound, output sound
mix = 0.5, room = 0.1, damp = 0.5, // reverb params (all between 0 and 1)
hp_cutoff_freq = 10, // hi pass params (anything)
lp_cutoff_freq = 40000, // low pass params (anything)
pan = 0; // pan left or right (-1 to 1)
var reverbed, lo_passed, hi_passed, panned;
hi_passed = HPF.ar(In.ar(in), hp_cutoff_freq); // this line applies the Hi pass
@edeleflie
edeleflie / gist:1153861
Created August 18, 2011 11:15
auditory_s_s synth (now with stereo width)
(
SynthDef("auditory_s_s", { arg in, out, // input sound, output sound
mix = 0.5, room = 0.1, damp = 0.5, // reverb params (all between 0 and 1)
hp_cutoff_freq = 10, // hi pass params (anything)
lp_cutoff_freq = 40000, // low pass params (anything)
pan = 0, // pan left or right (-1 to 1)
stereoWidthVol = 0, // 0 - 1 (try 0.7)
stereoWidthAmount = 0.0; // 0.0001 - 0.1 (try 0.002) (time delay between 2 channels)
var reverbed, lo_passed, hi_passed, panned1, panned2;
@edeleflie
edeleflie / gist:1153864
Created August 18, 2011 11:17
playing 2 synths together
// Use this file as a template for Assignment 1
//
// Vimeo tutorial of everything: http://vimeo.com/user2299201
// Synthesiser definitions
// LoopSound: https://gist.github.com/1138857
// Auditory_s_s: https://gist.github.com/1153861
//
// This file: https://gist.github.com/1153864
//
// To get everything playing, all you need to do is hit 'enter' once for each line
@edeleflie
edeleflie / gist:1187688
Created September 2, 2011 00:47
Xenakish
(
SynthDef("Xenakish", { arg out = 0, soundFile, t_ramp = 0,
triggerGrainEvery = 1, // how often to trigger the grains. Start with 0.05 (every 50 msec).
goTo = 0, // position in file 0 to 1.
goIn = 0, // time to get to the position (in seconds).
randomPosSpread = 0, // random spread in seconds. Start with 0.01.
grainLength = 1, // length of grain in seconds. typically 10-50msec. Start with 0.05 (50 msec).
speed = 1, // how fast to play the grain. Affects pitch.
vol = 1; // volume.