«FM7 Patch» by david_morgan

on 06 Dec'17 10:46 in fmfrequency modulation
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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
/**
Requires:

SuperCollider v3.8.0+

FM7 (sc3 plugins)

Feedback Quark

To run evaluate each of the numbered blocks
**/

////////////////////
// 1
TempoClock.default.tempo_(60/60);

////////////////////
// 2
(
~fm4 = NodeProxy.audio;
~fm4.quant = 1.0;
)

////////////////////
// 3
(~fm4[0] = {

	var freq = Vibrato.ar( K2A.ar(\freq.kr(432).lag(\lag.kr(0.0))),
		\vrate.kr(6),
		\vdepth.kr(0.02),
		\vdelay.kr(0),
		\vonset.kr(0),
		\vrateVar.kr(0.04),
		\vdepthVar.kr(0.1)
	);

	var sig = {

		var dur = \dur.kr(1);

		var trig = \trig.tr(0);

		var trig2 = \trig2.tr(0);

		var ctrls = [
			[freq,        0,1],
			[freq * 4.01, 0,1],
			[freq * 1.0,  0,1],

			[freq * 2.0,  0,1],
			[freq * 3.1,  0,1],
			[freq * 2.0,  0,1]
		];

		var env1 = Env([1, 1, 0.001], [0, dur], -4).kr(gate:trig2);

		var mods = [
			[0, env1, 0,       0, 0,        0],
			[0, 0,    1,       0, 0,        0],
			[0, 0,    0,       0, 0,        0],
			[0, 0,    0,       0, env1,     0],
			[0, 0,    0,       0, 0,        1],
			[0, 0,    0,       0, 0,        0.6]
		];

		var sig = FM7.ar(ctrls, mods).slice([0,3]);
		var env = Env.linen(\atk.kr(0.01), \sus.kr(0), \rel.kr(1), curve:\curve.kr(-4)).kr(gate:trig);

		sig = sig * env;
	};

	Splay.ar(sig.()) * \amp.kr(0.1) * AmpCompA.kr(freq);
})

////////////////////
// 4
(~fm4[8] = \set -> Pbind(

	\delta, 0.125,

	\vrate, 6,
	\vdepth, 0.001,
	\lag, 0.01,

	\degree, Pseq([
		Ppatlace([ Pseq([0,5], inf), Pwhite(1,4) ], 14),
		Pseq([8,7,6,5,4,3,2,1], 1)
	], inf),
	\scale, Scale.ritusen,
	\octave, Prand([4,5], inf),
	\ctranspose, Pstutter(16, Pseq([0, 2], inf))
));

////////////////////
// 5
(~fm4[10] = \set -> Pbind(

	\trig, 1,
	\delta, 1,
	\beatDur, Pfunc({thisThread.clock.beatDur}),
	\dur, Pkey(\beatDur) * Pkey(\delta) * 0.4,

	\env, #[0.01, 1, 1].normalizeSum,
	\sus, Pkey(\dur) * Pfunc({arg evt; evt[\env][1] }),
	\rel, Pkey(\dur) * Pfunc({arg evt; evt[\env][2] }),
	\curve, -4
));

////////////////////
// 6
(~fm4[12] = \set -> Pbind(

	\trig2, 1,
	\delta, Prand([1,3], inf)
));

////////////////////
// 7
(~fm4[16] = \filter -> {arg in;
	var sig = FbC({arg fb; fb * 0.3 + in;}, 1.5/4);
	var sig2 = FbC({arg fb; fb * 0.4 + in;}, 4.5/4);
	sig + sig2;
});

////////////////////
// 8
(~fm4[17] = \filter -> {arg in;
	var sig = BLowPass.ar(in, SinOsc.kr(1/16).range(523,4186), 0.7);
	sig;
});

////////////////////
// 9
(~fm4[18] = \filter -> {arg in; GVerb.ar(in, 50); });

////////////////////
// 10
~fm4.set(\wet16, 0.4, \wet18, 0.3);

////////////////////
// 11
~fm4.play(fadeTime:4);

////////////////////
// stop
~fm4.stop(fadeTime:8);
raw 2729 chars (focus & ctrl+a+c to copy)
reception
comments
Exiik user 27 Dec'17 17:24

Excellent!!