1
0
Files
scoobidules/choir.scd
2025-02-26 07:36:13 +01:00

72 lines
1.5 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// create a choir from two formants
(
// https://en.wikipedia.org/wiki/Formant#cite_note-7
var formants = [
[360, 640], // o
[235, 2100], // y
[390, 2300], // e
[585, 1710], // æ
[850, 1610], // a
[750, 940], // ɑ
[820, 1530], // ɶ
[600, 1170], // ʌ
[250, 595], // u
[240, 2400], // i
];
SynthDef(\formoo, {
arg formants = #[850, 1610];
var sig, env;
env = Env.perc(\attack.kr(0), \decay.kr(1)).ar(Done.freeSelf);
sig = 10.collect{
var octave = [1, 2, 0.5, 1.5];
// base freq * octave * detuning over time
// sounds like a chorus fx
var voice = Saw.ar(\freq.kr(220) * LFNoise2.kr(3).linlin(-1, 1, 0.99, 1.1) * octave.choose);
// formant * detuning; very high resonance
voice = RLPF.ar(
voice,
formants *
formants.size.collect{
LFNoise2.kr(3).linlin(-1, 1, 0.98, 1.05)
}, 0.05).sum;
// detune and blur some more
voice = voice + PitchShift.ar(voice, {Rand(0.01, 0.1)}, 0.98) * 0.5;
// a bit of distortion
voice = voice.softclip;
};
sig = Splay.ar(sig);
// narrowing the spectrum a little more
sig = RLPF.ar(
sig,
\ff.kr(4700) *
LFNoise2.kr(1).linlin(-1, 1, 0.95, 1.05),
\qr.kr(0.9)
);
sig = sig * env;
sig = sig * \amp.kr(0.25);
sig = Limiter.ar(sig);
Out.ar(\out.kr(0), sig);
}).add;
)
// example
(
r {
[38 + 3, 38 +5, 38 + 12].do{
|freq|
Synth(\formoo,
[
amp: 0.15,
attack: 2,
decay: 5,
freq: freq.midicps,
formants: [850, 1610],
ff: rrand(550, 2660),
qr: 0.5
]
);
}
}.play;
)