wanbinkimoon_frittura/step 15 – Class test/build/audioLab.pde
class AudioLab { 

 	AudioLab (float y, float s) {  
    ypos = y; 
    speed = s; 
  } 
  
	void audioSettings(){
		minim = new Minim(this);
	  audio = minim.getLineIn(Minim.STEREO);

		audioFFT = new FFT(audio.bufferSize(), audio.sampleRate());
		audioFFT.linAverages(audioRange);

	  audioFFT.window(FFT.NONE);
	  // audioFFT.window(FFT.BARTLETT);
	  // audioFFT.window(FFT.BARTLETTHANN);
	  // audioFFT.window(FFT.BLACKMAN);
	  // audioFFT.window(FFT.COSINE);
	  // audioFFT.window(FFT.GAUSS);
	  // audioFFT.window(FFT.HAMMING);
	  // audioFFT.window(FFT.HANN);
	  // audioFFT.window(FFT.LANCZOS);
	  // audioFFT.window(FFT.TRIANGULAR);
	}

	public void audioDataUpdate(){
		audioFFT.forward(audio.mix);

		for (int i = 0; i < audioRange; ++i) {

			float indexAvg = (audioFFT.getAvg(i) * audioAmp) * audioIndexAmp;
			float indexCon = constrain(indexAvg, 0, audioMax);

			audioData[i] = indexCon;
			audioIndexAmp += audioIndexStep;	
		}
		audioIndexAmp = audioIndex;
		println(audioData);
	}

}