«A Map To Everything [Disquiet0062-LifeOfSine]» by Schemawound

on 25 Mar'13 17:20 in sinedisquiet juntodisquietjunto

This week’s project involves making music from the basic building block of sound: the sine wave.

You will compose and record a piece of music using just three different sine waves, and nothing else — well, nothing else in terms of source material, but the waves can, after the piece has gotten underway, be transformed by any means you choose.

These are the steps:

Step 1: Devise which three sine waves you will employ. They should be different from each other in some evident way. Step 2: The track should open with just one of the sine waves. Step 3: Add the second sine wave at 5 seconds. Step 4: Add the third sine wave at 10 seconds. Step 5: Only at 15 seconds should you begin to in any way manipulate any of the source waves. Frequencies Used: 125Hz, 237Hz, 1012Hz

My Process: Coding up something quickly in Supercollider on lunch break and did final adjustments at home. I decided to see how much I could get out of the sound of just the three sines without any effects. The click is created by purposely cutting the waveform at non-zero crossings. Every other sound is made from adding or multiplying the three sines.

This is my 10th piece for the Disquiet Junto and the second piece I have created using only sine waves.

Blog post and audio about the piece: http://schemawound.com/post/45152975247/a-map-to-everything-disquiet0062-lifeofsine

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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
/*NOTE: I have not bothered to clean this code up after writing it. Don't take it as a good example ;) */
(
fork{
	var pat = ();

	SynthDef(\addOfSine, {
		|
		out = 0, gate = 1, amp = 1, doneHandlerLength = 10,
		freq0 = 125, phase0 = 0, amp0 = 1, attack0 = 0.1, decay0 = 0.1, sustain0 = 0.5, release0 = 0.3, pan0 = 0,
		freq1 = 237, phase1 = 0, amp1 = 1, attack1 = 0.1, decay1 = 0.1, sustain1 = 0.5, release1 = 0.3, pan1 = 0,
		freq2 = 1012, phase2 = 0, amp2 = 1, attack2 = 0.1, decay2 = 0.1, sustain2 = 0.5, release2 = 0.3, pan2 = 0
		|
		var doneHandler = Linen.kr(gate, 0, 1, doneHandlerLength, doneAction:5); //This guy is just here to handle the doneAction
		var sine = [//Div by 3 to avoid clipping
			Pan2.ar(SinOsc.ar(freq0, phase0 * 2pi, amp0) * EnvGen.ar(Env.adsr(attack0, decay0, sustain0, release0), gate), pan0) / 3,
			Pan2.ar(SinOsc.ar(freq1, phase0 * 2pi, amp1) * EnvGen.ar(Env.adsr(attack1, decay1, sustain1, release1), gate), pan1) / 3,
			Pan2.ar(SinOsc.ar(freq2, phase0 * 2pi, amp2) * EnvGen.ar(Env.adsr(attack2, decay2, sustain2, release2), gate), pan2) / 3,
		];
		var output = (sine[0] + sine[1] + sine[2]) * amp;
		Out.ar(out, output);
	}).add;

	SynthDef(\mulOfSine, {
		|
		out = 0, gate = 1, amp = 1, doneHandlerLength = 10,
		freq0 = 125, phase0 = 0, amp0 = 1, attack0 = 0.1, decay0 = 0.1, sustain0 = 0.5, release0 = 0.3, pan0 = 0,
		freq1 = 237, phase1 = 0, amp1 = 1, attack1 = 0.1, decay1 = 0.1, sustain1 = 0.5, release1 = 0.3, pan1 = 0,
		freq2 = 1012, phase2 = 0, amp2 = 1, attack2 = 0.1, decay2 = 0.1, sustain2 = 0.5, release2 = 0.3, pan2 = 0
		|
		var doneHandler = Linen.kr(gate, 0, 1, doneHandlerLength, doneAction:5); //This guy is just here to handle the doneAction
		var sine = [
			Pan2.ar(SinOsc.ar(freq0, phase0 * 2pi, amp0) * EnvGen.ar(Env.adsr(attack0, decay0, sustain0, release0), gate), pan0),
			Pan2.ar(SinOsc.ar(freq1, phase0 * 2pi, amp1) * EnvGen.ar(Env.adsr(attack1, decay1, sustain1, release1), gate), pan1),
			Pan2.ar(SinOsc.ar(freq2, phase0 * 2pi, amp2) * EnvGen.ar(Env.adsr(attack2, decay2, sustain2, release2), gate), pan2),
		];
		var output = sine[0] * sine[1] * sine[2] * amp;
		Out.ar(out, output);
	}).add;

	s.sync;

	pat.intro =
	Pseq([
		Pbind(*[
			instrument: \addOfSine,
			amp: 1,
			dur: Pn(5, 1),
			sustain: 4,
			amp0: 1, attack0: 4, decay0: 0, sustain0: 1, release0: 1,
			amp1: 0,
			amp2: 0
		]),
		Pbind(*[
			instrument: \addOfSine,
			amp: 1,
			dur: Pn(5, 1),
			sustain: 4,
			amp0: 1, attack0: 4, decay0: 0, sustain0: 1, release0: 1,
			amp1: 1, attack1: 4, decay1: 0, sustain1: 1, release1: 1,
			amp2: 0
		]),
		Pbind(*[
			instrument: \addOfSine,
			amp: 1,
			dur: Pn(5, 1),
			sustain: 4,
			amp0: 1, attack0: 4, decay0: 0, sustain0: 1, release0: 1,
			amp1: 1, attack1: 4, decay1: 0, sustain1: 1, release1: 1,
			amp2: 1, attack2: 4, decay2: 0, sustain2: 1, release2: 1,
		]),
	]);

	pat.intro2 =
	Pseq([
		Pbind(*[
			instrument: \addOfSine,
			amp: 1,
			dur: Pn(12.8 / 3, 1),
			sustain: 4,
			amp0: 1, attack0: 4, decay0: 0, sustain0: 1, release0: 1,
			amp1: 0,
			amp2: 0
		]),
		Pbind(*[
			instrument: \addOfSine,
			amp: 1,
			dur: Pn(12.8 / 3, 1),
			sustain: 4,
			amp0: 0,
			amp1: 1, attack1: 4, decay1: 0, sustain1: 1, release1: 1,
			amp2: 0
		]),
		Pbind(*[
			instrument: \addOfSine,
			amp: 1,
			dur: Pn(12.8 / 3, 1),
			sustain: 4,
			amp0: 0,
			amp1: 0,
			amp2: 1, attack2: 4, decay2: 0, sustain2: 1, release2: 1,
		]),
	]);

	pat.p0 = Pbind(*[
		instrument: \addOfSine,
		amp: 1,
		dur: Pseq([0.1], 16),
		sustain: Pkey(\dur),
		doneHandlerLength: 1,
		phase0: Pseq([0.2, 0, 0, 0], inf), amp0: 1, attack0: 0.001, decay0: 0.001, pan0: Pseq([-0.5, 0.5], inf),
		phase1: 0, amp1: 0, attack1: 0.1, release1: 0,
		phase2: 0, amp2: 0, attack2: 0,
	]);

	pat.p1 = Pbind(*[
		instrument: \addOfSine,
		amp: 1,
		dur: Pseq([0.1], 16),
		sustain: Pkey(\dur),
		doneHandlerLength: 3,
		phase0: Pseq([0.2, 0, 0, 0], inf), amp0: 1, attack0: 0.001, decay0: 0.001, pan0: Pseq([-1, 1], inf),
		phase1: Pseq([0.2, 0.2, 0, 0], inf), amp1: Pseq([1,0,0], inf), attack1: 0.01, release1: 0.001, pan1: Pseq([1, 1, -1, -1, 0, 0, 0, 0], inf),
		amp2: 0, phase2: 0, attack2: 0,
	]);

	pat.p2 = Pbind(*[
		instrument: \addOfSine,
		amp: 1,
		dur: Pseq([0.1], 16),
		sustain: Pkey(\dur),
		doneHandlerLength: 3,
		phase0: Pseq([0.2, 0, 0, 0], inf), amp0: 1, attack0: 0.001, decay0: 0.001, pan0: Pseq([-0.5, 0.5], inf),
		phase1: 0, amp1: 0, attack1: 0.01, release1: 0.001, pan1: Pseq([1, 1, -1, -1, 0, 0, 0, 0], inf),
		phase2: Pwhite(), amp2: 0.7, attack2: 0.001, release2: 0.001, decay2: Pseq([0.3, 0.1, 0.01, 0.01, 0.01], inf), sustain2: 0, pan2: Pseq([-1, 0, 1], inf)
	]);

	pat.p3 = Pbind(*[
		instrument: \addOfSine,
		amp: 1,
		dur: Pseq([0.1], 16),
		sustain: Pkey(\dur),
		doneHandlerLength: 3,
		phase0: Pseq([0.2, 0, 0, 0], inf), amp0: 1, attack0: 0.001, decay0: 0.001, pan0: Pseq([-1, 1], inf),
		phase1: Pseq([0.2, 0.2, 0, 0], inf), amp1: Pseq([1,0,0], inf), attack1: 0.01, release1: 0.001, pan1: Pseq([1, 1, -1, -1, 0, 0, 0, 0], inf),
		phase2: Pwhite(), amp2: 0.7, attack2: 0.01, release2: 0.01, decay2: Pseq([0.3, 0.1, 0.01, 0.01, 0.01], inf), sustain2: 0, pan2: Pseq([-1, 0, 1], inf)
	]);

	pat.p4 = Pbind(*[
		instrument: \addOfSine,
		amp: 1,
		dur: Pseq([0.17], 16),
		sustain: Pkey(\dur),
		doneHandlerLength: 0.4,
		phase0: Pseq([0.2, 0, 0, 0], inf), amp0: 1, attack0: 0, decay0: 0, pan0: Pseq([-1, 1], inf),
		phase1: Pseq([0.2, 0.2, 0, 0], inf), amp1: Pseq([1,0,0], inf), attack1: 0, release1: 0, pan1: Pseq([1, 1, -1, -1, 0, 0, 0, 0], inf),
		phase2: Pwhite(), amp2: 0.7, attack2: 0.17, release2: 0, decay2: Pseq([0.3, 0.1, 0.01, 0.01, 0.01], inf), sustain2: 0, pan2: Pseq([-1, 0, 1], inf)
	]);

	pat.p5 = Pbind(*[
		instrument: \addOfSine,
		amp: Pseq([Pn(1,64), Pn(0, 64)], 4),
		dur: 0.05,
		sustain: Pkey(\dur),
		doneHandlerLength: 0.4,
		phase0: 0, amp0: 0.25, attack0: 0.05, decay0: 0.001, sustain0: 0, release0: 0.001, pan0: Pseq([-1, 1], inf),
		phase1: 0, amp1: 0.25, attack1: 0.05, decay0: 0.001, sustain0: 0, release0: 0.001, pan1: Pseq([1, 1, -1, -1, 0, 0, 0, 0], inf),
		phase2: 0, amp2: 0.25, attack2: 0.05, decay0: 0.001, sustain0: 0, release0: 0.001, pan2: Pseq([-1, 0, 1], inf)
	]);

	pat.p6 = Pbind(*[
		instrument: \addOfSine,
		amp: Pseq([Pn(1,64), Pn(0, 64)], 8),
		dur: 0.025,
		sustain: Pkey(\dur),
		doneHandlerLength: 1,
		phase0: 0.5, amp0: 0.2, attack0: 0.001, decay0: 0.001, sustain0: 0, release0: 0.001, pan0: Pseq([-1, 1], inf),
		phase1: 0.5, amp1: 0.2, attack1: 0.001, decay0: 0.001, sustain0: 0, release0: 0.001, pan1: Pseq([1, 1, -1, -1, 0, 0, 0, 0], inf),
		phase2: 0.5, amp2: 0.2, attack2: 0.001, decay0: 0.001, sustain0: 0, release0: 0.001, pan2: Pseq([-1, 0, 1], inf)
	]);

	pat.hold = Pbind(*[
		instrument: \mulOfSine,
		amp: 3,
		dur: Pn(0.2, 64),
		sustain: Pseq([Pkey(\dur), Pkey(\dur) / 2, Pkey(\dur), Pkey(\dur) / 4]),
		amp0: Pseq([1,0.5,0.3,0.5], inf), attack0: 0.001, decay0: 0.001, pan0: 0, release0: 0.001,
		amp1: Pseq([1,0.5,0.7], inf), attack1: 0.001, decay1: 0.001, pan1: 0, release1: 0.001,
		amp2: Pseq([1,0.5,0.7,1,0.7], inf), attack2: 0.001, decay2: 0.001, pan2: 0, release2: 0.001
	]);



	//Sequence
	Pseq([
		pat.intro,
		Pseq([Pn(pat.p0, 4), Pn(pat.p1, 4)], 2),
		Pseq([Pn(pat.p2, 4), Pn(pat.p3, 4)], 2),
		Pn(pat.hold, 1),
		Ppar([Pn(pat.hold, 2), Pseq([Pn(pat.p0, 4), Pn(pat.p1, 4)], 2)]),
		Ppar([pat.p5, Pn(pat.hold, 2), Pseq([Pn(pat.p2, 4), Pn(pat.p3, 4)], 2)]),
		Ppar([pat.p5, pat.p6, Pn(pat.hold, 2), Pseq([Pn(pat.p0, 4), Pn(pat.p1, 4)], 2)]),
		Ppar([pat.p5, pat.p6, pat.intro, Pn(pat.hold, 1)]),
	]).play
}
)
raw 7796 chars (focus & ctrl+a+c to copy)
comments
g_montel user 25 Mar'13 17:48

AWESOME ! Super impressed by what you can achieved in a lunch break !

LFSaw user 26 Mar'13 17:10

Good example for structuring code to produce a serial composition!