Stringed Instrument Tuner, Ideas?

This is the place for any magazine-related discussions that don't fit in any of the column discussion boards below.
User avatar
MrAl
Posts: 3862
Joined: Fri Jan 11, 2002 1:01 am
Location: NewJersey
Contact:

Stringed Instrument Tuner, Ideas?

Post by MrAl » Tue Sep 16, 2008 10:34 pm

Hello,


Using a microcontroller to make a guitar tuner is a very
simple task. The program changes the state of an output
pin every 1/2 cycle of the tuning frequency and this creates
an almost perfect square wave and the frequency can be
adjusted to be very very close to the actual frequency
of a typical guitar string, within a small fraction of a
percent. The output pin is then used to drive a set
of headphones through a rather large value resistor and
the result is a tone at the required frequency. It takes
about 30 minutes to get the program going and uploaded
to the ic chip and then we're up and running, so it truely
is a very simple project.

What i was hoping to do however, is to drive a small white
LED, and that LED will be directed at the string of choice
and it will act as a strobe, so that when the string is
at the right frequency it will appear to be still rather
than vibrating back and forth. This will form a tuning
system that is far more accurate than the human ear because
that string will appear to move slowly even if it's frequency
is only off by a small amount.

There is a slight problem with this idea however, and i just
starting to think about this. When the string is plucked it
vibrates back and forth (guitar or other instrument laying on
its back) and this causes the string to be ever so slightly
tighter at the two extremes of its travel, and this causes
a change in movement especially since the string vibrates to
less and less extremes as the tone volume dies down. Thus,
it's a little hard to narrow down the frequency with a strobe
of a fixed frequency because the frequency varies slightly
as the string vibration damps out. The ear averages this
out a bit but the strobe doesnt have the ability to change
frequency as a string would, and i feel that would be too
complicated to build into the system.

Any ideas how to improve the system? Perhaps a short duty
cycle instead of a square wave? Perhaps a light sensitive
pickup to sense movement and analyze with the uC or send
the data to the computer for some analysis?

Any ideas/comments/suggestions?
LEDs vs Bulbs, LEDs are winning.

Dean Huster
Posts: 1263
Joined: Wed Dec 05, 2001 1:01 am
Location: Harviell, MO (Poplar Bluff area)
Contact:

Post by Dean Huster » Wed Sep 17, 2008 4:03 am

I, too, for many years used to take weeks to build devices for $80 to do the same job (in a larger package, uglier, more power hungry, etc.) than the $20 item I could have bought.

Dean
Dean Huster, Electronics Curmudgeon
Contributing Editor emeritus, "Q & A", of the former "Poptronics" magazine (formerly "Popular Electronics" and "Electronics Now" magazines).

R.I.P.

User avatar
MrAl
Posts: 3862
Joined: Fri Jan 11, 2002 1:01 am
Location: NewJersey
Contact:

Post by MrAl » Wed Sep 17, 2008 10:02 am

Hi Dean,


Ok, so your idea is to scrap the whole project and just buy a unit
from the local music shop? He he.

Well, i considered that option and realized that i already have the
controller chips on hand and i have the white LED and plenty of
resistors, so why not? If it was going to cost 80 bucks i wouldnt
be doing it that's for sure. Besides, i like building my own stuff
when possible...that way you can fix it when it breaks down too.
Besides, a lot of us here still do stuff like this as a hobby
anyway...dont you find it just a little interesting too? (i know it's
not rocket science though). I dont even play that much anymore
(took jazz lessons back in the day) but now and then i still
pick it up..."Take Five" anyone? :smile:

The other thing is that it already works as is if i simply connect
a set of headphones to it via a resistor such as 10k, so its not
useless even the way it is already, i just wanted to improve it
if possible. The user would have to tune by ear first anyway,
and then fine tune using the strobe.

It's also interesting i think that the oscillator that runs the strobe
is so steady that you can actually see the effect of the string as
it changes frequency ever so slightly as the vibrations damp out.
It's hard to hear this difference though.

Any more ideas also appreciated...
LEDs vs Bulbs, LEDs are winning.

User avatar
MrAl
Posts: 3862
Joined: Fri Jan 11, 2002 1:01 am
Location: NewJersey
Contact:

Post by MrAl » Wed Sep 17, 2008 1:23 pm

Hi again,


Little Update here...


