// Octave-band Spectrum Analyzer and CPU Heater, by PRC, April 1-epsilon 2008 BPF b[10]; Gain g[10]; OnePole p[10]; MAUI_View myWinder; myWinder.size(330.0,120.0); MAUI_LED led[10]; 16.0 => adc.gain; // global gain control for (0=>int i;i<10;1+=>i) { adc => b[i] => g[i] => p[i] => blackhole; b[i] => g[i]; // make a 3 => g[i].op; // squarer 0.999 => p[i].pole; // and smoothing filter 2.0 => b[i].Q; 20.0 * Math.pow(2.0,i) => b[i].freq; // octave bands led[i].position(30.0*i,80.0); myWinder.addElement(led[i]); } myWinder.display(); while (1) { 0.020 :: second => now; for (0=>int i;i<10;1+=>i) { led[i].position(30.0*i,75.0 - 40.0 * (0.5 * (Math.log10(p[i].last() + 0.01) + 2.0))); if (p[i].last() > 40.0) led[i].light(); else led[i].unlight(); myWinder.addElement(led[i]); } }