Command Line Interface

You can analyze audio files by running tuner and passing the filename(s) as arguments. See the man page for details about option arguments.

Wildcards

tuner expects the shell to handle the expanstion of wildcard characters such as *. The default shell on Windows doesn’t do this.

Note

tuner will use saved options from saved_options.ini, except for the pitch and tempo options. Pitch and tempo correction is only done in the GUI.

See Save File.

Saved options can be overridden by command line arguments.

If you don’t want to use saved options at all, use the --savefile option to set the save file to /dev/null (or your operating system’s equivalent). A nonexistent file will also work.

Changed in version 0.11.2: Command line arguments didn’t used to override saved options.

Output

The result should look something like this:

$ tuner 06.Getting_In_Tune_\(1995_remix\).ogg 

06.Getting_In_Tune_(1995_remix).ogg
Getting In Tune (1995 remix)
  Note    Standard     Measured   Discrepancy                         Correction
   G2      98.00 Hz     97.62 Hz   -7 c  [----------I-+------------]     1.004
   D3     146.83 Hz    148.00 Hz  +14 c  [------------+--I---------]     0.992
   G3     196.00 Hz    195.90 Hz   -1 c  [------------I------------]     1.001
   C4     261.63 Hz    262.51 Hz   +6 c  [------------+I-----------]     0.997
   D4     293.66 Hz    294.75 Hz   +6 c  [------------+-I----------]     0.996
   G4     392.00 Hz    393.73 Hz   +8 c  [------------+-I----------]     0.996
   C5     523.25 Hz    526.17 Hz  +10 c  [------------+-I----------]     0.994
   D5     587.33 Hz    590.79 Hz  +10 c  [------------+--I---------]     0.994
   G5     783.99 Hz    787.97 Hz   +9 c  [------------+-I----------]     0.995
   A5     880.00 Hz    885.59 Hz  +11 c  [------------+--I---------]     0.994

This shows information about the most prominent pitches in the audio.

Lower pitches are on top and higher pitches are on the bottom. There may be an option in a future version to reverse this.

Note

This column shows which note in the selected tuning system the pitch is closest to. (It’s not necessarily the note it’s supposed to be, since sometimes audio is so far off it ends up in a completely different key!)

Standard

This column shows the ideal frequency of the note in the selected tuning system.

Measured

This column shows the actual frequency of the pitch in the audio.

Discrepancy

This column shows the discrepancy between the frequencies shown in the Standard and Measured columns.

The number on the left is the discrepancy in cents.

The meters range from -50 c to 50 c. A needle left of center means the pitch is too flat, and a needle right of center means the pitch is too sharp.

Correction

This column shows the pitch correction factor that would center the needle.

If you have mpv installed (not just libmpv2 but the actual mpv program), you can play the audio with the correction applied like this:

mpv --af=rubberband=pitch-scale=$CORRECTION "$FILE"

For example, to play Getting In Tune with a correction factor of 0.995, do this:

mpv --af=rubberband=pitch-scale=.995 "06.Getting_In_Tune_(1995_remix).ogg"

Writing a wrapper shell script to make this more convenient is left as an exercise for the reader.

Color output

When outputting directly to a terminal, tuner makes the dashed lines gray to make the important parts of the meters stand out and be easier to read. This doesn’t work on Windows unless colorama is available.

Use the -c or --color option to force color output even when stdout is going to a file or pipe. If you’re piping to less, use less’s -R option to make it display color, like this: tuner -c * | less -R

Tab Completion

Added in version 0.12.0.

tuner and tuner-gui can generate their own scripts to be added to your shell’s tab completion system. This works for bash, zsh and tcsh. This is done with the --print-completion command line argument, followed by the name of the shell. For example, to generate a bash shell completion script for tuner and write it to a file called “tuner”, run:

tuner --print-completion bash > tuner

The hardest part is figuring out where that file should go. Here’s an excerpt from the bash-completion readme file (/usr/share/doc/bash-completion/README.md.gz on Debian systems):

Q. Where should I install my own local completions?

A. Put them in the completions subdir of $BASH_COMPLETION_USER_DIR
(defaults to $XDG_DATA_HOME/bash-completion or
~/.local/share/bash-completion
if $XDG_DATA_HOME is not set) to have them loaded automatically
on demand when the respective command is being completed.

[…]

Alternatively, you can write them directly in ~/.bash_completion
which is loaded eagerly by our main script.

[…]

…completions are automatically loaded on demand based on invoked
commands’ names, so be sure to name your completion file
accordingly…

For other shells, refer to the appropriate documentation.