DIGITAL GUITAR AUTO-TUNER PROJECT

hi! im a total newbie on the field of assembly programming and the microcontrollers stuff and im trying to build a digital guitar tuner more like the ones which automatically detects the string being tuned and has an LCD "analog needle-display"... any kind of help would be greatly appreciated.. sample codes, ideas, references, anything would be great..

thank you in advance!

dhaevhid

Reply to
dhaevhid
Loading thread data ...

Well, reinventing the wheel is always fun.. :-)

I'm also guitar player and I would like to build my own guitar tuner..just for fun

I already have the schematic and the firmware in my head. The problem is I dont have time to do it.

If you like, we can work together. I'll give you direction, some tutorial&explanation for free..but in one condition : the hardware's schematic/firmware must be released as GNU GPL licence.

We can use this usenet (or if necessary we build our own mailing list in yahoogroups) to share information.

Anybody have interest to join in ? :p

-kunil Bandung, Indonesia

Reply to
kunil

I'll help out..I have some free time at night and on the weekends, and might be visiting South East Asia next month to colloborate if necessary. :)

Benry Amherst, NY

Reply to
Benry

Are you doing this just for practice? Why else would you want to re-invent something that is available in music stores at low prices?

-Robert Scott Ypsilanti, Michigan

Reply to
Robert Scott

I can help you out too.

Reply to
soumit.mukherjee

i wont try to be a freakin liar here guys, i will tell you my real situation.

its actually a qualifying sample project for my first job. actually, i was just tasked to study the assembly programming and hardware design and be able to produce a working model for me to qualify for the job.

im tryin to do it all by myself but its taking me so long to understand the concepts... im reading tutorials and references i downloaded from the internet but most of the times i found myself confused and i dont have anyone to ask my questions. the senior engineers here are not that helpful. they will just say " research in the internet, it might be there"...

so i finally resolved into seeking the help from the newsgroups and forums. i know lots of you guys are not willing to help me because this is really my own assignment.

well, im just tryin my luck if there's anyone out there willing to share his expertise on this field...

thanks guys! more power.

==dhaevhid==

Reply to
dhaevhid

Well, hell, I'll do the whole thing for you - just sign over your f**king paycheck.

Asshole.

--
Cheers!
Rich
 ------
"Why I am an atheist: 1. Atheists do not believe in higher powers. 2. God is the
highest power. 3. Therefore, God must be an atheist. 4. We should all strive to
be like God. 5. We should all be atheists."
Reply to
Rich The Newsgroup Wacko

I read in sci.electronics.design that dhaevhid wrote (in ) about 'DIGITAL GUITAR AUTO-TUNER PROJECT', on Sat, 23 Apr 2005:

Generally, that's not true. Many will HELP; we won't provide model answers for homework projects.

Did you see four positive replies, offering help? I can't help in this case; it's out of my field. I would only say that if you don't need to use an LCD display, don't An LM3914 and ten LEDs is a much simpler solution.

--
Regards, John Woodgate, OOO - Own Opinions Only.
There are two sides to every question, except
'What is a Moebius strip?'
http://www.jmwa.demon.co.uk Also see http://www.isce.org.uk
Reply to
John Woodgate

What kind of guitar? What kind of sound transducer? What sample rate? Signal to noise ratio? How powerful a microcontroller (MIPS, MFLOPs or MACs per sample)? To what tuning accuracy? With what response time?

Depending on your answers, you might need to examine different solution methods... anything from counting samples between zero crossings to interpolated complex cepstrums.

IMHO. YMMV.

--
Ron Nicholson   rhn AT nicholson DOT com   http://www.nicholson.com/rhn/ 
#include         // only my own opinions, etc.
Reply to
Ronald H. Nicholson Jr.

Here are some resources:

CircuitCellar... there is a guitar tuner article that uses a microcontroller. The article describes the entire thing, and gives you a schematic and a listing of the assembler code.

LCD, it's a snap, given the reams of free code available to drive those little 16 character one line displays. HD44780 LCDs are cheap. You can drive them with 11 datalines in 8 bit mode, and 7 in 4 bit mode, and 6 if you just hardwire the write pin high.

Here is a reference:

formatting link

They are kind of painful to program, so use a microcontroller with an on-chip debugger.

I've had some trouble using that CircuitCellar design, however. He assumes that the first couple of waves are the fundamental, but this doesn't seem to be true, at least for my guitar. I think a DSP design, using some simple digital filters, would make more sense. DSPs are getting pretty cheap. You could tune all the strings simultaneously... ;)

I know how you feel. It's easy to get lost in a first job. You want to do well, and don't want to ask for help. However, I'd guess that your ability to ask senior guys for help is one of the things they are testing you on...

Regards, and good luck! Bob Monsen

Reply to
Bob Monsen

ANYTHING ABOUT WHAT HE SAYS...YOU WILL DO THE WHOLE THING FOR ME??? DID I ASK ANYONE TO DO THAT? IM TRYING TO SEEK SOME HELP, IM NOT ASKING ANYONE TO DO THE WORK FOR ME, IM JUST ACCESSING ALL POSSIBLE SOURCES OF DIRECTIONS ON HOW TO EFFICIENTLY DO THIS SPECIFIC PROJECT.

AND HERE COMES "RICH THE NEWSGROUP WACKO" CALLING ME AN ASSHOLE AND ASKING FOR MY PAYCHECK... TRY TO THINK ABOUT IT, YOU CALL A GUY AN ASSHOLE AND THEN ASK FOR HIS PAYCHECK... WHO'S THE REAL ASSHOLE?...

Reply to
dhaevhid

it must be capable of tuning both electric and acoustic guitar.

