a music client for MPD aimed at helping you to feed and manipulate your playlist with great flexibility
Please note that MPDC is not necessarily meant to replace your current MPD client, this is just an uncommon but useful supplement.
It is quite annoying to always have to select the songs you want to listen to before you really can start enjoying them. But ordinary playlists cannot provide music for all your moods since the complexity of your music library is huge and your tastes are various. That is why MPDC introduces a new concept for MPD: collections, similar to XMMS2’s.
Python 3.2 or newer is required!
Dependencies: mpd, mpc, zenity, python-mpd2, python-ply
$ git clone git://github.com/nhrx/mpdc.git $ cd mpdc $ sudo python3 setup.py install $ mpdc-configure
MPDC is still in development, so if you encounter a problem with the program, please open a bug report.
If you want to suggest or develop new features, feel free to visit the project page on GitHub. The code is distributed under the MIT license.
By default, five collections are already defined and can be used by simply typing their name:
all: all the music of the library
c: all the songs of the current playlist
C: the currently playing song
A: all the songs by the artist of the currently playing song
B: all the songs of the album of the currently playing song
These collections will be particularly useful when you will combine several collections to reach a specific goal.
Filters are at the heart of the collections. They allow you to select all the songs that meet a specific criterion, and for this purpose they rely on the tags of the audio files or their path on the hard drive.
Filters’ syntax looks like
filter"pattern" where “filter” is a short alias that corresponds to a particular search criterion:
a: search on the tag “artist”
ab: search on the tag “album artist”
b: search on the tag “album”
t: search on the tag “title”
n: search on the tag “track”
g: search on the tag “genre”
d: search on the tag “year”
c: search on the tag “composer”
p: search on the tag “performer”
f: search on the file path, starting from the music directory of MPD
e: search on the file extension
x: search on any of these criteria
If a lower-case letter is used to denote the filter, the search is partial and case-insensitive.
If a capital letter is used to denote the filter, the search is exact and case-sensitive.
Example: let’s say you have some songs tagged with artist = The Beatles. The collection
a"beatles" will include all these songs, as well as the collection
A"The Beatles", contrary to the collection
You should see collections as mathematical sets. With operators, you can manipulate collections, to extend them with others, to subtract them from others, etc. so as to get a new collection consisting of all the songs of the resulting set:
collection1+collection2: the union of collection1 and collection2 (the collection which contains all the songs of collection1 and collection2)
collection1.collection2: the intersection of collection1 and collection2 (the collection which contains all the songs the two collections have in common)
collection1-collection2: the difference (or complement) of collection1 and collection2 (the collection which contains all the songs of collections1 that are not member of collections2)
collection1%collection2: the symmetric difference of collection1 and collection2 (the collection which contains all the songs of either collection1 or collection2 but not of both)
Note: brackets can be used to extend the order, the precedence of operations, as in any mathematical expression.
all-A"Dire Straits"contains all the songs by a different artist than Dire Straits
f"pink floyd/".b"the wall"-n"3"contains The Wall album by Pink Floyd except the third track
e"flac".(d"2012"+(t"love".g"rock"))contains all the 2012 songs and the rock songs including the word “love” in their title, only if they are in the Flac format
Finally, besides filters and operators, a collection can contain modifiers which act on the whole collection on the left. Modifiers’ syntax looks like
|modifier where “modifier” is the name of the modifier you want to use.
rN: keep only N random songs from the collection
raN: keep only the songs by N random artists from the collection
rbN: keep only the songs of N random albums from the collection
dN: select some songs randomly so that the total playing time is close to N minutes
all|r20includes 20 random songs among the whole music library
a"pink floyd"|rb2includes 2 albums by Pink Floyd, selected randomly
g"ambient"|d35includes 35 minutes of ambient music
Note: the modifiers have a low precedence.
A"Yes"+A"The Beatles"|r15 will only include 15 songs, by Yes or the Beatles, whereas
A"Yes"+(A"The Beatles"|r15) will contain all the songs by Yes with 15 songs by the Beatles.
Now that we can describe collections, let’s see how we can use them in order to manipulate MPD.
The program is divided into four parts:
mpdc-collections. Below are the main commands the last two provide. For the full list of commands, have a look at the advanced usage page.
Note: without any argument,
mpdc-collections open a graphical input box which allows you to type your command without thinking about the quotes you would need to put around the arguments if you wrote the command in a shell. It can also be convenient for keybindings.
add the songs of the collection to the playlist
add the collection to the playlist and play the first added song
insert the collection after the currently playing song
remove the collection from the playlist
keep in the playlist only the songs of the collection — equivalent to
replace the entire playlist by the collection
replace the entire playlist by the collection and play the first track
play the first song of the playlist that is in the collection
p t"let it be"will allow you to jump quickly to this song.
clear the playlist
list all the songs of the collection