«ChannelStrip» by meunier.fabien

on 10 Nov'18 20:16 in feedbackmixerchannel strip

A channel strip and master bus SynthDef to create your own mixer, be carefull cause you can create feedback loops by feeding channel A into channel B and vice versa...(it's the aim here) Thank you to Batuhan Bozkurt for his sound inspired by Ikeda

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
/************************************************************************Mixer*******************************************************************/
(
~aux1 = Bus.audio(s, 2);
~aux2 = Bus.audio(s, 2);

SynthDef(\ChannelStrip, { arg in = 0, out = 0, pan = 0, hpfreq = 20, band1freq = 80, band1rq = 1, band1db = 0, band2freq = 1200, band2rq = 1, band2db = 0, band3freq = 8000, band3rq = 1, band3db = 0, lpfreq = 20000, mute = 1, auxsend1 = 0, auxsend2 = 0, level = 0.5;
	var input, sig;
	input = InFeedback.ar(in, 2);
	sig = BHiPass.ar(input, Lag2.kr(hpfreq.max(20).min(20000), 0.5)); // HPF
	sig = BPeakEQ.ar(sig, Lag2.kr(band1freq.max(20).min(20000), 0.5), band1rq, band1db); // Band 1
	sig = BPeakEQ.ar(sig, Lag2.kr(band2freq.max(20).min(20000), 0.5), band2rq, band2db); // Band 2
	sig = BPeakEQ.ar(sig, Lag2.kr(band3freq.max(20).min(20000), 0.5), band3rq, band3db); // Band 3
	sig = BLowPass.ar(sig, Lag2.kr(lpfreq.max(20).min(20000), 0.5)); // LPF
	Out.ar(~aux1, sig * auxsend1); //aux 1 pre fader / pre mute / post eq
	Out.ar(~aux2, sig * auxsend2); //aux 2 pre fader / pre mute / post eq
        sig = sig * mute;
	Out.ar(out, Balance2.ar(sig[0], sig[1], pan, level.curvelin(0, 1, 0, 1, log(10))));
}).add;

SynthDef(\MasterStrip, { arg in = 0, out = 0, hpfreq = 20, lpfreq = 20000, level = 0.5;
	var input, sig;
	input = In.ar(in, 2);
	sig = BHiPass.ar(input, Lag2.kr(hpfreq.max(20).min(20000), 0.5)); // HPF
	sig = BLowPass.ar(sig, Lag2.kr(lpfreq.max(20).min(20000), 0.5)); // LPF
	Out.ar(out, sig * level.curvelin(0, 1, 0, 1, log(10)));
}).add;

/**********************************************************************Sounds & Fx***************************************************************/

SynthDef(\IkedaClick, { arg out = 0, t_trig = 0, centerFreq = 15000, rq = 0.9, amp = 25, pan = 0, level = 1;
	var env, noise, sig;
	env = EnvGen.ar(Env.perc(0.001, 0.00001 * LFNoise1.kr(4).abs, 1, -4), t_trig, doneAction: 0);
	noise = PinkNoise.ar(env);
	sig = BPF.ar(noise, centerFreq.max(1), rq, amp).fold(-1, 1);
	Out.ar(out, Pan2.ar(sig, pan, level.curvelin(0, 1, 0, 1, log(10))));
}).add;

SynthDef(\IkedaBass, { arg out = 0, t_trig = 0, pan = 0, level = 1;
	var env, sin, sig;
	env = EnvGen.ar(Env([0, 0.5, 0.4, 0], [0, 0.2, 0.01], -5), t_trig, doneAction: 0);
	sin = SinOsc.ar(0, (Sweep.ar(t_trig, 2pi * [52.8, 740]) + (pi/3)).wrap(-pi, pi), [2, 0.05]).mean.tanh;
	sig = sin * env;
	Out.ar(out, Pan2.ar(sig, pan, level.curvelin(0, 1, 0, 1, log(10))));
}).add;

SynthDef(\Reverb, {arg in = 0, out = 0, predelaytime = 0.048, decaytimec = 5, decaytimea = 1, drywet = 0.5, level = 0.2;
	var input, numc, numa, temp;
	input = In.ar(in, 2);
	numc = 4; // number of comb delays
	numa = 6; // number of allpass delays
	temp = DelayN.ar(input, 0.1, predelaytime);
	temp = Mix.fill(numc, { CombL.ar(temp, 0.1, rrand(0.01, 0.1), decaytimec) });
	numa.do({ temp = AllpassN.ar(temp, 0.051, [rrand(0.01, 0.05), rrand(0.01, 0.05)], decaytimea) });
	XOut.ar(out, drywet, temp * level.curvelin(0, 1, 0, 1, log(10)));
}).add;

SynthDef(\SimpleDelay, { arg in = 0, out = 0, delaytime = 0.1;
	var input, effect;
	input = In.ar(in, 2);
	effect = DelayN.ar(input, 1, delaytime);
	ReplaceOut.ar(out, effect); // overwriting previous data on the corresponding bus
}).add;
)
/**********************************************************************Routing*******************************************************************/
(
var channels, masterBus;

masterBus = Bus.audio(s, 2);
~masterBus = Synth(\MasterStrip, [\in, masterBus], addAction: 'addToTail');

channels = Array.newClear(4); // number of channels
channels.size.do {
	arg i;
	channels[i] = Bus.audio(s, 2);
	currentEnvironment.put((\channel ++ i).asSymbol, Synth(\ChannelStrip, [\in, channels[i], \out, masterBus]));
};

~ikedaClick = Synth(\IkedaClick, [\out, channels[0]]);
~ikedaBass = Synth(\IkedaBass, [\out, channels[1]]);
~reverb = Synth(\Reverb, [\in, ~aux1, \out, channels[2]], ~masterBus, 'addBefore');
~simpleDelay = Synth(\SimpleDelay, [\in, ~aux2, \out, channels[3]], ~masterBus, 'addBefore');
)

/**********************************************************************Actions*******************************************************************/

// Synth actions
~ikedaClick.set(\t_trig, 1, \level, 0.2);
~ikedaBass.set(\t_trig, 1);

// Mixer actions
// Channel 0 = Click
~channel0.set(\auxsend1, 0.9); // aux 1 => Reverb
~channel0.set(\auxsend1, 0);

~channel0.set(\auxsend2, 0.8); // aux 2 => Delay
~channel0.set(\auxsend2, 0);

// Channel 1 = Bass
~channel1.set(\auxsend1, 1); // aux 1 => Reverb
~channel1.set(\auxsend1, 0);

~channel1.set(\auxsend2, 0.8); // aux 2 => Delay
~channel1.set(\auxsend2, 0);

// Channel 2 = Reverb
~channel2.set(\auxsend1, 0.08); // aux 1 => Reverb
~channel2.set(\auxsend1, 0);

~channel2.set(\auxsend2, 0.5); // aux 2 => Delay
~channel2.set(\auxsend2, 0);

// Channel 3 = Delay
~channel3.set(\auxsend1, 0.25); // aux 1 => Reverb
~channel3.set(\auxsend1, 0);

~channel3.set(\auxsend2, 0.5); // aux 2 => Delay
~channel3.set(\auxsend2, 0);

// Master
~masterBus.set(\hpfreq, 20, \lpfreq, 200);
~masterBus.set(\hpfreq, 20, \lpfreq, 20000);
raw 5242 chars (focus & ctrl+a+c to copy)
reception
comments