Submit
Browse
Anonymous
Login
RSS
SuperCollider Code
Fork Code: Formant filter using the Vowel Quark
name
code content
// a function to get the n loudest partials for a formant filter using Klank and Vowel // needs the Vowel quark: "Vowel".include; // tenor, for instance a = "aeiou".as(Array).collect { |x| Vowel(x.asSymbol, \tenor) }; // function for threshold ( f = { |vowel, thresh = 0.3| var freqs = (40..10000).collect { |x| x + 0.5.rand2 }; var result = []; freqs.do { |freq| var amp = vowel.ampAt(freq); if(amp > thresh) { result = result.add([freq, amp]) } }; result.size.postln; result.flop }; ) // or alternatively, for number of partials ( g = { |vowel, numPartials = 30| var freqs = (40..10000).collect { |x| x + 0.5.rand2 }; var result = []; freqs.do { |freq| var amp = vowel.ampAt(freq); result = result.add([freq, amp]) }; result = result.sort { |a, b| a[1] > b[1] }.keep(numPartials); result.flop }; ) // some examples Ndef(\vow, { Klank.ar(`(f.(a[0], 0.7) ++ 0.2), Impulse.ar(MouseX.kr(1, 1000, 1))) * 0.001 }).play; Ndef(\vow, { Klank.ar(`(f.(a[0], 0.3) ++ 0.2), Impulse.ar(MouseX.kr(1, 1000, 1))) * 0.001 }).play; Ndef(\vow, { Klank.ar(`(f.(a[2], 0.7) ++ 0.2), Impulse.ar(MouseX.kr(1, 1000, 1))) * 0.001 }).play; Ndef(\vow, { Klank.ar(`(f.(a[2], 0.3) ++ 0.2), Impulse.ar(MouseX.kr(1, 1000, 1))) * 0.001 }).play; // use for instance to get the 42 loudest partials, for each vowel z = a.collect { |x| g.(x, 42) }.flopDeep(1);
code description
A function to get the n loudest partials, or all partials louder than a threshold, for a formant filter using Klank and Vowel
use markdown for formating
category tags
comma separated, i.g. "wild, siren" (do not enter default SC class names, please)
ancestor(s)
comma separated identificators, i.g. "1-C,1-1,1-4M,1-x"
Private?
the code will be accessible by direct url and not visible in public activity
signup to submit public code without captcha
comment of change