Skip to content

Musical key detection for digital audio, GPL v3

Notifications You must be signed in to change notification settings

heyigor/libKeyFinder

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

libKeyFinder can be used to estimate the musical key of digital recordings.

It is the basis of the KeyFinder GUI app, which is available as a binary download for Mac OSX and Windows at www.ibrahimshaath.co.uk/keyfinder

For the most basic use case, do something like this:

  // Static because it retains useful resources for repeat use
  static KeyFinder::KeyFinder k;

  // Prepare the default set of parameters
  KeyFinder::Parameters p;

  // Build an empty audio object
  KeyFinder::AudioData a;

  // Prepare the object for your audio stream
  a.setFrameRate(yourAudioStream.framerate);
  a.setChannels(yourAudioStream.channels);
  a.addToSampleCount(yourAudioStream.length);

  // Copy your audio into the object
  while (int i = 0; i < yourAudioStream.length; i++) {
    a.setSample(i, yourAudioStream[i]);
  }

  // Run the analysis
  KeyFinder::KeyDetectionResult r =  k.findKey(a, p);

  // And do something with the result!
  doSomethingWith(r.globalKeyEstimate);

About

Musical key detection for digital audio, GPL v3

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 94.9%
  • Prolog 3.4%
  • Other 1.7%