Skip to content

Instantly share code, notes, and snippets.

@madskjeldgaard
Created January 14, 2019 19:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save madskjeldgaard/5804ec5f38669d6f4112ec2f27083855 to your computer and use it in GitHub Desktop.
Save madskjeldgaard/5804ec5f38669d6f4112ec2f27083855 to your computer and use it in GitHub Desktop.
SuperCollider Meetup Notam02.no
/*
Niklas example of dynamic patterns
*/
// See the packages installed and the ones on the "public list" (there are other packages out there, in the wild (aka. Github.com ))
Quarks.gui
// Like this one, install it via it's Github repository
Quarks.install("https://github.com/cappelnord/BenoitLib")
(
SynthDef(\hnuj, { | out, freq = 440, amp = 0.1, nharms = 10, pan = 0, gate = 1 |
var audio = Blip.ar(freq, nharms, amp);
var env = Linen.kr(gate, doneAction: Done.freeSelf);
OffsetOut.ar(out, Pan2.ar(audio, pan, env) );
}).add;
)
(
Pbind(
\instrument, \hnuj,
\freq, Pseq([666, 777, 888], inf),
\dur, Prand([1, 0.5, 0.25], inf)
).play
)
(
~p = ProxySpace.new(s);
~p[\lfoAmp] = {SinOsc.kr(5).abs};
~p[\lfoFreq] = {LFNoise0.kr(3.5).abs*100+1000};
~p[\lfoNharms] = {SinOsc.kr(0.3).abs};
~p[\lfoDur] = {LFSaw.kr(10).abs};
~p[\lfoPan] = {LFNoise1.kr(0.5)};
~pattern = Pbind(
\instrument, \hnuj,
\dur, Pkr(~p[\lfoDur])/10 + 0.125,
\pan, Pkr(~p[\lfoPan]),
\nharms, Pkr(~p[\lfoNharms]),
\freq, Pkr(~p[\lfoFreq]),
\amp, Pkr(~p[\lfoAmp])*0.2,
).play;
)
// eller direkt (PUSH) funker nu og her
(
p = ProxySpace.push(s);
// nodeproxies
~lfo1 = {SinOsc.kr(2.1).abs*0.5};
~lfo2 = {Saw.kr(11.1, 500, 100)};
~lfo3 = {LFNoise0.kr(0.2).abs*2};
~lfoPan = {LFNoise1.kr(0.5)};
~pattern = Pbind(
\instrument, \hnuj,
\pan, ~lfoPan,
\nharms, ~lfo3,
\freq, ~lfo2,
\amp, ~lfo1,
).play;
)
(
p = ProxySpace.push(s);
~lfo1 = {SinOsc.kr(0.1)};
~lfo2 = {Saw.kr(111.1, 100, 100)};
~lfo3 = {LFNoise0.kr(0.2).abs*2};
~lfoAmp = {LFNoise1.kr(0.5).abs};
~lfoPan = {LFNoise1.kr(0.5)};
~pattern = Pbind(
\instrument, \hnuj,
\pan, ~lfoPan,
\amp, Pkr(~lfoAmp)*0.2,
\freq, Pkr(~lfo2) * 10,
\nharms, ~lfo3,
\dur, 0.125 + (Pkr(~lfo1)/10)
).play;
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment