«Fm7_moog_1» by Roberto Arletti

on 06 Jan'19 07:00 in
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
(
SynthDef(\fm7_moog_1,
{
    arg  note = 60,out_bus=0,amp=0.5,sustain = 0.5,release = 0.5,cutoff = 10000,rq = 1,pan = 0,lfo_speed = 5,lfo_amp = 0;
	var ctls, mods, chans,out,pitch,gate,
        coars1= 1 ,fine_1= 1.995 ,detun1= 39 ,noteBlok1= 0 ,
		coars2= 0.5 ,fine_2= 1.0 ,detun2= 14 ,noteBlok2= 1 ,
		coars3= 1 ,fine_3= 1.047 ,detun3= 39 ,noteBlok3= 0 ,
		coars4= 0.5 ,fine_4= 1.0 ,detun4= 1 ,noteBlok4= 1 ,
		coars5= 0.5 ,fine_5= 1.0 ,detun5= 14 ,noteBlok5= 1 ,
		coars6= 2 ,fine_6= 1.0 ,detun6= 1 ,noteBlok6= 1 ,
        envAmp1,envAmp2,envAmp3,envAmp4,envAmp5,envAmp6,env1,
		envEnv1,envEnv2,envEnv3,envEnv4,envEnv5,envEnv6,envAmp,envEnv,lfo;
        gate = Trig1.kr(1, sustain);
		envEnv1 = Env.new([0.0002 ,1.0 ,1.0 ,1.0 ,0.0002], [0.0309 ,0.0 ,0.0 ,3.2796], [3.0 ,-3.0 ,-3.0 ,-3.0],3);
		envAmp1 = EnvGen.kr(envEnv1,gate,doneAction: 0);
		envEnv2 = Env.new([0.0001 ,0.2296 ,0.3535 ,0.2296 ,0.0001], [0.0836 ,0.185 ,3.9328 ,5.4112], [3.0 ,3.0 ,-3.0 ,-3.0],3);
		envAmp2 = EnvGen.kr(envEnv2,gate,doneAction: 0);
		envEnv3 = Env.new([0.0002 ,1.0 ,0.8414 ,0.6494 ,0.0002], [0.0348 ,0.0632 ,0.4163 ,2.8341], [3.0 ,-3.0 ,-3.0 ,-3.0],3);
		envAmp3 = EnvGen.kr(envEnv3,gate,doneAction: 0);
		envEnv4 = Env.new([0.0 ,0.1059 ,0.2304 ,0.1496 ,0.0], [0.008 ,0.2794 ,1.8094 ,3.7047], [3.0 ,3.0 ,-3.0 ,-3.0],3);
		envAmp4 = EnvGen.kr(envEnv4,gate,doneAction: 0);
		envEnv5 = Env.new([0.0 ,0.0244 ,0.0531 ,0.0376 ,0.0], [0.0045 ,0.1397 ,1.8094 ,2.7788], [3.0 ,3.0 ,-3.0 ,-3.0],3);
		envAmp5 = EnvGen.kr(envEnv5,gate,doneAction: 0);
		envEnv6 = Env.new([0.0002 ,0.4597 ,1.0 ,0.6494 ,0.0002], [0.0136 ,0.6447 ,1.8094 ,9.5991], [3.0 ,3.0 ,-3.0 ,-3.0],3);
		envAmp6 = EnvGen.kr(envEnv6,gate,doneAction: 0);
        envEnv = Env.new([0,1,1,0], [0.0001,sustain,release],[0,0,0]);
		envAmp = EnvGen.kr(envEnv,gate,doneAction:2);
		lfo = LFTri.kr(lfo_speed);
		lfo = LinLin.ar(lfo, 0, 1, lfo_amp.neg.midiratio  , lfo_amp.midiratio);
        pitch = note.midicps;

   ctls = [
			[coars1 * fine_1 * ((pitch * noteBlok1) + ((detun1-7)/32))* lfo, 0, envAmp1],

		    [coars2 * fine_2 * ((pitch * noteBlok2) + ((detun2-7)/32))* lfo , 0, envAmp2],

		    [coars3 * fine_3 * ((pitch * noteBlok3) + ((detun3-7)/32))* lfo , 0, envAmp3],

		    [coars4 * fine_4 * ((pitch * noteBlok4) + ((detun4-7)/32))* lfo , 0, envAmp4],

		    [coars5 * fine_5 * ((pitch * noteBlok5) + ((detun5-7)/32))* lfo , 0, envAmp5],

		    [coars6 * fine_6 * ((pitch * noteBlok6) + ((detun6-7)/32))* lfo, 0, envAmp6]
	];

	mods = [
		[0, 12.5664, 0, 0, 0, 0],
		[0, 1.704, 0, 0, 0, 0],
		[0, 0, 0, 12.5664, 12.5664, 0],
		[0, 0, 0, 0, 0, 0],
		[0, 0, 0, 0, 0, 12.5664],
		[0, 0, 0, 0, 0, 0]
	];
	chans = [0, 1, 2, 3, 4, 5];
	out = FM7.ar(ctls, mods).slice(chans) * -12.dbamp;
	out = Mix.new([
		(out[0] * 1),
		(out[1] * 0),
		(out[2] * 1),
		(out[3] * 0),
		(out[4] * 0),
		(out[5] * 0),
	]);
	out = RLPF.ar(out,cutoff,rq);
	Out.ar(out_bus,Pan2.ar(out,pan,amp));
}).add;
)

Synth(\fm7_moog_1,[\sustain,3,\release,3,\amp,0.5,\lfo_speed,5,\lfo_amp,0.05]);

(
u = ((
Pdef(\ss,
		Pbind(
			\instrument, \fm7_moog_1,
			\note,Prand(#[[0,  -5], [0,  -7], [0,  -3], [0,  4]], inf) + Pxrand(#[48,50,52,53,55,57,59,60,62,64,65,67,69],inf),
			\amp,0.25,
			\cutoff,Pwhite(300,5000,inf),
			\rq,0.15,
            \sustain,4,
			\lfo_amp,0,
			\release,3,
			\pan,Pwhite(-0.8,0.8,inf),
			\dur,3

))).play;
)
)
u.stop;
raw 3452 chars (focus & ctrl+a+c to copy)
reception
comments