«Bell example using Ndef» by Bruno Ruviaro

on 19 Nov'25 16:15 in belladditive synthesisinharmonics

Example of additive synthesis with inharmonic partials generating a bell-like sound.

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
(
var fundamental = 131;
var dur = 10;
var partials =
[
	[1,     0.5,  dur * 1],
	[1.02,  0.3,  dur * 1],
	[1.01,  0.14, dur * 0.5],
	[2.44,  0.17, dur * 0.8],
	[3.31,  0.9,  dur * 0.5],
	[5.1,   0.1,  dur * 0.56],
	[5.9,   0.1,  dur * 0.9],
	[11.01, 0.09, dur * 1],
	[13,    0.01, dur * 0.5],
	[15,    0.01, dur * 0.2],
	[16,    0.05, dur * 0.02],
	[19,    0.10, dur * 0.01],
	[20,    0.01, dur * 0.2],
	[24,    0.01, dur * 0.2],
	[4,     3,    dur * 0.002] // attack
];

Ndef(\quickBell).fadeTime = 0;
Ndef(\quickBell, {
	var snd, env;
	env = Env.perc(
		attackTime: 0.001,
		releaseTime: partials.flop.at(2),
		level: partials.flop.at(1)
	).kr;
	// fundamental + inharmonics
	snd = SinOsc.ar(
		freq: fundamental * partials.flop.at(0);
	);
	snd = snd * env;
	snd = Splay.ar(snd);
	snd = Limiter.ar(snd);
}).play;
)
raw 855 chars (focus & ctrl+a+c to copy)
reception
comments