You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
scd/good padsynth.scd

92 lines
2.4 KiB
Plaintext

(
SynthDef(\boc_pad, {
arg freq = 210, amp = 0.1, att = 2, dec = 3, sus = 0.1, rel = 0, detune = -8,
lpfFreq = 800, rq = 0.3, revMix = 0.5, revSize = 20, revDamping = 0.5,
tremRate = 10, tremDepth = 0.8; // Tremolo parameters
var osc1, osc2, env, sig, filt, chorus, reverb, tremolo;
osc1 = SinOsc.ar(freq, 0.5);
osc2 = Saw.ar(freq * (1 + detune), 0.5);
sig = Mix([osc1, osc2]) * 0.5;
env = EnvGen.kr(Env.adsr(att, dec, sus, rel), doneAction: 2);
filt = RLPF.ar(sig, lpfFreq, rq);
chorus = CombL.ar(filt, 0.01, LFDNoise3.kr(2).range(0.005, 0.01), 0.3);
// Reverb
reverb = GVerb.ar(chorus, revSize, revDamping, mul: revMix);
// Tremolo (amplitude modulation)
tremolo = SinOsc.kr(tremRate).range(1 - tremDepth, 1);
Out.ar(0, reverb * tremolo * env * amp);
}).add;
)
(
Pbind(
\instrument, \boc_pad,
\freq, Pseq([
[60, 64, 67].midicps, // C major
[62, 65, 69].midicps, // D minor
[57, 60, 64].midicps, // A minor
[55, 59, 62].midicps // G major
], inf), // Infinite loop
\dur, 1, // Each chord lasts 2 beats
\amp, 0.1
).play;
)
(
Pbind(
\instrument, \boc_pad,
\freq, Pseq([
[40, 50, 59].midicps,
[62, 65, 67].midicps,
[50, 58, 64].midicps
], inf), // Infinite loop
\dur, 2, // Each chord lasts 2 beats
\amp, 0.008
).play;
)
(
SynthDef(\boc_pad, {
arg freq = 210, amp = 0.1, att = 0.3, dec = 0.3, sus = 0.1, rel = 0, detune = 0.1,
lpfFreq = 2000, rq = 2, revMix = 0.5, revSize = 20, revDamping = 0.5,
tremRate = 3, tremDepth = 0.1; // Tremolo parameters
var osc1, osc2, env, sig, filt, chorus, tremolo, panLeft, panRight;
// Generate two oscillators
osc1 = Pulse.ar(freq, 0.5);
osc2 = Pulse.ar(freq * (1 + detune), 0.5);
sig = Mix([osc1, osc2]) * 0.5;
env = EnvGen.kr(Env.adsr(att, dec, sus, rel), doneAction: 2);
// Lowpass filter
filt = LPF.ar(sig, lpfFreq, rq);
// Apply a chorus to create stereo width
chorus = CombL.ar(filt, 0.01, LFDNoise3.kr(1).range(0.008, 0.1), 0.3);
// Apply tremolo for amplitude modulation
tremolo = SinOsc.kr(tremRate).range(1 - tremDepth, 1);
// Split the signal into two channels and pan them
panLeft = chorus * tremolo * env * amp * 0.5; // Left channel
panRight = chorus * tremolo * env * amp * 0.5; // Right channel
// Slightly pan the signals to create a stereo image
Out.ar(0, [panLeft, panRight]); // Send to both left and right channels
}).add;
)