This is an alpha release of a DSTM mixer that uses Musly to obtain 'similar' tracks, and then (optionally) uses Essentia to filter these 'similar' tracks by BPM, Key (using Camelot Wheel), loudness, and (if tracks analysed on Linux) other attributes (such as danceability, aggressiveness, etc.).
There are two parts to this plugin:
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:
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.
Further details may be found on the Music Similarity github page.
[Edit] I have removed links to the 'music-similarity' ZIPs, as I will no longer be updating them. When MusicSimilarity is released it will be as one ZIP file without the Essentia binaries, Essentia models, and ffmpeg executables. Links to these will be give in the 'INSTALL.md' files for each relevant OS.
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.
MusicSimilarity is still under development so 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).
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.
[Edit] As stated later i this thread, I have found that 'bliss-rs' can be used as a replacement for Musly, under Linux at least, and this (with my library) seems to provide better mixes.
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
Code:
./music-similarity/music-similarity.py -l DEBUG
[Edit] I have removed links to the 'music-similarity' ZIPs, as I will no longer be updating them. When MusicSimilarity is released it will be as one ZIP file without the Essentia binaries, Essentia models, and ffmpeg executables. Links to these will be give in the 'INSTALL.md' files for each relevant OS.
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.
MusicSimilarity is still under development so 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).
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.
[Edit] As stated later i this thread, I have found that 'bliss-rs' can be used as a replacement for Musly, under Linux at least, and this (with my library) seems to provide better mixes.
Comment