DIGITAL GUITAR AUTO-TUNER PROJECT - Page 7

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View
Re: DIGITAL GUITAR AUTO-TUNER PROJECT

   ...

Quoted text here. Click to load it

Exactly!

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

Re: DIGITAL GUITAR AUTO-TUNER PROJECT
Quoted text here. Click to load it

Brass intruments are dominated by second and third order effects, so
it's really hard to get conclusive explanations.  Particularly when the
player is an active part of the feedback loop (ears - chops - horn -
sound).  Often, a little resistance in the horn helps the player move
more easily between the partials.  Just as often, thinking that the horn
will sound/play different/better is enough to make it so.

Kelly

Re: DIGITAL GUITAR AUTO-TUNER PROJECT
Quoted text here. Click to load it

I thought I knew what I was doing when I did it, but (as always) I'm
open to correction. I had read (and still believe) that because baroque
horns were hand made, therefore slightly irregular in the bore, they had
lower Q, making it possible -- though difficult -- to play without
valves. (Horn players were the elite of baroque orchestras, usually
seated on a raised platform as, I read, a mark of honor.) Baroque
mouthpieces had relatively larger bores, too, making the player's mouth
part of the resonant cavity. Valves were first used to make playing
easier. It seems likely that when machine-made instruments made nearly
impossible to play without valves, nobody noticed. I could do little
about the mouthpiece, but it was easy enough to "modify" the bore. Not
needing a section with valves, a bugle's bore is more conical than a
trumpet's, hence more compliant to the player's skill.

That trombone that was pulled a long way: was there anything special
about the mouthpiece?

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

Re: DIGITAL GUITAR AUTO-TUNER PROJECT
PROJECT', on Sat, 30 Apr 2005:

Quoted text here. Click to load it

I don't know. Perhaps.
--
Regards, John Woodgate, OOO - Own Opinions Only.
There are two sides to every question, except
We've slightly trimmed the long signature. Click to see the full one.
Re: DIGITAL GUITAR AUTO-TUNER PROJECT
Quoted text here. Click to load it

The nice thing about a microprocessor-controlled tuner is that it
can be configured to match multiple "good" settings...  assuming
these can be defined in a way so they can be recognized.
 
Quoted text here. Click to load it

Fair enough, I can see how a violin's "tuning" can be tweaked by
minor adjustments of the fingers, and a trombone is also offers a
continuous frequency spectrum.  Not sure if that makes a self-
stimulating tuner _useless_ -- it just says that it's probably not a
useful approach for some (perhaps many) instruments.

Ignoring the electronic synthesizer (I just ran across a couple of
hex-shafted ferrite-slug-coil tuning wands <grin>), which
instruments might benefit? Guitar&fretted, piano&friends... drums?
I have _no_ idea how (or if) one tunes a xylophone...

I admit that my interest is a combination of a life as a consultant
("Wait a minute!  I can make that much MUCH better!") as well as
several frustrating years trying to tune a guitar to match a tin ear
(my own).  So far, my picture of this thing is a slim wand with a
microphone, a string of LEDs (TooLow...TooHigh) and a pager motor
with a hard-rubber- coated cam, but I admit I'm probably not going
to build it _this_ week.  <grin>


