DIGITAL GUITAR AUTO-TUNER PROJECT

R

Robert Scott

Jan 1, 1970
0
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..

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
 
D

dhaevhid

Jan 1, 1970
0
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
 
K

kunil

Jan 1, 1970
0
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
 
B

Benry

Jan 1, 1970
0
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
 
D

dhaevhid

Jan 1, 1970
0
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==
 
J

John Woodgate

Jan 1, 1970
0
I read in sci.electronics.design that dhaevhid <[email protected]>
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.

Generally, that's not true. Many will HELP; we won't provide model
answers for homework projects.
well, im just tryin my luck if there's anyone out there willing to
share his expertise on this field...

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.
 
R

Rich The Newsgroup Wacko

Jan 1, 1970
0
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.

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


Asshole.
 
R

Ronald H. Nicholson Jr.

Jan 1, 1970
0
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"...

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.
 
B

Bob Monsen

Jan 1, 1970
0
dhaevhid said:
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.

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: http://ouwehand.net/~peter/lcd/lcd.shtml

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
 
J

Jussi Saily

Jan 1, 1970
0
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
 
D

dhaevhid

Jan 1, 1970
0
Rich The Newsgroup Wacko said:
On Sat, 23 Apr 2005 01:11:51 -0700, dhaevhid wrote:
Well, hell, I'll do the whole thing for you - just sign over your
f**king paycheck.


Asshole.
THIS IS NOT VERY HELPFUL REPLY. BUT IT IS CERTAINLY FROM A GUY WHO DOESNT KNOW 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?...
 
M

Michael A. Terrell

Jan 1, 1970
0
dhaevhid said:
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?...


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

dhaevhid

Jan 1, 1970
0
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.


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...
 
P

Paul Keinanen

Jan 1, 1970
0
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.

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
 
P

Paul Keinanen

Jan 1, 1970
0
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...

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.
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..

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
 
D

Daniel Haude

Jan 1, 1970
0
["Followup-To:" header set to sci.electronics.design.]
On 23 Apr 2005 01:11:51 -0700,
in Msg. said:
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.

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.
 
R

Robert Scott

Jan 1, 1970
0
....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..

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
 
R

Robert Scott

Jan 1, 1970
0
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...

The trouble with using zero-crossings is that what you call harmonics
are not really harmonics. That is, they are not exact multiples of a
fundamental frequency. Since these overtones are not locked to the
fundamental, they float through the fundamental waveform, causing
time-varying distortion to the zero-crossing point. If you want to
use zero-crossings, you must first bandpass filter (either in software
or in hardware) for on particular narrow range of frequencies so that
the effect of these inharmonic overtones will have mininal effect on
the zero-crossing time. Of course you could just sample for a longer
time so that the individual errors in zero-crossings would be averaged
out. But that would contradict your stated goal of getting a response
from the device as soon as possible. Good luck.


-Robert Scott
Ypsilanti, Michigan
 
W

Walter Harley

Jan 1, 1970
0
dhaevhid said:
[...] im aiming for
about +/-2 hz accuracy. with the fastest possible response time...

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.
 
Top