Skip to content

Instantly share code, notes, and snippets.

@brapse
Created January 30, 2009 06:11
Show Gist options
  • Save brapse/54953 to your computer and use it in GitHub Desktop.
Save brapse/54953 to your computer and use it in GitHub Desktop.
/* Set of controls for creating the composition */
s.boot;
s.freqscope;
Synth.new(\chelled, [\freq, 200, \duration, 1]);
Synth.new(\chord, [\freq, 920, \fm, 480]);
Synth.new(\ground, [\freq, (200..2000).choose]);
Synth.new(\ground, [\freq, 1500]);
//Chelled
/* Amplitude works,
Keeping the durations sequentials makes it sound rythmic,
Octave: 8, sounds like flute but requires more amplitutde
Lower octaves sounds rumbly and are really loud!
*/
x = EventPatternProxy.new;
(
x.source = Pbind(\instrument, \chelled,
\degree, Pseq([1,0,0,2,4,5, 0, 0] * 1,inf), //Pxrand([1,1,5,3,3] * 0.9,inf),
\root, 1,
\dur, Pseq([1,1,2,2,4] * 0.2,inf),
\octave, 4,
\band, 0,
\length, 1,
\amp, 0.05)
)
x.stop;
x.play;
// Ground,
// With long lengths, becomes a slowly evolving
e = EventPatternProxy.new;
(
e.source = Pbind(
[\degree, \dur], Pseq([
Pseq([[0,0.1],[2,0.1],[3,0.1],[4,0.1],[5,0.8]],2),
Ptuple([Pxrand([1,3,2,5],4), 0.4]),
Ptuple([Pseq([9,8,7,6,5,4,3,2]), 0.2])
],inf),
\amp, 0.01,\root, 1,\length, 8,
\octave, 1, \instrument, \ground, \mtranspose, 0)
)
e.stop;
e.play;
/******** *******/
/* DON'T TOUCH */
/****************/
// Chord
y = EventPatternProxy.new;
(
y.source = Pbind(\instrument, \chord,
\degree, Pseq([1,1,9,1,7] * 1,inf),
\root, 3,
\octave, 7,
\dur, Pseq([1,1,2,2,4] * 0.2,inf),
\fm, 400,
\amp, 0.1)
)
y.stop;
y.play;
/* Set of SuperCollider Instruments used for composition */
// Harmonics resonate
(
SynthDef(\chelled, {arg freq=15, amp=0.1, duration=4,length=1,rez=1, band=440, gate=1;
Out.ar(0,
Mix.new(
RLPF.ar(SinOsc.ar(Array.fill(17, {|x| freq + (x+1) *rez //base frequency
}) , 0, amp/8), band) *
EnvGen.kr(Env.new([0.1, 1,0.5, 0.8, 0.01 ], [0.1, 0.02, 0.02, 1], 'exponential'), timeScale: duration, doneAction: 2)
)
);
}).store;
)
(
SynthDef(\chord, {|out=0,dur=1,freq=440,pan=1,amp=1,harms=5,fm=1800|
var fm_env = Env.new([0.01, 0.4,0.001 ], [0.2,0.5], 'linear');
var partials = Array.fill(5, {|it|
//CombC.ar(
SinOsc.ar(freq * (1+it) + // base frequency
0,//(VarSaw.ar(fm, 0, 40)),
0, amp/(1+it)) * //phase and amplitude
EnvGen.kr(fm_env, timeScale: dur, levelScale: 1/(1..5), doneAction: 2);
// ,0.2, 0.2)
});
Out.ar(0,Mix.new(partials));
}).store;
)
(
SynthDef(\ground, {arg out,pan=1, freq=320, multi=1, length=1, amp=0.1, band=1500;
var series = Array.fill(1, {|i| (i + freq) * multi});
Out.ar(0,
Pan2.ar(
Mix.new(
RLPF.ar(SinOsc.ar(series, 0, amp/1), band)), pan) *
EnvGen.kr(Env.new([0.001, 1, 3, 0.9, 0.001], [0.2, 0.2, 0.2, 0.2], 'exponential'), timeScale:length, doneAction: 2)
);
}).store;
)
(
SynthDef(\acid, { arg out, freq = 1000, gate = 1, pan = 1, cut = 4000, rez = 0.8, amp = 1;
Out.ar(out,
Pan2.ar( RLPF.ar( Pulse.ar(freq,0.05), cut, rez),
pan) * EnvGen.kr(Env.linen(0.01, 1, 0.3), gate, amp, doneAction:2);
)
}).store;
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment