ftp.nice.ch/pub/next/audio/apps/Tuner.NI.b.tar.gz#/Tuner/Tuner.rtf

This is Tuner.rtf in view mode; [Download] [Up]

Tuner is a software chromatic tuner for determining the musical pitch of a sound as well as how close that pitch is to the established value for the note.  Tuner listens on the NeXT's CODEC microphone input and computes a frequency for the sound it samples.  It maps this frequency onto a musical note and displays the value.  Then it looks up the standard value for the note to display the difference between the standard value and the computed frequency.

The tuner can compute pitch using two different algorithms, by counting zero transitions and by doing a fast Fourier transformation (FFT).  You need a relatively simple waveform for the zero transitions algorithm to work -- some instruments and voices work better than others.  When it works, it has a potential accuracy of about +/- 1/4 Hz.   The FFT algorithm is able to handle more complex waveforms but currently only has a potential accuracy of about +/- 2 Hz.  (The zero transitions algorithm works well with recorders and the FFT algorithm works better with bassoons.)  The potential range of both algorithms is C00 to B7 and both are further constrained by the limits of the microphone.

The tuner waits for two consecutive samples at the same pitch before reporting a result.  In combination with the sampling period, this means that you need at least a couple of seconds of tone to register.

At the top left of the tuner is a staff display showing what note the tuner believes it's hearing.  This is mostly for fun and a sanity check -- in the zero counting transitions mode this display is highly susceptible to harmonics.  This display also has slightly less range than the tuner as a whole so the tuner can still show the accuracy of notes that it can't display on the staff.

At the top right of the tuner are SoundMeter and SoundView objects.  The SoundMeter object represents the amplitude (volume) of the sound being received.  The tuner uses the SoundMeter and the squelch setting (see below) to determine if the sample was loud enough to analyze.  Below the SoundMeter is a SoundView object which is a representation of the waveform.  (Occasionally the SoundView stops working, however it is provided only for feedback purposes and does not affect the tuner.)

At the center of the tuner is a row of grayed out note name buttons with radio buttons above them.  When the tuner determines the pitch of a note, the corresponding note name button is highlighted by changing from gray to black.  The radio buttons above the notes are used to transpose the tuner to work with transposing instruments.  (See the transposition default below).

At the bottom of the tuner is the tuning accuracy slider which indicates how sharp or flat the sample is compared to the defined value for the note.  (The slider is shorter on the flat side than the sharp side since notes aren't linear and the distance to the next higher pitch is slightly greater than the distance to the next lower one.)  If a pitch is flat or sharp, the corresponding flat or sharp sign will highlight by changing from gray to black and the slider will indicate the amount of error.  If the pitch is in tune, both the flat and sharp signs will highlight as will the center marker below the slider.

Tuner has several adjustments that are set using its preferences panel:

Transposition (default = 0, range = -11 to 11)  This is the number of semitones by which to shift the computed note value.  It is set using the radio buttons that appear above the note names in the tuner window.  (It's numeric value is shown on the preferences panel but can't be set from there.)  For example, if you are tuning an E-flat instrument, selecting the radio button above E-flat will cause the tuner to operate as an E-flat instrument.  By default, the radio button above C is selected indicating no transposition.

Calibration (default = 440, range = 428 to 453)  This default is set via the 'A =' box in the preferences panel and is used to set different values for the pitch of A4.  Setting this default will not affect the note name shown on the tuner (use the transposition buttons to affect that), it will only affect the tuning accuracy slider display.

Squelch (default = 0.1, range = 0.0 to 1.0)  This determines how loud a sound sample has to be before the meter will compute its pitch.  It is used to keep the meter from analyzing background noise.  You may need to set it lower if you're trying to determine the pitch of a very soft sound or set it higher if you've a lot of background noise.

SampleTime (default = 0.5, range = 0.25 to 2.0)  This is the number of seconds of sound that the tuner samples.  Currently, you shouldn't set this to much less than 1/2 second.  Since the tuner waits for two consecutive samples that compute to the same frequency before displaying, setting this higher will require a longer settle time.

Tolerance (default = 0.03, range = 0.0 to 1.0)  This determines how close to perfect the tuning accuracy slider has to be before the tuner indicates that the pitch is in tune (by highlighting the center marker and both the flat and sharp signs).

Adjustment (default = 1.0)  This is a fine tuning adjustment that you only need to change if you're unhappy with the tuning results and want to bias the frequency or try to true it to a standard reference like a tuning fork.  (Any correction you make may be specific to the method selected.)  The default value introduces no bias into the frequency computation.  Make sure you've correctly set the transposition, calibration and tolerance settings first.

Method (default = Zero, alternate = FFT)  This is the algorithm used to compute the pitch.  The zero transitions algorithm is more accurate but may not handle complex waveforms.  The FFT algorithm can handle complex waveforms but isn't as accurate.

The Save button will save settings that differ from the system defaults into your defaults database.  The Reset button will reset the current settings to those stored in your defaults file in combination with the system defaults.  To restore the settings to the system defaults, remove any changed values from your defaults database via:  dread -o Tuner | dremove

The preferences panel controls don't allow for the full range of possibilities.  For more extreme settings, you'll need to use dwrite to set the values in your defaults database.

There are some known problems with Tuner.  The SoundView object slowly leaks memory, according to MallocDebug, so this is not an application you want to leave running for extended periods.  As mentioned above, occasionally the SoundView just stops working, but tuner doesn't need it to work.  Rarely, the sound recording process itself also stops working.

The current FFT method is not as flexible as it could be.  Among other problems, it only uses about 1/4 second of any size data sample.  However, it no longer uses the NeXT's DSP chip but rather runs in software to be compatible with i486 and other NEXTSTEP platforms.  Substitution of a faster FFT algorithm could improve both the speed and accuracy.

Tuner 3.0 is free.  Full sources are provided and bug reports and/or suggestions are welcome.

Christopher_Lane@Med.Stanford.EDU

MusicKit Release 4.1 (beta) Copyright © 1994 by CCRMA, Stanford University. 

Lassus font for musical example(s) copyright 1991 by David Rakowski, used by permission.

The libfft component is Copyright © 1989 by Jef Poskanzer and is bound by:

Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation.  This software is provided "as is" without express or implied warranty.

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.