I tried a 10 percent duty cycle and it seems to help a lot. It appears
that the main problem was with a 50 percent duty cycle the eye
picked up too much of the vibration and so it became a bit confusing.
With only 10 percent the eye only sees a fraction of the string travel
and so it sees the 'beat' frequency between the string and the actual
oscillator frequency. It's pretty cool really, and if you never tried
it you might want to. As the string comes closer and closer to the
oscillator frequency it 'appears' to move back and forth slower and
slower. I say 'appears' because it is actually vibrating much much
faster but the eye only sees it when the strobe is lit, which is a
short time pulse of light.
LEDs vs Bulbs, LEDs are winning.

User avatar
Lenp
Posts: 1453
Joined: Thu Oct 26, 2006 8:11 pm
Location: Maryland
Contact:

Post by Lenp » Wed Sep 17, 2008 5:09 pm

Dean,
I learned a long time ago that one sign of maturity is when you learn that ..
"Just because you can do it is not always sufficient reason to do it".

:grin: Len

User avatar
MrAl
Posts: 3862
Joined: Fri Jan 11, 2002 1:01 am
Location: NewJersey
Contact:

Post by MrAl » Wed Sep 17, 2008 6:10 pm

Lenp wrote:Dean,
I learned a long time ago that one sign of maturity is when you learn that ..
"Just because you can do it is not always sufficient reason to do it".

:grin: Len
Hi Len,

If i took that attitude i probably wouldnt build anything.
Like i said in my last post, some people still do this stuff
as a hobby, unless of course you would like it better if
everyone stopped doing that? :smile:
LEDs vs Bulbs, LEDs are winning.

Dean Huster
Posts: 1263
Joined: Wed Dec 05, 2001 1:01 am
Location: Harviell, MO (Poplar Bluff area)
Contact:

Post by Dean Huster » Wed Sep 17, 2008 6:23 pm

MrAl and Len,

Actually, I'm guilty of all the same stuff. Being older, I tend to not build what I can buy cheaply ... I suppose that terminal laziness has set in. However, I still have a major fault: since I have a massive stock of TTL & CMOS ICs and a boatload of 741C op amps, I tend to use those in projects rather than even considering a PIC or other processor. So, my projects are large, heavy, power hungry, complex, etc.! I still even make circuits using (gasp!) discrete transistors!

Dean
Dean Huster, Electronics Curmudgeon
Contributing Editor emeritus, "Q & A", of the former "Poptronics" magazine (formerly "Popular Electronics" and "Electronics Now" magazines).

R.I.P.

User avatar
jwax
Posts: 2200
Joined: Mon Feb 09, 2004 1:01 am
Location: NY
Contact:

Post by jwax » Wed Sep 17, 2008 6:29 pm

How's this for a possibility from a non-musician- use a frequency counter. You know what each string/chord is supposed to be, right? A 6 or 8 digit counter should give you resolution enough, right?
Is there any error introduced by using a square wave to beat with the strings sine wave?
Just "grabbing at strings here"! :grin:
Sorry.

User avatar
dtief
Posts: 59
Joined: Wed Aug 20, 2008 4:13 pm
Contact:

Post by dtief » Wed Sep 17, 2008 7:06 pm

It sounds like he is using the LED as a strobe light. So it needs to go on / off fast. = square wave. The tuning accuracy is related to the frequency / pulse rate of the flashes. Very similar idea to strobe based tachometers.

Dave

Jim Barrett
Posts: 31
Joined: Fri Sep 12, 2008 3:08 am
Location: Milwaukee WI
Contact:

Post by Jim Barrett » Thu Sep 18, 2008 3:48 am

Come on folks, the thing is "not how well the bear dances, but that the bear dances at all". For folks like us these things are intellectual exercises, not an attempt to aquire perfection or utmost efficency.
Keep tinkering, you never know when it might spark another idea and heaven forbid you (or we) might learn something.

ecerfoglio
Posts: 108
Joined: Thu Nov 25, 2004 1:01 am
Location: Buenos Aires Argentina
Contact:

Post by ecerfoglio » Thu Sep 18, 2008 9:34 am

MrAl wrote:Hi again,


Little Update here...


I tried a 10 percent duty cycle and it seems to help a lot. It appears
that the main problem was with a 50 percent duty cycle the eye
picked up too much of the vibration and so it became a bit confusing.
With only 10 percent the eye only sees a fraction of the string travel
and so it sees the 'beat' frequency between the string and the actual
oscillator frequency. It's pretty cool really, and if you never tried
it you might want to. As the string comes closer and closer to the
oscillator frequency it 'appears' to move back and forth slower and
slower. I say 'appears' because it is actually vibrating much much
faster but the eye only sees it when the strobe is lit, which is a
short time pulse of light.
An "ideal" strobe should use "cero length" light pulses - a good strobe should use very short pulses.


I needed a strobe to measure the "slip" of an induction motor. (difference between the actual shaft speed and the AC line).

