AcousticBrainz Server consists of two parts: web server that powers acousticbrainz.org website and high-level data extractor that processes incoming low-level information about tracks.
- Python 2.7.x
- PostgreSQL >=9.2 (needs the JSON data type)
- memcached
- pxz for exporting and importing the data
For example in the latest Ubuntu, this command will install pre-requisites:
$ sudo apt-get install python-dev python-virtualenv memcached pxz \
postgresql-9.3 postgresql-client-9.3 postgresql-server-dev-9.3
It is recommended, although optional, to first set up a virtual environment and activate it:
$ virtualenv venv
$ . ./venv/bin/activate
Then use pip to install the required Python dependencies:
$ pip install -r requirements.txt
Copy over config.py.sample to config.py in the acousticbrainz/ directory
and edit its content to fit your environment.
You need to create a new application
and set two variables: MUSICBRAINZ_CLIENT_ID and MUSICBRAINZ_CLIENT_SECRET.
On MusicBrainz set Callback URL to http://<host>/login/musicbrainz/post.
After you tweak configuration file, database needs to be created:
$ python manage.py init_db
Optional: You might want to create a database that will be used by tests:
$ python manage.py init_test_db
After all this, you can run the site/server using ./server.py.
Use ./server.py -h to get a list of command-line switches
to further suit your local environment (e.g., port, listening address, ...).
To run high-level data extractor you'll need two things:
streaming_extractor_music_svmwhich is a part of the Essentia library- svm_models which are available at http://essentia.upf.edu/documentation/svm_models/
To build the extractor binary you'll need to get Gaia and Essentia libraries. Generally, you should use installation instructions provided with them, but to save you some time here's a set of steps that you can follow:
-
git cloneGaia and install it without using additional options during the configuration step -
git cloneEssentia and configure it like this:$ ./waf configure --mode=release --with-gaia --with-example=streaming_extractor_music_svm -
Build Essentia and copy
streaming_extractor_music_svmbinary from build/src/examples/ directory into /high-level in the project root.
Download archive from http://essentia.upf.edu/documentation/svm_models/, extract it, and move contents of svm_models directory into /high-level/svm_models in the project root.
$ cd high-level
$ python hl_calc.py