im finished with the signal conditioning part of the hardware. i used an op amp to have a 2volts squarewave that will be the input signal of the microcontroller. i will be using the eFH5830 mcu buy EMC.(elan microelectronics) the mcu is 8-bit RISC type, 3.582Mhz. im aiming for about +/-2 hz accuracy. with the fastest possible response time...

im thinking about zero crossing detection but the guitar signal is consists of the fundamental and higher harmonics maybe up to 4 or 5 harmonics... and these harmonics cause erroneous zero crossings...

if this will be done on matlab, maybe FFT and some FIR or IIR will be handy but the chip is quite new and my only way to do this is by assembly language which as ive said, im just starting to learn...

as of now, im trying to make a program that will record the period of the first zero crossing from the external interrupt.. then, ignore all the higher frequency, just collect maybe 10 or more samples then have an average. then compare this average to the standard tuning frequency. find where the detected frequency belongs what string treshold, then find how much is the error withrespect to the center tuning freq... display the corresponding error with the "analog needle meter" to the LCD while also displaying the name of the string being tuned... i discovered one thing.. these are all EASIER SAID THAN DONE...

anyways, if theres anyone out there who can give an idea on how to do the "analog needle meter" program routine, i will greatly appreciate it. im willing to study all of these stuff. references, examples, related codes could be very helpful..

thank you all...

Reply to
dhaevhid

Why do you think he's a "Wacko"? He thinks he's funny, but...

--
Former professional electron wrangler.

Michael A. Terrell
Central Florida
Reply to
Michael A. Terrell

Hi, there is a working example on the Texas Instruments DSP support website. Look for University teaching support, and Richard Sikora's source code. These were very helpful to me in developing my own code with a TI C6000 DSP board! I think the guitar tuner example uses IIR filters to produce the reference sine waves (string pitches), and then mixes them with the guitar input. You can hear the 'beat-note' or the frequency error from your headphones and see it on the board leds.

I wrote my own code though which uses FFT. There's still some things to do with classification of the fundamental frequency, as the results contains many harmonics. Maybe I should make an algorithm to locate some local maxima and calculate the difference of the lowest of them. That should be the fundamental frequency of the string vibration! This is just a hobby, and I have not too much time to experiment but it's nice learn some DSP theory in practice!

Good luck,

Jussi

Reply to
Jussi Saily

Not adequate for musical purposes, I think. Basically what you're saying is that the best you can do would result in a 2Hz beat between a tuned string and the correct pitch; that's still annoyingly out of tune. Simply tuning by ear you can get 3 to 4 times better than that (i.e., one beat every 2 seconds). It might be "close enough for bluegrass," and certainly still quite an interesting electronics project, but it's not a very good tuner.

Reply to
Walter Harley
["Followup-To:" header set to sci.electronics.design.] On 23 Apr 2005 01:11:51 -0700, dhaevhid wrote in Msg.

Well, maybe "Go out and buy one for $20 at a store" is still the answer. Knowing what's already on the market (especially in unrelated fields) is probably just as important as knowing how to design something.

--D.

Reply to
Daniel Haude

Provided that the micro controller will provide crystal controlled timer interrupts, it would quite easy to use the NCO (Numerically controlled oscillator) principle to add a frequency specific constant value to a phase accumulator, which will address a sine look-up table to get the sine wave samples that are then multiplied (mixed) with the microphone signal to get some kind of frequency/phase detector.

Even updating six phase accumulators (one for each string) should not be too computationally intensive, since the string fundamental frequencies are quite low, so even a micro controller should be able to handle it, since the sample frequency would only have to bee a few hundred Hertz.

Paul

Reply to
Paul Keinanen

Just look at the guitar signal in the oscilloscope and it is easy to see that the 2nd and 3rd harmonics are going to cause all kinds of problems. At least you should insert a low pass filter with a corner frequency at the frequency of the highest string before the comparator.

A comparator with a large hysteresis will also help eliminate false triggerings due to harmonics.

Some kind of AGC may also be needed in front of the comparator, so that the hysteresis levels are some predefined amount (say +/- 20 %) compared to the waveform maximum amplitude.

You should now evaluate if it does make sense to do a lot of signal processing in the analog domain and how much in the digital domain. For a one-off product, it would be quite acceptable to use quite a lot of analog signal preconditioning in order to simplify the program. However, for mass production, any extra hardware (especially with precision components such as precision capacitors in low pass filters) should be avoided and doing as much as possible in software, would make much more sense economically.

Apparently the LCD has not been selected yet, the easiest would be to select one that is first scanning each column from top to bottom before going to the next column. With such displays, you could send

0xFF bytes until the threshold has been reached and then send 0x00 bytes.

With line scanning, there is the small extra complication of generating the bit pattern in the transition area, in which you would have to send bytes with 1 to 7 bits set.

Before selecting the display, you should carefully evaluate, how the display is controlled.

Paul

Reply to
Paul Keinanen

I am reading "Musical Acoustics" by Donald Hall, and he has a graph on page 108 that charts Hz against "JND" (which stands for "Just Noticable Difference".) Within the frequency range of open strings on a guitar, 1 Hz appears to be 'noticable' for between 60 and 90 dB. For quieter sounds, it goes up to 3 or 4 Hz. This is for pure sine waves.

Thus, sadly, 2 Hz probably isn't going to be good enough. The maximum error should probably be 1/2 Hz, as Walter says.

--
Regards,
  Bob Monsen
Reply to
Bob Monsen

The trouble with phase detectors in the presence of noise is that they only work if you are close. The indication for "way off" is useless. It is like using a strobe. The pattern is clear only if the pitch is within a certain range.

-Robert Scott Ypsilanti, Michigan

Reply to
Robert Scott

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.