AudioInput Proccesing

hi there, i am new in Juce and want to learn about DSP
can i get source C++ to :

  1. get audio input from mic
  2. and how to process the audio input with FFT ?
  3. how to showing frequency audio input in gui ?

I try to build tuner so someone please help me to understand Juce :frowning:
for windows thx

Look at the example projects, especially the SimpleFFT example. You may need to pull the latest tip on the develop branch from GitHub, I know that project was broken on the main branch.

1 Like

FFT might not be the best way of doing a tuner though. I think there’s a recommended auto-correlation method…

In fact Id break up what you are trying to do here.

Start by trying to get a meter showing the current level on the UI. That’ll be a less painful introduction than writing a tuner. You can then turn it into a tuner later.

thank you :slight_smile: can you tell me how to get signal / audio from mic ?

Are you doing a plugin for a DAW application like Cubase or Reaper, or are you doing a standalone application?

thank you :slight_smile: i will try
can u tell me how to get signal/audio form mic ?

plugin for a DAW

The audio to process will be delivered into your plugin with the processBlock method. You need to set up your DAW application to send audio from your microphone into the plugin, it’s not the plugin’s job to deal with that.

1 Like

:frowning: Wow thank you so much
is it possible to equalize the input signal?
FYI i try to make the tuner in real time

i have a task to process the signal with FFT so inevitably i should try using FFT for tuner, please give me the reason why FFT can not be used to make the tuner? thanks a lot

I suspect it’s not easy to make it accurate. It’s not like you get a frequency bin for every note, especially at the bass end. I think there’s a way using the phase of the bins…but I never looked into it.

This might help:

The FFT takes N samples and spits out the magnitude and phase information (as a complex number) into N “bins.” That means you have a frequency resolution of Fs/N. So for a full range audio tuner, you need to decide your resolution by picking the lowest note (say, A-1 which has a frequency of 27.5Hz), and 1 cent around there which is about 0.016Hz. If your sample rate is 44.1kHz, that means your minimum fft size (N) is 2,756,250 samples. Which is prohibitively large just from the computation, and that would be a latency of about 62.5 seconds (need to wait that long to collect that many samples). So obviously that’s a no go.

What you’re looking for is a real time pitch detection algorithm. There are a number of methods just a Google search away, many of which use the FFT or the autocorrelation of a signal, which can be computed with an FFT.