You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The *beets-xtractor* plugin lets you, through the use of the [Essentia](https://essentia.upf.edu/index.html) extractors, to obtain low and high level musical information about your songs.
7
10
8
-
The *beets-xtractor* plugin lets you use the extractors of the [Essentia](https://essentia.upf.edu/index.html) project developed by the Music Technology Group.
9
-
10
-
11
-
*NOTE: This plugin is highly unstable and not at all documented! Use it at your own risk*
11
+
Currently, the following attributes are extracted for each library item: `average_loudness`, `bpm`, `danceable`, `gender`, `genre_rosamerica`, `voice_instrumental`, `mood_acoustic`, `mood_aggressive`, `mood_electronic`, `mood_happy`, `mood_party`, `mood_relaxed`, `mood_sad` (some more to come soon)
12
12
13
13
14
14
## Installation
@@ -17,16 +17,138 @@ The plugin can be installed via:
17
17
```shell script
18
18
$ pip install beets-xtractor
19
19
```
20
+
and activated the usual way by adding `xtractor` to the list of plugins in your configuration:
21
+
22
+
```yaml
23
+
plugins:
24
+
- xtractor
25
+
```
20
26
27
+
### Install the Essentia extractors
28
+
You will also need the two binary extractors from the [Essentia project](#credits). They are called:
21
29
22
-
## References
23
-
[Essentia](https://essentia.upf.edu/index.html)
30
+
- streaming_extractor_music
31
+
- streaming_extractor_music_svm
32
+
33
+
Unfortunately, only the first extractor is readily available for download whilst to have the second one you will need to compile it yourself. The [official installation documentation](https://essentia.upf.edu/installing.html) is somewhat complex but with some cross searching on internet you will make it. If you are stuck you can use the [Issue tracker](https://github.com/adamjakab/BeetsPluginXtractor/issues). Make sure you compile with Gaia support (`--with-gaia`) otherwise your second `streaming_extractor_music_svm` will not be built.
34
+
35
+
### Download the SVM models
36
+
The second extractor uses prebuilt trained models for prediction. You need to download these from here: [SVM Models](https://essentia.upf.edu/svm_models/) I suggest that you download the more recent beta5 version. This means that your binaries must match this version. Put the downloaded models in any folder from which they can be accessed.
37
+
38
+
39
+
## Configuration
40
+
All your configuration will need to go under the `xtractor` key. This is what your configuration should look like:
First of all, you will need adjust all paths. Put the paths of the extractor binaries in `low_level_extractor`and `high_level_extractor`, substitute the location of the SVM models with your local path under the `svm_models` desction. And finally, set the `output_path` to indicate where the extracted data files will be stored. I you do not set this, a temporary path will be used.
73
+
74
+
By default both `keep_output` and `keep_profile` options are set to `no`. This means that after extraction (and the storage of the important information) the profile files used to pass to the extractors and the json files created by the extractors will be deleted. There are various reasons you might want to keep these files. One is for debugging purposes. Another is to see what else is in these files (there is a lot) and maybe to use them with some other projects of yours. Lastly, you might want to keep these because the plugin only extracts data if these files are not present. If you store them, on a successive extraction, the plugin will skip the extraction and use these files (they are named by `mb_trackid`) - speeding up the process a lot.
75
+
76
+
The `items_per_run` set to 0 will execute on all items. If you want to limit the number of items per execution (maybe because you want to run a nightly cron job in a limited timeframe) you can use this.
77
+
78
+
The `force` option instructs the plugin to execute on items which already have the required properties.
79
+
80
+
The `threads` option sets the number of concurrent executions. If you remove this option the number of cores present on your machine will be used. The extraction is quite a CPU intensive process so there might be cases when you want to limit it to just 1.
81
+
82
+
The `write` option instructs the plugin to write the extracted attributes to the media file right away. Note that only `bpm` is actually written to the media file, all the other attributes are flex attributes and are only stored in the database.
83
+
84
+
The `dry-run` option shows what would be done without actually doing it.
85
+
86
+
**NOTE**: Please note that the `auto` option is not yet implemented. For now you will have to call the xtractor plugin manually.
The plugin has also got a shorthand `xt` so you can also invoke it like this:
99
+
100
+
$ beet xt [options] [QUERY...]
101
+
102
+
103
+
The following command line options are available:
104
+
105
+
**--dry-run [-d]**: Only show what would be done - displays the extracted values but does not store them in the library.
106
+
107
+
**--write [-w]**: Write the values (bpm only) to the media files.
108
+
109
+
**--threads=THREADS [-t THREADS]**: The number of concurrently running executions.
110
+
111
+
**--force [-f]**: Force the analysis of all items (skip attribute checks).
112
+
113
+
**--count-only [-c]**: Show the number of items to be processed and exit. Extraction will not be executed.
114
+
115
+
**--quiet [-q]**: Run without any output.
116
+
117
+
**--version [-v]**: Display the version number of the plugin. Useful when you need to report some issue and you have to state the version of the plugin you are using.
118
+
119
+
These command line options will override those specified in the configuration file.
120
+
121
+
122
+
## Issues
123
+
- If something is not working as expected please use the Issue tracker.
124
+
- If the documentation is not clear please use the Issue tracker.
125
+
- If you have a feature request please use the Issue tracker.
126
+
- In any other situation please use the Issue tracker.
Essentia is an open-source C++ library with Python bindings for audio analysis and audio-based music information retrieval. It is released under the Affero GPLv3 license and is also available under proprietary license upon request. This plugin is just a mere wrapper around this library. [Learn more about the Essentia project](http://essentia.upf.edu)
0 commit comments