// title: Bell example using Ndef // author: Bruno Ruviaro // description: // Example of additive synthesis with inharmonic partials generating a bell-like sound. // code: ( 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; )