C Python CMake
Switch branches/tags
Nothing to show
Clone or download

README.md

Bliss music analyzer v1.0.0

Bliss music library is a C library used to compute distance between songs. It is especially used in leleleplayer. It is can be useful for creating « intelligent » playlists and/or continuous play, à la Spotify/Grooveshark Radio.
Bliss is really useful when used as a plug-in for audio players, so feel free to use the python bindings to develop one for your favorite player!
See ANALYSIS.md for a technical description of the project.

Current projects using Bliss

Usage

  • The main purpose of the library is to extract features from songs in the form of coordinates (tempo, amplitude, frequency, attack).
  • Use bl_analyze() to compute these coordinates for a given song.
  • Use bl_distance_file() to compute the euclidian distance between two songs. The closer the songs are, the more similar they are. Two same songs have a distance that tends towards 0. (This function is merely a wrapper for calling bl_analyze() for each song and computing their euclidian distance)
  • Use bl_cosine_similarity_file() to compute the cosine similarity of two songs: Graph from -1 to 1, 1 = close songs, -1 = opposite songs
  • Python bindings are also available for these functions. See the wiki to learn how to use them.

    These two functions are just examples of what can be done with coordinates in an euclidian space; machine-learning/big data algorithms could also be used to make cool things, such as clustering. See this (article)[https://linuxfr.org/news/sortie-de-la-bibliotheque-d-analyse-musicale-bliss-1-0#performances) [in French]

    The most immediate thing one that can be done to test this library could be to install it and then run python/examples/make_m3u_playlist.py on a folder with random songs in it: it will try to build the best playlist out of the files in the directory.

Dependencies

  • libavformat
  • libavutil
  • libavcodec
  • libswresample (or libavresample, if libswresample isn't present)

If you are running Ubuntu (e.g. 14.04), you should apt-get install libavutil-dev libavformat-dev libavcodec-dev libavresample-dev.

If you are running Arch Linux, pacman -S ffmpeg should be enough.

For the Python bindings

  • python-cffi
  • python-setuptools

Installation

Linux users

  • clone repository on github
$ git clone https://github.com/Polochon-street/bliss.git
  • go to bliss root directory
$ cd bliss
  • Create and enter the build directory
$ mkdir build && cd build
  • Generate the Makefile
$ cmake .. -DCMAKE_BUILD_TYPE=Release
  • Compile the library
$ make
  • Install the library
(root) make install
  • (optional) Install the python bindings
(root) cd python && python setup.py install

Usage examples

  • See examples/analyze.c and examples/distance.c
  • Compile any project using bliss with
$ gcc -o example example.c -lbliss $(pkg-config --cflags libavutil libavformat libavcodec)
  • Examples for python bindings are in python/examples

Unittests

This library comes with some unittests. To build them, just run

$ make test

in the build/ folder. Unittests source files can be found in the tests/ folder.