«UI sounds (pt1)» by nicolaariutti

on 02 Jan'19 21:05 in soundfminterfaceui

This code is an attempt to recreate a sound inspired from some technological/science fictional UI interface.

Sounds are created using FM technique. Play around FC, FM, ATK and RLS to obtain different sound characters.

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
// UI sounds
// this code is an attempt to recreate a sound
// inspired from some technological/electrical UI interface

// 1. first define the synth
// Here we are using the FM technique
(
SynthDef(\fmmod, {
	|
	amp=0.2,
	fc=1000,
	fm = 100,
	idx = 100,
	atk=0.01,
	rls=0.1
	|
	var env = EnvGen.ar(Env.perc(atk, rls), doneAction:2);
	var modulator = SinOsc.ar(fm);
	var carrier = SinOsc.ar(fc + (idx*modulator) );
	var sig = carrier *  env * amp;
	sig = HPF.ar(sig, 1000);
	Out.ar(0, sig!2);
}).add;
)

// 2. then define the Pbind which will play the sequence
// of UI sounds simulating variuos characters showing up on an
// imaginary display.
// Play around FC, FM, ATK and RLS to obtain different sound characters.
(
p = Pbind(
	\instrument, \fmmod,
	\fc, 10000,
	\fm, 100,
	\idx, 100,
	\amp, 0.6,
	\atk, 0.01,
	\rls, 0.001,
	\dur, Pwhite(0.1, 0.05, 10)
).asEventStreamPlayer;
)

// 3. play it
p.play;

// 4. Here are some presets

// "cricket" preset
(
Pbind(
	\instrument, \fmmod,
	\fc, 10000,
	\fm, 100,
	\idx, 100,
	\amp, 0.6,
	\atk, 0.01,
	\rls, 0.001,
	\dur, Pwhite(0.1, 0.05, 10)
).play;
)

// preset 2
(
Pbind(
	\instrument, \fmmod,
	\fc, 10000,
	\fm, 1000,
	\idx, 100,
	\amp, 0.6,
	\atk, 0.001,
	\rls, 0.01,
	\dur, Pwhite(0.1, 0.05, 10)
).play;
)

// preset 3
(
Pbind(
	\instrument, \fmmod,
	\fc, 10000,
	\fm, 100,
	\idx, 10,
	\amp, 0.4,
	\atk, 0.01,
	\rls, 0.01,
	\dur, Pwhite(0.1, 0.05, 10)
).play;
)

// preset 4
(
Pbind(
	\instrument, \fmmod,
	\fc, 1000,
	\fm, 100,
	\idx, 1000,
	\amp, 0.2,
	\atk, 0.01,
	\rls, 0.001,
	\dur, Pwhite(0.1, 0.05, 10)
).play;
)


// preset 5
(
Pbind(
	\instrument, \fmmod,
	\fc, 5000,
	\fm, 1000,
	\idx, 1000,
	\amp, 0.4,
	\atk, 0.01,
	\rls, 0.001,
	\dur, Pwhite(0.1, 0.05, 10)
).play;
)

// preset 5
(
Pbind(
	\instrument, \fmmod,
	\fc, 8000,
	\fm, 1000,
	\idx, 1000,
	\amp, 0.7,
	\atk, 0.01,
	\rls, 0.001,
	\dur, Pwhite(0.1, 0.05, 10)
).play;
)
raw 2022 chars (focus & ctrl+a+c to copy)
reception
comments