PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Anyone have info on the microphone?

I know I asked this before, but Its possible someone who knows missed it. I was wondering if anyone knew how to enumerate the microphone to get live info about it. What I'm trying to do is create a guitar tuner. I dont think it should be too hard if I can just get a simple Hz reading. There are allready guitar tuner programs, but none of them are as full featured as I would like. If anyone has ANY info on this at all, I would be greatful.
What do you mean by "live info"?

Anyway, a simple Hz reading isn't that simple since the microphone doesn't work with frequencies directly. It works by sampling the amplitude of the sum of all sound waves that reach it at a high rate.

In order to get a Hz reading you have to record samples during an interval and then analyze that data to see if there's a strong signal at a particular frequency (that would hopefully be the guitar).

This analysis requires a transformation from the samples to the frequency domain similar to what is done in many audio encoders.
pacomac · 03 May 2003, 17:11 UTC — Anyone have info on the microphone?
DillRye wrote:
I dont think it should be too hard if I can just get a simple Hz reading

Your in for a big shock... it's not an easy job calculating the frequencies of a signal from the miicrophone. It's easy to determine the frequencies of simple sounds like sine waves but a guitar is has harmonics which complicate matters. You need to look into Fast Fourier Transformations and Harmonic Summation in order to get anything half decent. Then you have the biggest problem of all.... it has to run on a slow pocket pc with no maths processor!!
WOW! Can't find SHEEEEIT about this subject.

eVC++ help has nothing...google didn't help.

Sorry man, I thought I'd be able to dig up something.

Let us konw how you make out.
pacomac · 03 May 2003, 18:27 UTC — Anyone have info on the microphone?
DillRye wrote:
There are allready guitar tuner programs, but none of them are as full featured as I would likegreatful.

I use the 4Pockets guitar tuner and it works fine for what I want. What were you actually looking for it to do?

Checkout the following URL:
http://www.4pockets.com/software.php
Im actually looking to make a very easy to use Tuner which you can tune to alot of the "alternate" tunings easily. Such as Eb instead of the normal E. I keep running across songs which drop to all sorts of different tunings. Not many tuners do much besides just the standard EADGBE tuning. I also think alot of these tuners are fairly pricy, id like to change that.

Even if it does turn out complicated, I would like to atleast try. Shouldnt a single string produce a clear hz raiting,atleast at the right note? Im not looking to measure the tone of chords and such.
DillRye wrote:
Shouldnt a single string produce a clear hz raiting,atleast at the right note?


It's not that clear. That's why you can tell a certain note on a guitar from the same one on a piano or some other instrument. I'm sure you've heard clear tones when testing your hearing or something like that. Very different from the sound you get when playing a note on a guitar...

However, with the appropriate analysis of the sampled sound it is possible to determine the major frequency component. Unfortunately, I don't have any good pointers on this. Try to find out how some existing program does it.
Orpe":14d7dpi8]


search for DFT or FFT, it's widely known
DillRye wrote:
Shouldnt a single string produce a clear hz raiting,atleast at the right note? Im not looking to measure the tone of chords and such.


The problem is that the harmonics are often louder than the fundamental note, so it becomes very difficult to estimate the fundemental frequency of the string being sampled. Try sampling a guitar string in something like SoundForge and you will see that you don't get simple sine waves even with a single guitar string. FFT is definately the way to go but you may need to revert to assembler to get it accuate enough for tuning a guitar. To get the accuracy you require (+/- 0.01 Hz) you need to sample large buffers which take time to process. Also this is complicated by the fact that to my knowledge there are no fixed point FFT algorithms out there so you have to use very slow floating point maths. It is possible but it's not easy.
Ok, there are many FFT algorithms availble on the net, i think i could do that part fairly well and convert it to fixed point math if need be. I still cant find any info on getting the raw data from the mic.
DillRye wrote:
I still cant find any info on getting the raw data from the mic.



I haven't played with it myself but I've always assumed that the waveInOpen and related functions could be used to get data from the microphone.