This small utility is the automation-oriented DJs best friend. By making use of Ibrahim Sha'ath's high quality libKeyFinder library (now maintained by Mixxx DJ), this utility can be used to estimate the musical key of many different audio file formats.
Installing this software exposes the keyfinder-cli command on your system.
The most basic usage of this utility is to provide a path to an audio file, it will quickly compute the estimated global music key of the audio file and print it to stdout.
$ keyfinder-cli AMajor.mp3
AIn the case that there is no key (silence) nothing will be printed to stdout and the program will exit with a 0 status code.
Three different key notations are supported and can be toggled:
-
-n standardfor Standard Key NotationKeys are outputted using the standard notation. For example,
Ebis equivalent to E flat.Ais equivalent to A Major. Sharps are not used. This is the default notation mode used to output keys when no other options are specified -
-n openkeyfor Open Key NotationKeys are outputted using BeaTunes Open Key notation. Keys like
1mare equivalent to C Major. This is what Traktor uses for it's key notation. -
-n camelotfor Camelot Key NotationKeys are outputted using the Camelot Easymix Wheel notation. Similar to Open Key notation
8Bis equivalent to C Major.
You will need to have the following dependencies installed on your machine
- ffmpeg (This was not tested with
libav) - libkeyfinder
As long as these two dependencies are installed then you should be able to simply type:
$ cmake -DCMAKE_INSTALL_PREFIX=/where/you/want/to/install/to -S . -B build
$ cmake --build build
$ cmake --install build