Frank McKenney, McKenney Associates
Richmond, Virginia / (804) 320-4887
Munged E-mail: frank uscore mckenney ayut minds pring dawt cahm (y'all)
--
    There is one thing even more vital to science than intelligent
    methods; and that is, the sincere desire to find out the truth,
We've slightly trimmed the long signature. Click to see the full one.
Re: DIGITAL GUITAR AUTO-TUNER PROJECT
On Sun, 24 Apr 2005 11:05:19 -0700, Walter Harley
Quoted text here. Click to load it

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.


Re: DIGITAL GUITAR AUTO-TUNER PROJECT
Just so you know, using an FFT for this purpose is going to lead
to huge disappointment. It's not the way to go.

- The frequency resolution will be too poor, because obviously you
can only use a very limited number of points in this application.

- You will face having to decide what peak to choose when analysing
the resulting FFT. This is not so obvious as you will notice there
are nasty transients.

Re: DIGITAL GUITAR AUTO-TUNER PROJECT
Quoted text here. Click to load it

Only if you use an FFT naively.

Quoted text here. Click to load it

Incorrect.  For single pitch detection, one can use as many points as
the signal-to-noise ratio will allow.

Given a sufficient signal-to-noise ratio, one can always interpolate more
points between FFT frequency bins (using a windowed-Sync, not a linear
interpolation of course), and/or zero-pad the samples for a longer
FFT with as many points as you want.  There are also other methods,
depending on the amount of memory and CPU cycles available.

Quoted text here. Click to load it

One does have to determine which local maxima are nearest (or near
multiples of) the pitch of interest, but there are several methods to
help with this (autocorrelation, cepstral, template pattern matching or
even back-propogation neural net techniques).

Quoted text here. Click to load it

Not sure what you mean here.  You do need to make sure your FFT output
looks like it might represent a musical note of interest, and not just
background noise between notes.


IMHO. YMMV.
--
Ron Nicholson   rhn AT nicholson DOT com   http://www.nicholson.com/rhn/
#include <canonical.disclaimer>        // only my own opinions, etc.

Re: DIGITAL GUITAR AUTO-TUNER PROJECT
Quoted text here. Click to load it

You are incorrect, because you didn't think of the real-world problem
here.

You can't use as many points as you want, for two reasons: the guitar
string signal doesn't last forever, and as I said, it evolves in various
"nasty" (well, to the engineer) ways while it lasts.

To increase resolution, you have to increase the number of points, hence
the duration of the take. As I just said, this is not a real option.
Besides, even if the played open string lasted long enough (which is not
that obvious), the longer the time it takes for your tuner to give you
the pitch, the more useless your tuner is (just try to tune a guitar
with a tuner that needs 5 seconds to give you the current pitch, good
luck).

Padding with zeros to artificially increase the number of points without
having to analyze a longer take will quickly prove not very useful
either in this particular application because of all the transients.

But don't take my word for it. Just do it. I did and I claim it's
not the way to go. You'll see.
If you can come up with a usable and accurate guitar tuner using an
FFT only, please show us. I'll be glad to hear from it.
Meanwhile, no commercial tuner that I know of uses an FFT.

Re: DIGITAL GUITAR AUTO-TUNER PROJECT
I read in sci.electronics.design that Guillaume <"grsNOSPAM at
NOTTHATmail dot com"@?.?.invalid> wrote (in
AUTO-TUNER PROJECT', on Mon, 25 Apr 2005:
Quoted text here. Click to load it

How do they work, then?  (The answer 'Very well' is not acceptable.)
--
Regards, John Woodgate, OOO - Own Opinions Only.
There are two sides to every question, except
We've slightly trimmed the long signature. Click to see the full one.
Re: DIGITAL GUITAR AUTO-TUNER PROJECT
Quoted text here. Click to load it

Most of them use a simple design. You can find one on CircuitCellar,
and that's pretty much how this is done in commercial products.

It consists of an input stage, which is basically a good low-pass filter
filtering everything above the maximum fundamental frequency it's
supposed to deal with (probably something like 1000 or 1500 Hz), usually
a 2nd order active filter. Then it's followed by a comparator set with
some hysteresis, which can also be an amplifier based on some AOP with
a lot of gain - so that the AOP clips the signal, which is easily
transformed into a digital signal with a schmitt trigger, for instance.
This circuit basically extracts the fundamental frequency of the input
signal with a reasonable usability.

Then the comparator's output can be dealt with in various ways.
Some can be rather crude (just measuring the frequency of the resulting
digital signal), some are more clever, and I like the one that's used
in the CircuitCellar project. The comparator's output goes to a digital
I/O pin of a microcontroller, of course set as an input. The algorithm
used consists of measuring the delay between two consecutive raising
edges - but this is not all. To make sure the measure is meaningful,
several consecutive measures are compared, and only if we get a few
(like 10, for instance) consecutive measures that are close enough
to one another, do we consider this is the fundamental frequency.
The latter is computed from the period, using for instance an average of
the 10 given "meaningful" past measures.

By comparing the frequency with a few preset ranges, the tuner can
even guess what the string it is you're trying to tune, and
automatically give you how far away you are from the nominal
frequency for this string.

As to how the above input stage, based on a filter and a saturation
stage, translates in the frequency domain (in other words, how
the spectrum of the original signal is transformed), I'll let you
think about it. It resembles, but is not quite like simply looking
at zero-crossings - because the saturation on the signal actually
tends to "ignore" the harmonics, whereas simple zero-crossing
analysis has to deal with them.

All in all, this is a working approach and it's much simpler than any
sophisticated DSP analysis you might try.

Re: DIGITAL GUITAR AUTO-TUNER PROJECT
I read in sci.electronics.design that Guillaume <"grsNOSPAM at
NOTTHATmail dot com"@?.?.invalid> wrote (in
AUTO-TUNER PROJECT', on Mon, 25 Apr 2005:

Quoted text here. Click to load it


Thanks for the explanation. It gels with my thinking on the subject.

Quoted text here. Click to load it

Indeed: a very cogent point.
Quoted text here. Click to load it

You said it! Digits are NOT always the answer. Particularly FFT.
--
Regards, John Woodgate, OOO - Own Opinions Only.
There are two sides to every question, except
We've slightly trimmed the long signature. Click to see the full one.
Re: DIGITAL GUITAR AUTO-TUNER PROJECT
Quoted text here. Click to load it

Thank you for the thorough explanation!

The tuners I've been using seem to be able to guess the tone within
one half, i.e. 5.9% in frequency. This seems to work pretty well,
even though the detection is sometimes inconviniently slo.

However, I've always suspected the tuner measures the frequency
directly and after that finds the nearest note from a LUT and
then calculates the remainder. There is a LED bar display
to show which note (A, A#, B, C, ...) is playing and then an
analog meter to show the deviation from the even temperament
(+-50 cents).

The tuner is quite fine with violins, flutes, and even piccolo flutes,
but not very good with cellos, double basses, bass viols or other
low instruments. It does find the correct note, but the detection
is then very sensitive to higher-frequency noise.

Quoted text here. Click to load it

But wouldn't a combination of an AGC and a hysteretic comparator
be still better? The saturating stage does give some false
zero crossings even though it filters out a lot. But shouldn't
hysteresis filter all false crossings out, if the sum of
amplitudes of harmonics is smaller than the hysteresis?

---

PLL, anyone? DPLL? In a way a PLL would be the right way to do this,
as the frequency under measurement changes slowly. Locking is,
We've slightly trimmed the long signature. Click to see the full one.
Re: DIGITAL GUITAR AUTO-TUNER PROJECT

   ...

Quoted text here. Click to load it

That seems to suggest that good performance depends in part on a
low-pass filter, and that the cut-off is higher than optimum for low
instruments. That also suggests that an improved model might have a
variable filter or a choice of fixed ones. It tales longer to count
cycles in low notes, but I think that effect must be secondary.

   ...

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

Re: DIGITAL GUITAR AUTO-TUNER PROJECT
Quoted text here. Click to load it

I've agreed so far, but not here. The zero crossings of the comparator's
input and output had better coincide in time (with offset allowed for
hysteresis). Those squiggles away from the crossings will be suppressed,
but they don't matter anyway.

Quoted text here. Click to load it

Some wouldn't even call it DSP, but I processed many signals that way
for many years.

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

Re: DIGITAL GUITAR AUTO-TUNER PROJECT
I'd be interested to read that article - can you recall the issue, or
even the year?

On Mon, 25 Apr 2005 19:38:33 +0200, Guillaume <"grsNOSPAM at
NOTTHATmail dot com"> wrote:

Quoted text here. Click to load it

Tony (remove the "_" to reply by email)

Re: DIGITAL GUITAR AUTO-TUNER PROJECT
Quoted text here. Click to load it
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.

Quoted text here. Click to load it

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


Re: DIGITAL GUITAR AUTO-TUNER PROJECT
On Mon, 25 Apr 2005 07:39:02 +0000 (UTC), snipped-for-privacy@mauve.rahul.net (Ronald

Quoted text here. Click to load it

The Fourier analysis assumes that you have a constant amplitude
_repeatable_ waveform, unfortunately a string instrument does not
generate such signals, so you have to analyze some part after the
initial transient.

Paul
 

Re: DIGITAL GUITAR AUTO-TUNER PROJECT
Paul Keinanen  writes:
Quoted text here. Click to load it

An FFT is only a transform from one set of basis vectors to another.
One need not make any assumptions about what happens outside the
FFT sample window, particularly the assumption that the waveform
will repeat when it doesn't.  And there are several windowing
methods to help deal with any transient artifacts which might be
related to the ends of any data sample window.


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


Re: DIGITAL GUITAR AUTO-TUNER PROJECT
Quoted text here. Click to load it


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 ( snipped-for-privacy@physik.rwth-aachen.de)
Even if all the snow were burnt, ashes would remain.

Site Timeline