Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (
- SynthDef(\kick, { |out = 0, tune = 30, decay = 0.5, curve = -6, punch = 0.5, t_trig = 1, amp = 0.4|
- var env, source;
- env = EnvGen.kr(Env.perc(
- releaseTime: decay, curve: curve), t_trig, doneAction: 2);
- source = Mix.ar([
- SinOsc.ar(tune + (env * env * 150)),
- BPF.ar(LFPulse.ar(tune + (env * 100), 0, 0.2), 400, 0.6, 0);
- ]) * env;
- Out.ar(out, source * amp);
- }).add;
- SynthDef(\tom, { |out = 0, freq = 80, decay = 0.125, curve = -4, punch = 1, t_trig = 1, amp = 1|
- var env, source, klank, filt;
- env = EnvGen.kr(Env.perc(0.01, decay, curve: curve), t_trig, timeScale: 1, doneAction: 2);
- source = LFPulse.ar(freq + (env * 20));
- klank = DynKlank.ar(`[
- [200, 300, 400, 500],
- [0.01, 0.01, 0.01, 0.01],
- [0.25, 0.25, 0.25, 0.25]
- ], source);
- filt = HPF.ar(klank, 300) * env;
- Out.ar(out, filt * amp);
- }).add;
- SynthDef(\ch, { |out = 0, tune = 6000, decay = 0.05, curve = -2, pan = 0, t_trig = 1, amp = 0.3|
- var env, noise, output;
- env = EnvGen.kr(Env.perc(0.001, decay, curve: curve), t_trig, doneAction: 2);
- noise = WhiteNoise.ar;
- output = Mix.ar([BPF.ar(noise, tune /** env*/, 0.1) * 0.75, BPF.ar(noise, (tune * 2) /** env*/, 0.15)]) * env;
- Out.ar(out, Pan2.ar(output, pan, amp));
- }).add;
- SynthDef(\verb, { |out1 = 0, out2 = 1, in = 5|
- var verb;
- verb = FreeVerb.ar(In.ar(in, 1), 0.5, 0, 0.1);
- Out.ar([out1, out2], verb);
- }).add;
- )
- (
- SynthDef(\oh, {
- arg t_trig = 1, amp = 0.2;
- var env, noiseEnv, output, noise;
- env = EnvGen.kr(Env.new([0, 1, 1, 0], [0.001, 0.25, 0.01]), t_trig, doneAction: 2);
- noiseEnv = EnvGen.kr(Env.new([0, 1, 0], [0.001, /*CHANGE ME!:*/ 0.1]), t_trig);
- noise = BPF.ar(WhiteNoise.ar() * noiseEnv, 2000, 1);
- output = GVerb.ar(noise, 50, 10, 0, 0.2, 15, 1, 0.2, 0.6, 100);
- Out.ar(0, Pan2.ar(output, 0, amp * env));
- }).add;
- )
- Synth(\oh, [\trig, 1]);
- x = Synth(\kick);
- s.scope;
- s.scope;
- (
- Pdef(\tom,
- Pfx(
- Pbind(
- \instrument, \tom,
- \trig, 1,
- \delta, Pwrand(#[1, 0.75, 0.5, 0.25],[1,2,3,8].normalizeSum,inf),
- \decay, Prand(#[0.125, 0.25, 0.5], inf),
- // \freq, Prand(#[60, 80, 100], inf),
- \degree, Pxrand(#[9, 11, 7, 13], inf),
- \scale, Scale.minor,
- \curve, -4,
- \octave, 2,
- \out, 5,
- \amp, 0.5
- ), \verb
- )
- ).play;
- )
- s.scope
- (
- Pdef(\kick,
- Pbind(
- \instrument, \kick,
- \trig, 1,
- \delta, Pseq(#[1, 1, 0.75, 0.75, 0.5], inf),
- \out, [0, 1],
- \amp, 0.43
- )
- ).play;
- Pdef(\ch).play;
- )
- Pdef(\ch).stop;
- MIDIClient.init;
- MIDIIn.connectAll;
- MIDIFunc.trace;
- (
- MIDIdef.noteOn(\playkick, {
- if (Pdef(\kick).isPlaying,
- {Pdef(\kick).stop},
- {Pdef(\kick).play}
- )}, 20);
- MIDIdef.noteOn(\playch, {
- if (Pdef(\ch).isPlaying,
- {Pdef(\ch).stop},
- {Pdef(\ch).play}
- )}, 21);
- MIDIdef.noteOn(\playtom, {
- if (Pdef(\tom).isPlaying,
- {Pdef(\tom).stop},
- {Pdef(\tom).play}
- )}, 22);
- MIDIdef.cc(\kickamp, { |val|
- Pdef(\kick).set(\amp, val.linlin(0, 127, 0.0001, 1))
- }, 10);
- MIDIdef.cc(\champ, { |val|
- Pdef(\ch).set(\amp, val.linlin(0, 127, 0.0001, 1))
- }, 74);
- MIDIdef.cc(\tomamp, { |val|
- Pdef(\tom).set(\amp, val.linlin(0, 127, 0.0001, 1))
- }, 71);
- )
- (
- Pdef(\ch,
- Pbind(
- \instrument, \ch,
- \trig, Pseq([1,1,1,Rest], inf),
- \delta, Prand(#[0.25], inf),
- \out, [0, 1],
- \pan, Pfunc({0.5.rand2}),
- \amp, 0.2
- )
- ).play;
- )
- (
- Pdef(\oh,
- Pbind(
- \instrument, \oh,
- \trig, Pseq([Rest, Rest, Rest, 1], inf),
- \amp, 0.2,
- \delta, 0.5
- )
- ).play;
- )
- Synth(\temp__0).kill;
- {FreeVerb.ar(In.ar(0), [1, 1], 0.05, 0.6)}.play
- NdefMixer(s);
- p.play; q.play; h.play;
- TempoClock.default.tempo = 120/60;
Add Comment
Please, Sign In to add comment