When we used the motor at night (in a room with fluorescent light fictures) we (the teachers, knowing what to look for) could barely see the stoboscopic efect, and the students couldn't see it at all.

I built a led strobe with a 555 timer, triggered on the AC line cero crossing (10 ms for 50 Hz). It lights a LED for 70 microseconds (duty cycle = (70 / 1000000) / (10 / 1000) = 0.7 percent). It gives a very sharp image.

Strobe duty cycle is a tradeoff between image sharpness and average light level.
E. Cerfoglio
Buenos Aires
Argentina

User avatar
MrAl
Posts: 3862
Joined: Fri Jan 11, 2002 1:01 am
Location: NewJersey
Contact:

Post by MrAl » Thu Sep 18, 2008 11:54 am

Hi again,


Dean:
Yeah, hehe, i have lots of parts laying around doing nothing too.
I also dont like to waste the time i spent learning in college and
after college...nice to be able to use some of that for these things.

jwax:
I actually have three frequency counters...one home built (8 digit)
and two bought that came as part of DVM's. I can even connect a
10 second time base to my 8 digit counter to get 0.1Hz resolution,
better than most guitar tuners i've seen.
What i was after here though was a very very simple way of doing
this yet obtain high accuracy, or at least higher than one could
obtain by simply listening to the two tones and adjusting the string
tension. The whole thing only takes one ic chip and one LED
and one resistor (ok perhaps a tiny 5v regulator too and a speaker
if you want a tone output to go with the strobe output). A whole
frequency counter, although a good idea, takes a lot more parts.
Using a wave (square or other) to beat with the string sine wave
is an interesting idea too though, which should be considered. The
beat frequency might be sent to a speaker which would produce say
'clicks' that get farther and farther apart in time as the string
comes closer to the reference frequency. I'll have to give this
some thought too.

Dave:
Yes, that's it. The LED turns on just long enough to see the string
as it moves out in one direction, and if it appears to be still then
the string is perfectly tuned, but if it is waving back and forth it
is not. The movement appears to slow down too as the string comes
closer to the reference frequency oscillator.
And yes, it's like the automobile strobe light idea.

Jim:
Yes, that's part of the idea too :smile: and just to see how well
a strobe light can work when tuning a stringed instrument.

E. Cerfoglio:
Yes, the shorter light pulse seems to work much better. As per your
notes it looks like going even shorter could work even better.
Right now i have it set to 10 percent and i have another output set
to 50 percent (for tone generation also) but it doesnt take much
to make the 10 percent 5, 2, or even 1 percent. I'll try that next.
The tone output BTW is so the user can tune the string close to the
right frequency to start with, then fine tune with the LED strobe.
And yes, i have found the average light output dies as the pulse
gets shorter, but that's life, and since the LED can take higher
current pulses for a shorter time period i can get the brightness
back up by going to a higher current driver (say 60ma perhaps).
Right now i am trying to keep it simple however.
LEDs vs Bulbs, LEDs are winning.

ecerfoglio
Posts: 108
Joined: Thu Nov 25, 2004 1:01 am
Location: Buenos Aires Argentina
Contact:

Post by ecerfoglio » Thu Sep 18, 2008 12:02 pm

MrAl wrote:Hi again,

......

The tone output BTW is so the user can tune the string close to the
right frequency to start with, then fine tune with the LED strobe.
That'a a very good idea, espacially if the instrument is "very out of tune" (like when you change a string).

The strobe method can give false readings on harmonic and subharmonic frecun¡encies - not unlike a DSP's aliassing
E. Cerfoglio
Buenos Aires
Argentina

User avatar
MrAl
Posts: 3862
Joined: Fri Jan 11, 2002 1:01 am
Location: NewJersey
Contact:

Post by MrAl » Thu Sep 18, 2008 12:33 pm

Hi again,

E.C.:
Yes, the tone will allow the user to get close first to avoid that situation.


jwax:
Oh, maybe you meant using a uC as a frequency counter, which would
keep the parts count and complexity low too? That would be a good idea
too, as the LED could then blink when the string was out of tune, in
step with the beat frequency. Might need an amplifier on the input first
but that's not too bad.
LEDs vs Bulbs, LEDs are winning.

User avatar
philba
Posts: 2050
Joined: Tue Nov 30, 2004 1:01 am
Location: Seattle
Contact:

Post by philba » Thu Sep 18, 2008 2:18 pm

When I tune a stringed instrument, I use the audible beat between the reference and the DUT (er, string). I'm not sure if a strobe would be better. I've got a tin ear and still get it pretty accurate.

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 36 guests