A couple weekends ago I had the pleasure of attending and presenting at SF Music Hackday, and SF MusicTech Conference. One company featured heavily in new music technology is EchoNest – a company devoted to a music metadata API for developers.
Echonest is one of the frontrunners in this new industry. You can use APIs like Echonest’s to quickly look up the metadata for most songs. Within milliseconds you can get and save not just the key, bpm, and duration of a song – but also the exact location of each and every beat, the pitch information at every moment, the overall danceability of the song, and more.
Echonest also has library of “remix” functions that perform a wide variety of impressive transformations – for example, reconstructing the a bit of music without using any of the original material (by finding the most similar bit of sound in some other bit of audio), adding cowbell or changing the beat of a song, as well as constructing my favorite – the infinite james brown machine (which does basically what it sounds like … taking a James Brown song, splicing it up into soundbites, and constructing them in such a way to make an infinitely long song by cutting at just the right spots).
My other favorite (and slightly more useful) remix based program takes two songs with different BPMs and fade from one to another while morphing both songs tempos to match. That is, beat matching two songs at different BPMs while fading from one to another.
Unfortunately, none of the current remix functionality is available in real time (until now).
Shown here is an open source C++ project that uses Echonest data to automatically beat match two pieces of music. The crossfader is an xcode project, and uses several basic, open source, libraries to achieve this. Primarily:
- Juce – audio engine and UI
- Echonest – to retrieve beat information
- jsonCpp – for reading Json data from echonest
- SoundTouch – for time stretching the audio
You can download the source at: https://github.com/aaronleese/beat-matching-crossfader.