DIGITAL GUITAR AUTO-TUNER PROJECT

Somebody called me that once, and I thought it was rather cute, so started using it, for the times that I'm consciously being a wacko. :-)

As to who's the asshole, ISTR responding to a "please do this for me" type of post, and I made a casual offer to do the work, for a price. Lessee...

Oh, yeah. Here it is:

----excerpt---- From: snipped-for-privacy@hotmail.com (dhaevhid) ... its actually a qualifying sample project for my first job. ... im tryin to do it all by myself but its taking me so long to understand the concepts...

----end excerpt---

So, in other words, you're not qualified for the job, so you want us to help you cheat your way in. _That's_ what the asshole part was for.

--
Cheers!
Rich
 Click to see the full signature
Reply to
Rich The Newsgroup Wacko
Loading thread data ...

...

Ah, come now! Even in the best of guitars, the frets are located by "the rule of nineteen". Pianos and fretted instruments have tuning similarities (although you can't "bend" a piano).

Do you know Roland Hutchinson? (He was quite taken with the selectable temperaments on my recently acquired Yamaha "piano".)

Jerry

--
Engineering is the art of making what you want from things you can get.
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Reply to
Jerry Avins

My needle-based digital tuner reacts quite quickly. I can see the note appear sharp as it is first plucked, then watch it settle in to a fairly constant reading for several seconds until it fades away. In this case, it is up to me as the user to ignore that initial transient reading and wait for the steady state. Doing so is quite natural.

Reply to
Jon Harris

Sorry, but I can't find any references to an "Old Lady of Bean". )-;

Thanks, Rich

Reply to
Rich Grise

Poor you! My hearing is perfectly flexible.

Jerry

--
Engineering is the art of making what you want from things you can get.
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Reply to
Jerry Avins

A digital filter is quite simple. It is just a bunch of multiplies and divides on each sample. However if you have to do the multiply in software, you'll never make it fast enough, at least with the tiny microcontrollers that are out there. A PIC 16 series requires between

500 and 700 instructions for a multiply. Using a Zilog Z8 Encore, or a PIC 18 clocked at 20MHz, you could probably do 6 simultaneous IIR filters using the same A/D channel (there are web pages that will write the 'C' code for you, given the frequencies and passband width. Translating that into asm is trivial.)

By filtering a 10Hz passband for each string, it's possible you will be able to do the zero crossing thing, and then both select the string, and give guidance on which way to tune as relative error. However, that is a guess, since I haven't tried it.

--
Regards,
  Bob Monsen
Reply to
Bob Monsen

I know that you are right, but it puzzles me. It seems to me that the common bridge should enforce harmonicity, just as it locks together the slightly detuned piano doubles and triplets. (Exact tuning makes the note loud ans it's decay rapid. Slight detuning softens the attack, hoarding energy for better sustain. The same is true of a 12-string guitar.)

It is a real challenge to build 5.0000 and 5.0001 MHz oscillators on the same chassis, even with crystals, that will actually beat. The evaporation thickness/rate monitor I wrote of in another thread worked around that problem.

Jerry

--
Engineering is the art of making what you want from things you can get.
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Reply to
Jerry Avins

I read in sci.electronics.design that Rich Grise wrote (in ) about 'OT DIGITAL GUITAR AUTO-TUNER PROJECT', on Mon, 25 Apr 2005:

There was an old lady of Bean Whose musical ear was not keen. She said, 'It is odd, But I cannot tell 'God save the weasel' from 'Pop goes the Queen'.

Bean is a village in Kent, which used to be a quiet backwater. Now it has a motorway for bedfellow and a huge retail complex (Bluewater:

formatting link
for near neighbour. Soon it will have another complex nearby.

--
Regards, John Woodgate, OOO - Own Opinions Only.
There are two sides to every question, except
 Click to see the full signature
Reply to
John Woodgate

Marching harmonics are not likely to affect any one period by more than ten percent. If you count the total time for 100 periods, the accuracy becomes one part per thousand. To that, you must add the uncertainty of your time measurement, up to perhaps two ticks on the counter.

In a way analogous to a bell's "clang tone", the harmonic structure changes rapidly when the string is first plucked. Don't measure the first part of the note, and don't try for such a long measurement that the note fades away.

Jerry

--
Engineering is the art of making what you want from things you can get.
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Reply to
Jerry Avins

Apparently, the very high and very low notes on pianos are tuned with a larger than 2:1 octave. The ratio can be up to 2.025:1. The claim(1) is that that this is caused by beat matching, trying to match the fundamental to the 2nd harmonic, which is slightly off due to the stiffness of the strings.

Thus, it may not make sense to do precise electronic tuning on stringed instruments. I always find that my guitar sounds better when I match the harmonic on the 5th fret of the bottom string to the top string, and then interpolate. That makes the high E somewhat sharp (but not nearly as sharp as a piano, due to the lower string tension.)

(1) Musical Acoustics, Donald Hall, pg 188.

--
Regards,
  Bob Monsen
Reply to
Bob Monsen

I know. I was just giving an example that was guitar-specific in response to a point that someone else made that equal temperament was bad.

Reply to
Jon Harris

If indeed the FFT's resolution is poor, that can have two reasons:

1) the FFT was done badly, or on insufficient input 2) the uncertainty principle on waves applies

If a correctly done FT fails to deliver the necessary frequency resolution on the given data, then no other technique is going to work. The fundamental problem is not the FT, it's the data: the frequencies found in a given data sample are *undefined* beyond a certain accuracy.

--
Hans-Bernhard Broeker (broeker@physik.rwth-aachen.de)
Even if all the snow were burnt, ashes would remain.
Reply to
Hans-Bernhard Broeker

This phenomenon has been well-studied for pianos where precise tuning is much more important. It is called "inharmonicity", and it is due to the stiffness of the strings. The overtones are theoretically pure harmonics only for an infinitely thin string with zero stiffness, where the restoring force is totally due to the tension in the string. When part of the restoring is force is due to stiffness in addition to tension, then higher overtones will be higher in pitch than pure multiples because higher overtones involve more bending than lower overtones. A typical overtone series might be:

1.000 (fundamental) 2.003 (second partial) 3.008 (third partial) 4.015 (fourth partial) 5.024 (fifth partial) 6.035 (sixth partial) ...etc.

The effect may be less on guitars than on pianos because the length to thickness ratio is not as bad on a guitar. But it is still enough of an effect to be considered in the design of a tuner.

-Robert Scott Ypsilanti, Michigan

Reply to
Robert Scott

High order lowpass?

Reply to
Aleksandar Kovacevic

s.e.d. = sci.electronics.design. I think this was a joke, playing off the word "temperament". Get it?

Reply to
Jon Harris

Keep in mind that many guitar players tune their open strings to the harmonics rather than to the frets.

This doubles (or quadruples, in the case of the B-string) the apparant beat frequency.

Reply to
Charles Krug

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

2,3,4,5,6,7... Not only even-order.

If your input signals do not cover as much as an octave, you band-pass filter them before you FFT them. That gets rid of the harmonics.

--
Regards, John Woodgate, OOO - Own Opinions Only.
There are two sides to every question, except
 Click to see the full signature
Reply to
John Woodgate

That is interesting. The book I referenced mentioned another possibility for why the stretch occurs. The human ear has far less ability to discriminate pitch at low and high frequencies than it does in the middle range. The other possibility was that the extra bit was required to overcome this inability, forcing the ear to hear an octave. However, the text also states that studies by Backus indicate that the mechanism of string inharmonicity accounts for most of the stretching..

I guess you have listened to these pianos. Do the high strings sound flat?

--
Regards,
  Bob Monsen
Reply to
Bob Monsen

I have a friend who claims to have had perfect pitch until her 55th birthday or thereabouts, at which point her perfect pitch started to go low (or high, I can't remember which). Anyway, it disturbed her quite a lot, because it made her favorite recordings seem out of pitch. I guess it would be like having all your green things suddenly turn yellow. You might get used to it, but it would be disconcerting.

Regards, Bob Monsen

Reply to
Bob Monsen

as

....

hence

The number of points used for resolution can be independant of the duration of the music input signal and the sample rate. See comments in other comp.dsp threads about FFT interpolation and zero padding.

What makes you think I haven't? Depending on the circumstances (type of instrument, amount and type of background noise, microphone characteristics, cpu power available, preferred user interface, etc.) and metrics (cents accuracy, response time, etc.), methods using FFTs as part of an algorithm can be either better or worse than the method you describe later on in this thread.

-- Ron Nicholson rhn AT nicholson D o T c O m

Reply to
rhnlogic

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.