Add more build instructions d4837b30 parent d0718cde

authored by Polochon_street

1
[![crate](https://img.shields.io/crates/v/blissify.svg)](https://crates.io/crates/blissify)
2
[![build](https://github.com/Polochon-street/blissify-rs/workflows/Rust/badge.svg)](https://github.com/Polochon-street/blissify-rs/actions)
3
4
# Blissify - analyze an MPD library and make smart playlists
5
6
Blissify is a program used to make playlists of songs that sound alike
7
from your [MPD](https://www.musicpd.org/) track library, à la Spotify radio.
8
9
Under the hood, it is an [MPD](https://www.musicpd.org/) plugin
10
for [bliss](https://crates.io/crates/bliss-audio).
11
12
Blissify needs first to analyze your music library, i.e. compute and store
13
a series of features from your songs, extracting the tempo, timbre,
14
loudness, etc.
15
16
After that, it is ready to make playlists: play a song to start from, run
17
`blissify playlist 30`, and voilà! You have a playlist of 30 songs that
18
sound like your first track.
19
20
Note: you *need* to have MPD installed to use blissify. Otherwise, you
21
probably want to implement bliss-rs support for the audio player you use.
22
23
# Installation / Usage
24
25
You'll need clang, pkg-config and ffmpeg libraries (including development
26
headers) to install it, as well as a
27
[working Rust installation](https://www.rust-lang.org/tools/install)
28
29
On Debian-based systems:
30
31
$ sudo apt install -y build-essential pkg-config libavutil-dev libavformat-dev \
32
libavfilter-dev libavdevice-dev libclang-dev libsqlite3-dev
33
34
On Archlinux:
35
36
$ sudo pacman -S base-devel clang ffmpeg
37
38
Finally, use `cargo install blissify` to install it.
39
40
Note: if you are using a raspberry pi and its corresponding ffmpeg
41
(i.e. `ffmpeg -version|grep rpi` gives back something), use
42
`cargo install --features=rpi blissify` instead.
43
44
45
All the commands below read the `MPD_HOST` and `MPD_PORT` environment
46
variables and try to reach MPD using that. You might want to change
47
it if MPD is listening to somewhere else than `127.0.0.1:6600` (the default).
48
It should be fully compatible with [the MPD documentation](https://mpd.readthedocs.io/en/latest/client.html#connecting-to-mpd).
49
50
## Analyze a library
51
52
To initialize and analyze your MPD library, use
53
```
54
$ blissify init /path/to/mpd/root
55
```
56
57
Note that it may take several minutes (up to some hours, on very large
58
libraries with more than for instance 20k songs) to complete.
59
60
You can further update your library by running
61
```
62
$ blissify update
63
```
64
65
If something goes wrong and the database enters an
66
unstable state, you can use
67
```
68
$ blissify rescan
69
```
70
to remove the existing database and rescan all files.
71
72
If you want to see if the analysis has been successful, or simply want to see
73
the current files in the database, you can use
74
```
75
$ blissify list-db
76
```
77
78
## Make a playlist
79
80
### Simple version
81
82
```
83
$ blissify playlist 100
84
```
85
86
This will add 100 songs similar to the song that is currently
87
playing on MPD, starting with the closest possible. This will also remove
88
all the others songs previously in the queue, leaving only the smart playlist.
89
90
If you wish to queue the songs after the current playing song but keep the
91
current queue, you can use the `--keep-current-queue` flag, like so:
92
93
```
94
$ blissify playlist 100 --keep-current-queue
95
```
96
97
### Changing the distance metric
98
99
To make a playlist with a distance metric different than the default one
100
(euclidean distance), which will yield different playlists, run:
101
102
```
103
$ blissify playlist --distance <distance_name> 30
104
```
105
106
`distance_name` can currently be `euclidean` or `cosine`. Don't hesitate to
107
experiment with this parameter if the generated playlists are not to your
108
linking!
109
110
### Make a "seeded" playlist
111
112
Instead of making a playlist with songs that are only similar to the first song,
113
from the most similar to the least similar (the default), you can make a
114
playlist that queues the closest song to the first song, then the closest song
115
the second song, etc, effectively making "path" through the songs.
116
117
To try it out (it can take a bit more time to build the playlist):
118
119
```
120
$ blissify playlist --seed-song 30
121
```
122
123
### Make an album playlist
124
125
You can also make a playlist of albums that sound like the current album
126
you're listening to (more specifically, the album of the current song you're
127
playing, regardless of whether you queued the full album or not).
128
129
To try it out:
130
131
```
132
$ blissify playlist --album-playlist 30
133
```
134
135
If you wish to queue the albums after the current playing album, but keep the
136
current queue, you can use the `--keep-current-queue` flag, like so:
137
138
```
139
$ blissify playlist --album-playlist 100 --keep-current-queue
140
```
141
142
### Make an interactive playlist
143
144
Interactive playlists start from a song, and let you choose which song should
145
be played next among the 3 closest songs (the number of songs displayed
146
can be set manually):
147
148
```
149
$ blissify interactive-playlist --number-choices 5
150
```
151
152
By default, it crops the current playlist to just keep the currently played
153
song. If you want to just start from the last song and continue from there, use
154
`--continue`:
155
156
```
157
$ blissify interactive-playlist --number-choices 5 --continue
158
```
159
160
### Dry run mode
161
162
If you want to see which playlist blissify would make without changing the
163
queue at all, or you wish to plug blissify's output somewhere else, you
164
can use the `--dry-run` option, like so:
165
166
```
167
$ blissify playlist 100 --dry-run
168
```
169
170
# Details
171
172
If you are interested about what is happening under the hood, or want to make
173
a similar plug-in for other audio players, see
174
[bliss' doc](https://docs.rs/crate/bliss-audio/).
175
176
# Troubleshooting
177
178
If you are compiling blissify-rs for non-linux OSes, you might run into an
179
error telling you to use the bindgen feature:
180
181
```
182
error: failed to run custom build command for `bliss-audio-aubio-sys v0.2.2`
183
184
Caused by:
185
process didn't exit successfully: `path/release/build/bliss-audio-aubio-sys-fb4d0ec74b3698ed/build-script-build` (exit status: 101)
186
--- stderr
187
thread 'main' panicked at .cargo/registry/src/index.crates.io-6f17d22bba15001f/bliss-audio-aubio-sys-0.2.2/build.rs:34:13:
188
No prebuilt bindings. Try use `bindgen` feature.
189
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
190
warning: build failed, waiting for other jobs to finish...
191
error: failed to compile `blissify v0.4.1`, intermediate artifacts can be found at `/var/folders/pb/g43q604n6v71kwp_89ccy6840000gn/T/cargo-installoyKiUv`.
192
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.
193
```
194
195
To fix this and build blissify-rs successfully, use `cargo install blissify --features=default,bliss-audio/update-aubio-bindings`.
196