MPDC

MPDC
a music client for MPD aimed at helping you to feed and manipulate your playlist with great flexibility

Features

Please note that MPDC is not necessarily meant to replace your current MPD client, this is just an uncommon but useful supplement.

Philosophy

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.

MPDC
Collections are just subsets of the library and contain all the songs that satisfy a query with user-defined criteria (kind of dynamic playlists). With some mathematical magic, MPDC lets you select any sub-subsets of the library you want and can combine them to bring you a new collection consisting of your desired music.

Installation

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

Next, read the § Quick overview then have a look at the advanced features.

Screenshots

MPDC MPDC

Bugs? Suggestions?

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.

Quick overview

How to describe a collection

By default, five collections are already defined and can be used by simply typing their name:

These collections will be particularly useful when you will combine several collections to reach a specific goal.

Filters

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:

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 A"beatles".

Notes:

Operators

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:

Note: brackets can be used to extend the order, the precedence of operations, as in any mathematical expression.

Examples:

Modifiers

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.

Examples:

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.

List of the main commands

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-configure, mpdc-database, mpdc-playlist, and 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-playlist and 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.

mpdc-playlist

add <collection>

add the songs of the collection to the playlist

addp <collection>

add the collection to the playlist and play the first added song

ins <collection>

insert the collection after the currently playing song

rm <collection>

remove the collection from the playlist

k <collection>

keep in the playlist only the songs of the collection — equivalent to rm c-(<collection>)

re <collection>

replace the entire playlist by the collection

rep <collection>

replace the entire playlist by the collection and play the first track

p <collection>

play the first song of the playlist that is in the collection

Example: if your playlist contains the entire discography of the Beatles, p t"let it be" will allow you to jump quickly to this song.

clear

clear the playlist

mpdc-collections

ls <collection>

list all the songs of the collection

Advanced usage