An open-source library that evaluates distance between songs


What is Bliss?

Bliss is a library used to compute distance between two songs. It can be useful for creating « intelligent » playlists, for instance, and is used as such in leleleplayer and Blissify.

The main algorithm works by outputing a vector V = (a,b,c,d) for each song. The euclidean distance between these vectors corresponds to the actual distance felt by listening to them: a playlist can then be built by queuing close songs, or do other stuff using mathematical tools available on euclidean 4-dimensionnal spaces.

Bliss is written in C, uses ffmpeg, and its source code is also available on Github. Like leleleplayer, it's still in development, so don't hesitate to make contributions, bug reports and bugfixes!

Library usage

Once installed (see below), use the -lbliss compilator flag, and don't forget to #include <bliss.h> to your code.

You can then use the following functions:

Functions postfixed by "_file" takes a filename as arguments; the other take struct song as arguments. A struct song is obtained by using the bl_audio_decode() function, and contains some information about the song: number of samples, title...

There are also Python bindings that can be set up and used this way. Thanks to Phyks and fossfreedom for the creation and testing of these bindings!


64-bits packages and shared dll are available for Archlinux, Debian/Ubuntu and Windows.







You can also build it from source (see below), or make a package for your distro!

Build from source

If you don't use our packages, or if there is no package available for your operationg system, you can still build Bliss from source, given that you have FFmpeg installed on your system.

Then, execute the following:
$ git clone # Retrieve the source
$ cd bliss # Go to the created directory
$ mkdir build && cd build # Create and enter the build directory
$ cmake .. -DCMAKE_BUILD_TYPE=Release # Generate the makefile
$ make # Compile it
# make install # Install it
# cd python && python install # optional: install the python bindings

Technical details

The analysis process works this way:
For every song analyzed, libbliss returns a struct song which contains, among other things, four floats, each rating an aspect of the song: