Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (
- SynthDef(\test, {
- arg t_trig = 1,
- freq = 200,
- gain = 0.5,
- amp = 1,
- pan = 0,
- totalDecay = 0.25;
- var decay = 0.25 * totalDecay;
- var noiseEnv = EnvGen.ar(Env.perc(0.01, decay, gain, -5), t_trig);
- var ringDecay = decay * 2;
- var ampEnv = EnvGen.ar(Env.asr(releaseTime: ringDecay), t_trig, doneAction: 2);
- var noise = PinkNoise.ar(noiseEnv);
- var resFreqs = [freq, freq+500, freq+600, freq+1000];
- var resAmps = [5, 1, 1, 1].normalizeSum * 0.095;
- var resRings = [ringDecay, ringDecay * 0.75, ringDecay * 0.5, ringDecay * 0.6];
- var klank = DynKlank.ar(`[
- resFreqs,
- resAmps,
- resRings
- ], noise);
- var out = Pan2.ar(klank, pan, amp);
- Out.ar(0, out);
- }).add;
- SynthDef(\kick, {
- arg t_trig = 1,
- freq = 40,
- punch = 0.05,
- decay = 0.45,
- amp = 0.5;
- var env = EnvGen.kr(Env.perc(0.01, decay), t_trig, doneAction: 2);
- var freqenv = EnvGen.kr(Env.perc(0.01, punch));
- var synth = SinOsc.ar(freq + (freqenv * 200), 0, env);
- Out.ar([0,1], synth * amp);
- }).add;
- )
- (
- Pdef(\testPatt, {
- Pbind(
- \instrument, \test,
- \degree, Pwrand(#[-6, -3, -1, 0, 4], #[10, 6, 3, 3, 10].normalizeSum, inf),
- \scale, Scale.at('minor'),
- \trig, 1,
- \amp, 0.3,
- \decay, Pwrand(
- #[0.25, 0.5, 0.75, 1, 1.5],
- #[5, 4, 3, 2, 1].normalizeSum,
- inf
- ),
- \delta, Pwrand(
- #[0.5, 1, 1.5, 2],
- #[3, 3, 2, 1].normalizeSum,
- inf
- )
- );
- }).stop;
- )
- (
- Pdef(\kickPatt, {
- Pbind(
- \instrument, \kick,
- \freq, 40,
- \punch, 0.1,
- \amp, 0.4,
- \trig, 1,
- \delta, Prand(#[1, 1.5, 2], inf)
- );
- }).stop;
- )
- TempoClock.default.tempo = 132/30;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement