DIGITAL GUITAR AUTO-TUNER PROJECT

J

John Woodgate

Jan 1, 1970
0
I read in sci.electronics.design that Rich Grise <[email protected]>
Thanks! And of course, need I mention how rare a clean limerick is? ;-)

They are only rare because they are rarely quoted. Have you come across
W S Gilbert's (he of the d'Oyly Carte operas) effort:

The was an old man of St Bees
Who was stung on the arm by a wasp.
When asked, 'Does it hurt?'
He replied 'No, it don't.
I'm so glad it wasn't a hornet.'
 
R

Rich Grise

Jan 1, 1970
0
I read in sci.electronics.design that Rich Grise <[email protected]>


They are only rare because they are rarely quoted. Have you come across
W S Gilbert's (he of the d'Oyly Carte operas) effort:

The was an old man of St Bees
Who was stung on the arm by a wasp.
When asked, 'Does it hurt?'
He replied 'No, it don't.
I'm so glad it wasn't a hornet.'

I haven't, but this did jog my memory - when I was a kid, we had a whole
book (or maybe just a chapter of some book) of Lear's limericks. They
were "family-friendly", as I remember. :)

There was an old man with a beard,
Who said, "It is just as I feared -
Two owls and a wren,
Four larks and a hen,
Have all made their nests in my beard."

Cheers!
Rich
 
J

John Woodgate

Jan 1, 1970
0
I read in sci.electronics.design that Rich Grise <[email protected]>
I haven't, but this did jog my memory - when I was a kid, we had a
whole book (or maybe just a chapter of some book) of Lear's limericks.
They were "family-friendly", as I remember. :)

There was an old man with a beard,
Who said, "It is just as I feared -
Two owls and a wren,
Four larks and a hen,
Have all made their nests in my beard."

Most of Lear's limericks don't have a punch line; the last line just
repeats the first, so there are somewhat insipid. He wrote hundreds like
that.
 
B

Ben Bradley

Jan 1, 1970
0
I agree. One point of quibble: even if the overtones were frequency
locked, the wave shape would still change with time. Different overtones
have different decay rates.

Lower harmonics may well be locked together through the bridge
interaction, though I believe that with increasing harmonic number
there is less coupling at the bridge, the most coupling being at the
fundamental.
But there's another phenomenon in the piano having nothing to do
with harmonics when several strings are sounded in unison, and this
causes tje result described above, "Exact tuning makes the note loud
ans it's [and its] decay rapid" and you would presumably see this in
the amplitude on the oscilloscope, especially if you were looking for
a perfect exponential decay of amplitude, and wonder what's going on.
The decay will be quite fast in the first few seconds, then much
slower in the seconds thereafter.
When the hammer strikes the strings, they are all in phase, going
up and down (presuming a grand piano with horizontal strings)
together, and passing a lot of energy to the bridge (which goes up and
down with the strings, and transferring this motion to the air),
resulting in much energy being taken from the strings and a high decay
rate. But due to the coupling at the bridge, one or two of the three
strings will eventually change phase until one is going up while the
other(s) are going down. At this point, much less energy (in relation
to the amplitude of each string vibration) is transferred to the
bridge (when one string goes up, its effect on the bridge is mostly
canceled by the other string(s) going down, so the bridge moves up and
down a lot less in relation to string motion), and since less energy
is being taken out of the strings at the bridge, their decay rate is
much longer.
This is a part of the piano's sound (fast decay at the start of the
note, slow decay after a few seconds) that cannot be made with a
single-string-per-course instrument. I intentionally ignored the
harmonics in the above description to simplify things, but the
harmonics might also change phase in the same or a similar way.
There have been three or four articles on the piano in Scientific
American over the past 30 or 40 years, and I recall reading the above
description of the string changing phase in one of them.
 
B

Ben Bradley

Jan 1, 1970
0
Just scroll down, folks, cause I don't top-post...

In sci.electronics.design,sci.electronics.misc, On Mon, 25 Apr 2005
17:34:09 GMT said:
[email protected] (Robert Scott) wrote in @news.provide.net:


I observed this many years ago using an FFT analyzer. As I recall (25
years ago),I also noticed that the G string on my guitar was actually
vibrating at two different frequencies that straddled the desired center.
I think this is why I never think that a B created at the 4th fret of the
G string ever sounds perfectly in tune with the B string. I attributed
this to the fact that the G is a wirewound string and therefore has
significant thickness.

Have you tried this several times, with different guitars, or with
the same guitar after changing strings? The fact that G is wirewound
may have its effect, but there are other things. If the string does
not have a very consistent weight along its length, perhaps one end is
slightly thicker and heavier than toward the other (whether from wear,
dirt accumulation, or faulty manufacture), the harmonics will be out
of tune with the fundamental (or much moreso than with a 'good'
string), and fretted notes are going to be sharper or flatter in
relation to the open string than they will be for a consistent string.
Imperfect strings are one thing that has driven me crazy (and I'm sure
many other guitarists) before I figured it out. I read about "turning
around the string" on a classical guitar in an attempt to get better
intonation from it in Jose Oribe's book "The Fine Guitar" (I see it's
now out of print, get a used copy before the price goes up any
further).
As was mentioned earlier, the choice of temperment is always a
compromise. The frets contribute to temperment as well, I wonder what the
best compromise tuning is for a guitar given all the various parameters.

You might start with the fact that a guitar is usually tuned E A D G B E.

I suppose a smart tuner could have open tuning capabity as well. Open
tunings might be easier to consider if you want fifths and thirds etc to
be perfect (1.5 vs 1.4983 & 1.25 vs 1.25992)

You can tune for a particular key, but it makes things sound worse
for different keys, or even some chords IN that key.
Piano tuners fight the temperment issue all the time. If I have a piano
tuner come out and tune my piano to even temperment (unfortunately, the
typical situation), I hate the sound. I used to have a guy who tuned most
of the pianos for the recording studios in my area tune my piano. When he
did the tuning, my piano sung!

A piano is either tuned for equal temperament (I think virtually
all of them are), or it only sounds good in some keys. I suspect both
tuners aimed for and perhaps got equal temperment, but the second one
knows more about how much to stretch-tune each instrument - the higher
notes are tuned slightly sharp, and the lower ones are tuned slightly
flat, relative to the middle octave. This is done so the higher notes
are 'in tune' with the slightly-sharp harmonics of the lower notes.
I've seen on the Web different tables of just how much to stretch-tune
each of the notes on different models of pianos.
Too bad I can't actually play very well.....

Unfortunately (fortunuately) I have a pretty good sense of pitch.

I do to, and it used to frustrate me as to why my guitars were out
of tune and wouldn't tune right. Now I KNOW why. :) Actually, with
some work and the proper tools (g-tune is a nice precision tuner for
adjusting guitar harmonics (nut as well as bridge positioning) and
general tuning) I've been getting things under control.
 
J

Jerry Avins

Jan 1, 1970
0
Ben said:
I agree. One point of quibble: even if the overtones were frequency
locked, the wave shape would still change with time. Different overtones
have different decay rates.


Lower harmonics may well be locked together through the bridge
interaction, though I believe that with increasing harmonic number
there is less coupling at the bridge, the most coupling being at the
fundamental.
But there's another phenomenon in the piano having nothing to do
with harmonics when several strings are sounded in unison, and this
causes tje result described above, "Exact tuning makes the note loud
ans it's [and its] decay rapid" and you would presumably see this in
the amplitude on the oscilloscope, especially if you were looking for
a perfect exponential decay of amplitude, and wonder what's going on.
The decay will be quite fast in the first few seconds, then much
slower in the seconds thereafter.
When the hammer strikes the strings, they are all in phase, going
up and down (presuming a grand piano with horizontal strings)
together, and passing a lot of energy to the bridge (which goes up and
down with the strings, and transferring this motion to the air),
resulting in much energy being taken from the strings and a high decay
rate. But due to the coupling at the bridge, one or two of the three
strings will eventually change phase until one is going up while the
other(s) are going down. At this point, much less energy (in relation
to the amplitude of each string vibration) is transferred to the
bridge (when one string goes up, its effect on the bridge is mostly
canceled by the other string(s) going down, so the bridge moves up and
down a lot less in relation to string motion), and since less energy
is being taken out of the strings at the bridge, their decay rate is
much longer.
This is a part of the piano's sound (fast decay at the start of the
note, slow decay after a few seconds) that cannot be made with a
single-string-per-course instrument. I intentionally ignored the
harmonics in the above description to simplify things, but the
harmonics might also change phase in the same or a similar way.
There have been three or four articles on the piano in Scientific
American over the past 30 or 40 years, and I recall reading the above
description of the string changing phase in one of them.

