«THX Deep Note reconstruction» by nicolaariutti

on 26 Oct'19 16:22 in thxdeep note

So long i've been waiting to work on it and this is my attempt in recreating the iconic sound of THX logo using SC. I've tried to follow instructions from the score: https://pbs.twimg.com/media/DeD9P3aVQAMSIF2.jpg:large

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
(
s.waitForBoot({

	SynthDef(\voice, {
		|
		freq=440, time=5, pan=0.0
		gate=0, atk=1, rls=5, sus=0.7,
		detune=0, width=0.5, amp=0.0, amptime=5,
		ampFreqRel = 1.0,
		out=0, bus=0, fxsend=0.0
		|
		var env, sig;
		env = EnvGen.ar(Env.asr(atk, sus, rls), gate, doneAction:2);
		freq = VarLag.kr(freq, time, warp:\exponential);
		sig = VarSaw.ar([freq, freq+detune, freq-detune], width:width);
		amp = VarLag.kr(amp, amptime, warp:\exponential);
		sig = Mix.ar(sig) * env * amp * ampFreqRel;
		Out.ar(out, Pan2.ar(sig, pan));
		Out.ar(bus, Pan2.ar(sig, pan));
	}).add;

	// a reverb by Eli Fieldsteel
	SynthDef(\reverb, {
		arg in=0, out=0, dec=4, lpf=1500, amp=0.1;
		var sig;
		sig = In.ar(in, 2).sum * amp;

		sig = DelayN.ar(sig, 0.03, 0.03);
		sig = CombN.ar(sig, 0.1, {Rand(0.01,0.099)}!32, dec);
		sig = SplayAz.ar(2, sig);
		sig = LPF.ar(sig, lpf);
		5.do{sig = AllpassN.ar(sig, 0.1, {Rand(0.01,0.099)}!2, 3)};
		sig = LPF.ar(sig, lpf);
		sig = LeakDC.ar(sig);

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

	s.sync;
	~verbBus = Bus.audio(s, 2);

	s.sync;

	~rev = Synth(\reverb, [\in, ~verbBus, \out, 0]);

	~notes = [26,38,45,50,57,62,69,74,81,86,90];
	~synths = [];
	~notes.size.do({
		|item, i|
		// normalized index
		var nIndex  = i/~notes.size;
		//inverse normalized index
		var inIndex = (~notes.size - i)/~notes.size;
		~synths = ~synths ++ Synth(\voice,
		[
			\gate, 0,
			\atk, 3,
			\sus, 0.08,
			\detune, 0.001,
			\width, 0.1,
			\pan, 0.0 + rrand(-0.3, 0.3) * nIndex,
			\amp, 0.1,
			\ampFreqRel, inIndex,
			\out, 0,
			\bus, ~verbBus,
			\fxsend, 0.0
		]);
	});

	~incipit = Routine({
		~synths.do({
			|item|
			item.set(\gate, 1, \amp, 0.3, \amptime, 8);
		});
		{
			var time = rrand(0.5,2);
			~synths.do({
				|item|
				item.set(\freq, rrand(200, 400.0), \time, time);
			});
			wait(time);
		}.loop;
	});

	~move = Routine({
		~synths.do({
			|item, i|
			item.set(\freq, ~notes[i].midicps, \time, 8, \amp,0.7, \amptime, 8);
		});
	});

	~finish = Routine({
		~synths.do({
			|item, i|
			item.set(\rls, 1, \gate, 0);
		});
	});
});
)

(
~playMe = Routine({
	~incipit.reset;
	~incipit.play;
	8.wait;
	~incipit.stop;
	~move.reset;
	~move.play;
	16.wait;
	~finish.play;
}).play;
)
raw 2309 chars (focus & ctrl+a+c to copy)
reception
comments
grahamsw user 13 Nov'22 05:01

this is magnificent!