Recognizing Guitar Frequencies

Hey all,

Yesterday I posted about a project I was working on in class where I wanted to program an arduino to recognize certain frequencies based on sound and light up a corresponding LED. After some discouraging research, I have begun to consider changing the project a little. Does anyone have any idea how I would be able to use an arduino so that if I played a certain song via my computer or another source, the arduino would be able to read and identify the chords being played in the song. (Basically I want to wire an arduino to do the job of something like the website Chordify). Any help would be greatly appreciated, thanks!

Chords (or multiple instruments) are very difficult to analyze and I’d be surprised if the Arduino has the processing power to handle it.

From what I’ve read the [u]autocorrelation method[/u] is the best way to detect single notes (for making a guitar tuner, etc.).

Your 1st post reminds me of the [u]Fretlight Guitar[/u]. That’s something that could be done with the Arduino, but it requires some serious guitar modifications. i.e. You could feed a MIDI file into the Arduino and light-up the appropriate LEDs for the associated chord or note. To me, that “feels like” a semester-long project.

…It doesn’t require lots of processing power to generate notes/chords from a MIDI message, or to generate and send a MIDI message to a MIDI instrument. (Synthesizing the sound of a real instrument can take lots of processing power and/or memory.)

Thanks DVDdoug, I really like the idea you mentioned about feeding a MIDI file into the Arduino and lighting-up the appropriate LEDs for the associated chord or note. Do you have any suggestions about how to go about doing this?

Have a look at this project.
http://www.thebox.myzen.co.uk/Hardware/Glockenspiel.html

I think Arduino is too underpowered for this, since the method I can think of either calls for some complicated math that is too heavy for that little MCU to calculate.

To identify a chord you are looking at certain patterns of tones and their intervals. Each tone have a one-to-one mapping to a frequency. So if you want to find out the chords you need to figure out the frequencies used in the audio sample, and then search for patterns that represent chords.

Assuming you have a stream of audio coming in. Take a small duration of samples (aka time domain representation) and run Fast Fourier Transform on it. It will give you the frequency domain representation of this audio sample. Then search for significant peaks in this frequency domain representation that maps to the tones on the sample, and finally search for patterns in the frequency peaks.

This is heavy duty math, which not even the most powerful Arduino is capable of processing it near real time. I doubt that Raspberry Pi will be able to handle it well enough too, although its GPU is capable of helping a few steps of those. You may be better off getting your gaming PC out, and do all the aforementioned heavy duty math on its multi-gigahertz multi-core CPU and, for better real time response, that fast hundreds-of-threads GPU, and send the results to an Arduino over USB, that is controlling the ligh show.

Hey all,

I'm working on a project in class where I want to program an arduino so that when a certain music note/frequency is played a corresponding colored LED light lights up (ie the red LED would light up when a C is played). Does anyone have any suggestions on how to do this?

That's trickier than you might think. With anything other than a "pure test tone" there are harmonics and overtones. With some instruments these can be stronger than the fundamental frequency. Even if the fundamental is the strongest frequency component, the waveform is complex. And of course, the amplitude of a note from a musical instrument is not constant which also makes things more difficult.

Apparently come people get good results using autocorrelation with the Arduino. [u]Here[/u] is some theory to get you started.

It gets easier if you want to detect frequency bands. You can use [u]FFT[/u] or there is a slick 7-band chip called the [u]MSGEQ7[/u] which does the filtering in hardware for you.

On the hardware side, of course you'll need a microphone and preamp if you are picking-up the sound acoustically.

And if you are feeding the Arduino a line-level signal (from the output of a preamp, etc.) you need to bias the Arduino's input, since it can't handle the negative half of the audio waveform. (The MSGEQ7 takes care of that.)

Hey!

I'm working on a project for class and I was wondering if anyone could help me figure out how to pick up a note through waveform when played on a guitar so it is read through the computer microphone and transferred to spectrum analysis? Any help would be greatly appreciated, thanks!

Cross-posting.

Irritating, isn't it?

Duplicates deleted.

MKona, Check out Visual Analyzer http://www.sillanumsoft.org/ Just need a microphone to plug into your soundcard. Maybe pre-amp output from your amp?

MKona: ... any suggestions about how to go about doing this?

I see that you wrote, in a similar post,

MKona: ... one of my engineering classes ...

As an engineering student, you've no doubt broken many complex problems into a number of simpler problems. My suggestion is to use that approach here: what simpler tasks must you get the Ardunio to perform, in order to implement your project?