That's a good description that I omitted for brevity. You did a better
job of describing it than I would have. The math, at least for two
strings, is relatively simple. It is in many texts on diff-eq for
engineers and physics lab demos as the "coupled pendulum" demonstration.
Tuning the strings so that they just barely lock in frequency gives the
longest sustain. If they slip just a bit further apart than that, the
typical way-out-of-tune twang is the result. Just a touch with a
quarter-inch-drive socket face up and turned with an Allen wrench can
restore the lock. When three strings are involved, it is usually easy to
identify the one that slipped. With two, even if you tweak the wrong
string and so leave the note out of tune, it sounds so much better that
you'll get laurels anyway. When you know how things work, the world is
one big sandbox.

Jerry
 
K

keith

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

I've read (most of) the answers here and they've gone for the first
things I'd try, so it's out-of-the-box time [*]. What about an optical
interrupter (or reflection) at the center (maxima) of the string
feeding a microcontroller's timer?


Ok, so my optical idea wasn't taken well. What about dopler radar? I
remember when police radars were calibrated using tuning forks.

Yeah, microphones are just too obvious. ;-)
 
J

Jerry Avins

Jan 1, 1970
0
keith said:
No, I think you'll find that it does _not_ prove the converse. ;-)

You mean that proving the converse doesn't prove anything? Oh, I get it!

The converse of something is nothing.

Proving the converse of something proves nothing.

Ah, so!

Jerry
 
J

John Woodgate

Jan 1, 1970
0
I read in sci.electronics.design that Ben Bradley
There have been three or four articles on the piano in Scientific
American over the past 30 or 40 years, and I recall reading the above
description of the string changing phase in one of them.

If one or both of the outer strings shifts phase, in such a way that the
bridge can twist, the decay is different from the case where the middle
string shifts (relatively).
 
C

CBFalconer

Jan 1, 1970
0
Jonny said:
That's funny! All the ideas are smart.

What's funny? What ideas?

Usenet messages need to stand by themselves. There is no guarantee
that any older messages are available to the receipient. That is
why we quote the relevant portions, and post replies after (or
intermixed with) the quoted portion. The google usenet interfact
is seriously broken, but you can live with it if you follow the
instructins below in my sig.
 
F

Frnak McKenney

Jan 1, 1970
0
Followup-To:

The converse of a statement proves nothing. ;-)

And now for something completely off-the-scale:

While I'm barely at the "hacker" stage in my DSP knowledge (I'm
still working out how modulating a reflected mm-wavelength signal can
yield accurate distance measurement over thousands of mm), I have
been following the threads in this Subject-line with great interest.

I'm particularly fascinated with the complexity of obtaining a
"useful" or "pleasing" tuning for a musical instrument. I hadn't
realized that there were multiple "standard" ways of tuning a piano,
for example. Thank you all for giving me an excuse to renew my
Usenet Lurker's License. <grin>

I'd like to ask one question, though, regarding the tuning process
for instruments involving mechanical vibration -- not just the ones
someone referred to as "plucked" but also percussion instruments and
probably others. If, as some have mentioned, the tuning of stringed
instruments is made more difficult because people pluck the strings
differently (is this the same as "attack". or is that a "keyboard
only" term?) and the sound changes over time (decay), why not add a
feedback loop into the process?

That is, why not have the "tuning instrument" induce the vibration
as well as analyze the resulting sound. A PWM-speed-controlled
motor with a _gentle_ off-center cam is probably not the only
approach. but it doesn't seem very difficult to do (certainly no
more difficult than analyzing the pure sine wave coming from a
guitar string <grin>).

Is there a reason that "tuning instruments" (at least, the ones
I've seen and the ones discussed here) only analyze sounds and don't
attempt to apply controlled signal stimulation? Or is it that such
already exist and are simply too expensive for everyday use?


(Whoops! I think I just violated my ULL! Time to re-cloak... er,
re-Lurk. <grin>)

Frank McKenney, McKenney Associates
Richmond, Virginia / (804) 320-4887
Munged E-mail: frank uscore mckenney ayut minds pring dawt cahm (y'all)
 
Top