This is an alpha release of a DSTM mixer that uses 'Musly'
(https://www.musly.org) to obtain 'similar' tracks, and then
(optionally) uses 'Essentia' (https://essentia.upf.edu/) to filter these
'similar' tracks by BPM, Key (using 'Camelot Wheell'
(https://mixedinkey.com/camelot-wheel/)), loudness, and (if tracks
analysed on Linux) other attributes (such as danceability,
aggressiveness, etc.).

There are two parts to this plugin:

  
-  The DSTM plugin, which is a standard LMS Plugin -
  https://github.com/CDrummond/lms-musicsimilarity
-  A python script (music-similarity) used to analyse music tracks,
  create a 'similarity' database, and provide access to query track
  similarity via a simple HTTP API -
  https://github.com/CDrummond/music-similarity
  

The 'music-similarity' script is used to analyse your tracks, and saves
its results to an SQLite database and a Musly 'jukebox' file. (This
'jukebox' is what Musly uses to compute similarities, and contains
binary data taken from the SQLite database. This jukebox can be created
'on the fly' but this can take sometime, hence a cached version is
written to, and read from, disk). Musly itself is *very* fast to analyse
tracks (by default it (my modified version) analyses the middle 2
minutes (starting no later than 3 1/2 minutes into track) of each
track). Essentia, however, is *much* slower. As a rough guide, using
both Musly and Essentia, my 7 year old i7, 8-core, SSD, laptop analyses
around 1140 tracks/hour.

Essentia is used to extract attributes of each track - its BPM, key, and
loudness. If Essentia has been compiled with Gaia/SVM (or Tensorflow) it
can also extract other attributes - such as danceability,
aggressiveness, etc. Supporting these extra attributes on non-Linux
systems will require rebuilding of Essentia. These attributes are stored
in the SQLite database, therefore the Essentia binary is only required
when analysing tracks and is not required when providing the similarity
service.

The script is run in anlysis mode via:


Code:
--------------------
    
  ./music-similarity/music-similarity.py -a m -l DEBUG
  
--------------------


Once your tracks have been analysed the script needs to be run in
'server' mode to allow the LMS plugin to query for similar tracks.


Code:
--------------------
    
  ./music-similarity/music-similarity.py -l DEBUG
  
--------------------


Further details may be found on the 'Music Similarity github page.'
(https://github.com/CDrummond/music-similarity)

I've uploaded an alpha release of the music-similarity analyser and API
server to my Google drive, and created a 0.0.3 release of the LMS
plugin. Links below:

  
-  'music-similarity-all-alpha1.zip'
  
(https://drive.google.com/file/d/1PeQOcPdeTYgXcvMOoWnPLD7M0hJXx-tK/view?usp=sharing)
  All music-similarity files, apart from Essentia extractor, ffmpeg, and
  ffprobe for windows. This is basically a 'release' snapshot of the
  github repo.
-  'music-similarity-linux-x86-64-alpha1.zip'
  
(https://drive.google.com/file/d/1qg5weyrWKs3Dwr2ie_lmTth1OZTqklg3/view?usp=sharing)
  music-similarity for x86 Linux. Musly has been compiled on Fedora, but
  should (not tested) work on other Linux distributions. Essentia
  extractor binary supports extra attributes, and is taken from
  Roland0's LMS Essentia page.
-  'music-similarity-pi-alpha1.zip'
  
(https://drive.google.com/file/d/1vlG5gmYFn7Lt_2CS-fnuCccBO_EXyBcP/view?usp=sharing)
  Cut down build for running the similarity API service on a Raspberry
  Pi. This does not include the Essentia extractor, and the build of
  Musly does not support analysing tracks.
-  'music-similarity-windows-alpha1.zip'
  
(https://drive.google.com/file/d/1bBy5TcxVOYOYzUUdLIOsG-Oi6714FgtK/view?usp=sharing)
  Windows version contains pre-built Musly library and a basic Essentia
  extractor (taken from acousticbrainz.org). Musly uses the ffmpeg/libav
  libraries to decode audio files. However, building this on Windows was
  too much hassle. Therefore, the build of Musly in this ZIP uses the
  commandline ffmpeg and ffprobe binaries (bundled in this ZIP) to
  decode audio files.
-  'LMS Music Similarity plugin'
  
(https://github.com/CDrummond/lms-musicsimilarity/releases/download/0.0.3/lms-musicsimilarity-0.0.3.zip)
  This plugin can be installed manually, or you can install from my
  'repo'
  (https://raw.githubusercontent.com/CDrummond/lms-plugins/master/repo.xml)
  

Example configs are within each ZIP, these will need to be updated with
your specific paths. You can also define "Genre groups" in the LMS
plugin - so that only tracks from similar genres are used.

On my personal setup I analyse tracks on my Linux laptop (e.g. using 2)
and then copy the SQLite database and jukebox files to my Raspberry Pi4
- where LMS (using 5) and the similarity API server (using 3) run.

As this is a alpha release I fully expect there to be issues -
especially on the Windows side, as I'm a 100% Linux user and have not
fully tested this setup. However, I'm interested to get feedback on how
well this works for others, perhaps even what are the best default
settings to use for the plugin side. The LMS plugin adds "Create
Similarity Mix", etc, items to LMS's context menus. These were added at
the request of "afriend", but are not something I actively use and I'm
more interested in feedback on the DSTM side (which is my main use
case).

I have no access to a mac, so currently the code does not explicitly
support this - however Musly can be compiled for macOS and
acousticbrainz.org does have pre-built mac binaries. For Linux and
Windows the code attempts to set the correct config - e.g. libmusy
location, essentia extractor path, etc. For mac you will need to update
config.json for these manually. Or, you can look to editing
lib/config.py and uncomment the mac sections.

If you are going to test, I suggest you create a small subset (e.g. 500
tracks) of your Library - so that you are sure the config works, etc.
before spending hours analysing 1000s of tracks.



*Material debug:* 1. Launch via http: //SERVER:9000/material/?debug=json
(Use http: //SERVER:9000/material/?debug=json,cometd to also see update
messages, e.g. play queue) 2. Open browser's developer tools 3. Open
console tab in developer tools 4. REQ/RESP messages sent to/from LMS
will be logged here.
------------------------------------------------------------------------
cpd73's Profile: http://forums.slimdevices.com/member.php?userid=66686
View this thread: http://forums.slimdevices.com/showthread.php?t=115609

_______________________________________________
plugins mailing list
plugins@lists.slimdevices.com
http://lists.slimdevices.com/mailman/listinfo/plugins

Reply via email to