• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Microphone input tuner

N

nicolobos77

Guest
Hi, I've tried to make a tuner using the microphone input, but doesn't works, I've tried counting the differents levels on a second, but don't give a real frequency for know what tune is
I need get the frenquency on the audio recording for get the tune " A A# B C C# D D# E F F# G G#"
 
R

renex

Guest
This actually requires programming a very accurate band-pass filter, and then measuring its output amplitude at specific frequency settings.

I have tried doing this myself for a simple phone-to-phone comm system but I've had no success, and I suspect a band-pass filter written entirely in GML won't be able to run in realtime.

Another option is adding a waveform of the test frequency at multiple phases and checking if any of them reduces the general amplitude. That would mean it synced with the reverse phase of the sound recorded. However, this assumes the waveform produced by the instrument is known, and that the ambient reverberation is minimum, which is not ideal.

One could probably step through the waveform and analyze the shift between peak values with heavy interpolation to try and identify a polarity pattern. This would probably be incredibly cpu-heavy though.
 
Top