Thank you all guys!
Dividing the frequency spectra based on logarithms looks nice, also skipping FFT and use just BPF seems relevant to me . I have not checked the CPU usage, but somehow I feel that it shoul be cheaper, thanks @nathan
I am attaching an example code, with 5 bands spectrum based on @shiihs calculation.
// 5 bands
(
Ndef(\a, {
var sig = Mix(SoundIn.ar(0,2))/2;
//41 - 139
var sublows = Amplitude.ar(BPF.ar(sig, 89, rq: 49/89));
//139 - 481
var lows = Amplitude.ar(BPF.ar(sig, 310 , rq: 171/310));
//481 - 1666
var lowmids = Amplitude.ar(BPF.ar(sig, 1073.5 , rq: 592.5/1073.5));
//1666 - 5771
var mids = Amplitude.ar(BPF.ar(sig, 3718.5 , rq: 2052.5/3718.5));
//5771 - 20000
var highmids= Amplitude.ar(BPF.ar(sig, 12885.5, rq: 7114.5/12885.5));
SendReply.kr(Impulse.kr(10), '/fft2', [sublows, lows, lowmids, mids, highmids]*300);
Silent.ar;
}).play
)
(
~pl = Plotter("", Rect(600,30,376,142) );
~pl.setValue(
[0,0,0,0,0,0],
minval: 0,
maxval: 100
);
~pl.setProperties(
\backgroundColor, Color.black,
\plotColor, [Color.white],
\gridOnX, false,
\gridOnY, false
).plotMode = \bars;
)
(
OSCdef(\a,{|m|
{~pl.setValue(
[m[3], m[4], m[5], m[6], m[7], 1], // lebo nezobrazuje posledny
minval: 0,
maxval: 100)
}.defer
},'/fft2')
)
now, my mind is occupied by russian agression
I am very sorry for all the Ukrainians and maybe for all the democratic world. Fuck you Mr.Putin.