Mic input to FFT with Maximilian

Hi guys,

I’m very new to openframeworks and audio, so pardon the beginner question. I’m trying to start a simple app for children that translates your voice to an animation with FFT. I have been struggling with getting things moving with iOS, and thought that it was time to ask for help.

  1. I have been reading that the Maximilian library is what I need, but can’t seem to find an example on how to use it with FFT… is there an example that I missed?
  2. What is the best way to access audio in through the mic?

Any help/ thoughts would be most appreciated.

As far as I know there isn’t any other way to do FFT on ofIphone, so yeah, maximilian it is. You should check out this example to see how to grab the sound: https://github.com/openframeworks/openFrameworks/blob/master/apps/iPhoneExamples/audioInputExample/src/testApp.mm

As far as the maximilian stuff, create an fft instance and maybe an octave analyzer instance (ofxMaxiFFTOctaveAnalyzer oct;)

fft.setup(1024, 1024, 256);  
nAverages = 12;  
	oct.setup(sampleRate, fftSize/2, nAverages);  

and then in your audioIn() method have something like:

void testApp::audioIn(float * input, int bufferSize, int nChannels){  
	for (int i = 0; i < bufferSize; i++){  
		//generate the fft from the input  
		if (mfft.process(input[i])) {  
			mfft.magsToDB(); // calculate all the DBs  
			oct.calculate(mfft.magnitudesDB); // this will store the DBs of each octave range  

This is all pretty much all there is to it

Thank you! I will try this out and update with how it goes.