«Modulation sequencing» by grirgz

on 01 Sep'15 22:24 in patternmodulationsequencer

Two simple ways to set a different modulation per step in a pattern

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
(
SynthDef(\rlpf, { arg out=0, amp=0.1, gate=1, pan=0, spread=0.8, freq=200, doneAction=2, ffreq=4000, rq=0.3;
	var sig, sig1, sig2, sig3;
	sig = LFSaw.ar(freq * [1.01,1,0.99]);
	sig = RLPF.ar(sig, ffreq, rq);
	sig = sig * EnvGen.ar(\adsr.kr(Env.adsr(0.01,0.1,0.8,0.1)),gate,doneAction:doneAction);
	sig = Splay.ar(sig, spread, amp, pan);
	Out.ar(out, sig);
}).add;
);

///////// lfo communicating with main pattern

(
Ndef(\lfo1, {  EnvGen.kr(Env([1,4,1],[0.1,0.2]), \trig.tr(0)) * \lforange.kr(1000);  });

Pdef(\main, Pbind(
	\instrument, \rlpf,
	\midinote, Pseq([60, 62, 64], inf),
	\legato, 0.5,
	\move, Pseq([0,1,0, 1,0,0],inf),
	\lforange, Pseq([1000,2000,3000],inf).stutter(8),
	\ffreq, Pfunc({ arg ev;
		Ndef(\lfo1).set(\trig, ev[\move], \lforange, ev[\lforange]);
		Ndef(\lfo1);
	}),
	\dur, 0.5
)).play 
)

////// sub pattern way

(
	Pdef(\micro, { arg midinote, move;
		Pbind(
			\instrument, \rlpf,
			\midinote, midinote + 
				switch(move,
					\up, Pseq((0..7)),
					\down, Pseq((7..0)),
					Pseq(0!8),
				),
			\dur, 1/16,
		)
	});

	Pdef(\main,
		Pbind(
			\instrument, \micro,
			\move, Pseq([\n, \n, \up, \n, \n, \down],inf),
			\type, \phrase,
			\midinote, Pseq([60, 62, 64], inf),
			\dur, 1/2,
		)
	).play;
)

//////// same in mono

(
	Pdef(\micro, { arg midinote, move;
		Pmono(
			\rlpf,
			\midinote, midinote + 
				switch(move,
					\up, Pseq((0..7)),
					\down, Pseq((7..0)),
					Pseq(0!8),
				),
			\dur, 1/16,
		)
	});

	Pdef(\main,
		Pbind(
			\instrument, \micro,
			\move, Pseq([\n, \n, \up, \n, \n, \down],inf),
			\type, \phrase,
			\midinote, Pseq([60, 62, 64], inf),
			\dur, 1/2,
		)
	).play;
)
raw 1721 chars (focus & ctrl+a+c to copy)
reception
comments