«control patterns via control bus» by Luka P.

on 02 Aug'20 21:01 in acidcontrol bussespattern control

a learning example where you can control patterns with running ugens via control bus. acid-like.

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
(
SynthDef(\acid, { arg out, freq = 1000, gate = 1, pan = 1, cut = 4000, rez = 0.8, amp = 1, sustain = 1, release = 0.5;
    var sig, env;
	env = EnvGen.kr(Env.linen(0.01, sustain, sustain * release), gate, amp, doneAction: Done.freeSelf);
	sig = Pulse.ar([freq,freq*1.001], 0.5);
	sig = sig + Pulse.ar(freq*0.501, 0.01, [0,0.5]);
	sig = sig + Pulse.ar(freq*1.99, 0.11, [0.5,0]);
	sig = RLPF.ar(sig, cut, rez);
	sig = Pan2.ar(sig);
	sig = sig * env;

	Out.ar(out, sig);
}).add;
)


~bus = Bus.control(s,1);
~bus2 = Bus.control(s,1);

(
~lfo1 = SynthDef(\lfo1, {
	arg fmin=200, fmax=2000;
	Out.kr(~bus, SinOsc.kr(0.1).range(fmin,fmax))
}).play;

~lfo2 = SynthDef(\lfo2, {
	arg fmin=1, fmax=3;
	Out.kr(~bus2, SinOsc.ar(0.05).range(fmin,fmax))
}).play;


Pbind(\instrument, \acid,

	\note, Pfunc{~bus2.getSynchronous * 2}, // !!
    \cut, Pfunc{ ~bus.getSynchronous }, // !!

	\dur, Pseq([0.08, 0.2, 0.1, 0.03, 0.08, 0.2, 0.12], inf),
	
	// uncomment for an extreme example:
	//\dur, Pfunc{ ~bus2.getSynchronous.linlin(1,3,5,1) * 0.035 },
	\legato, 0.3,
	\release, 2,
	\root, -30,
	\pan, Pfunc({0.5.rand2}),
	\rez, Pfunc({0.7.rand +0.3}),
	\amp, 0.2).play;
)

// now you can change some parameters of the LFOs in the control busses
~lfo1.set(\fmax, 800)
~lfo1.set(\fmin, 90)

~lfo2.set(\fmax, 3)
~lfo2.set(\fmin, 1)
raw 1365 chars (focus & ctrl+a+c to copy)
reception
comments