Back
Class   LiveInput
   
Name  

getSpectrum()

   
Examples  
// Analize and display the FFT Frequency Spectrum values for the microphone input. 
 
void setup(){ 
   size(512,200); 
   Sonia.start(this); 
   LiveInput.start(256); // start the LiveInput engine, and return 256 FFT bins (frequencies) 
} 
 
void loop(){ 
 
   background(0,20,0); 
   strokeWeight(0); 
   stroke(0,230,0); 
 
   LiveInput.getSpectrum(); // Populates the LiveInput.spectrum[] array with latest FFT data. 
   // Use the LiveInput.spectrum[] to display the FFT data 
   for ( int i = 0; i < LiveInput.spectrum.length; i++){ 
      line(i*2, height, i*2, height - LiveInput.spectrum[i]/10); 
   } 
} 
 
public void stop(){ 
  Sonia.stop(); 
  super.stop(); 
} 

Description   Populates the LiveInput.spectrum array with FFT frequency spectrum values.
   
Syntax  
LiveInput.getSpectrum();
LiveInput.getSpectrum(beautify);
LiveInput.getSpectrum(beautify,envelope_curve );
   
Parameters  
beautify   boolean: use the Equalizer and Evelope prodecured on the FFT data

envelope_curve   float: specift a curve value for the Envelope (default: 1.5)

   
Returns   float
   
Usage   Web & Application
   
Related   getLevel()
useEqualizer()
useEnvelope()