1 .. _configuration-examples:
6 Configuration location is ``${XDG_CONFIG_HOME}/mpd_sima/mpd_sima.cfg`` usually ``${XDG_CONFIG_HOME}`` is in ``${HOME}/.config/``.
12 MPD_sima runs without explicit configuration as long as your MPD server is easy
13 to discover (``localhost:6600`` or exposed via environment variables ``MPD_HOST``/``MPD_PORT``).
15 The default configuration is to run in *track mode* with suggestions from
16 last.fm. In addition to `Lastfm` plugin set in **[sima]** section (within *internal*
17 option) there is a `Crop` plugin (keeps 10 tracks behind the currently playing
18 track) and a `Random` plugin (acting as a fallback if `Lastfm` did not find any
24 # Change MPD server here
25 #host = mpdserver.example.org
29 internal = Crop, Lastfm, Random
44 One of the first request added to MPD_sima was album mode. It allows to queue whole album instead of single tracks.
46 Here the configuration keeps the queue plugin *Lastfm* but configures it to queue albums (``queue_mode = album``) and ask for 2 albums to be add.
48 The configuration of MPD_sima in ``sima`` section is also modified for ``queue_length``. The value of 10 is to trigger album queueing when there are 10 tracks or less in the queue.
53 internal = Crop, Lastfm, Random
68 In addition to LastFm there are other *plugins* you can mix together or use alone to have a specific queue mode.
72 With this mode MPD_sima is trying to queue tracks with genre tag similar to previously played tracks.
77 internal = Crop, Genre, Random
87 This mode allows random queuing with different flavour **pure** (total
88 randomness) or **sensible** (use play history to filter chosen tracks).
89 The **sensible** flavour will then tend to play track not in recently played.
91 The history duration is important for this plugin when running in **sensible** flavour since you might exhaust possible tracks to queue if the **history_duration** is larger than the total play time you have in your music library.
96 internal = Crop, Random
97 history_duration = 168
105 This is the most complex and versatile offline mode. "Tags" plugin allows to queue track based on actual tags value.
107 Here is an example to have MPD_sima to queue only electronic music tagged with genres **electronica** or **IDM** or **glitch**:
112 internal = Crop, Tags
115 # Look for files with tagged with genre "electronica" OR "IDM" OR "glitch"
116 genre = electronica, IDM, glitch
118 There are other supported tags, mainly **date**, **originaldate** or
119 **comment** (cf manual for the exact list). You can use more than one, entries
120 in tags sections are ANDed within a single MPD filter to look for titles.
122 For instance setting "genre=rock" and
123 "date=1982,1983,1984,1985,1986,1987,1988,1989" will end up looking for track
124 tagged with genre rock and date within 1982 through 1989:
129 internal = Crop, Tags
133 date = 1982,1983,1984,1985,1986,1987,1988,1989
135 In case you want to make complex search in MPD library you can provide an `MPD
136 filter`_. This is a powerful feature, it comes at the cost of a different syntax, some might find it more readable some wont :D
138 For instance in the previous example you can simply replace **date** with the
139 current filter "`(date =~ '198[2-9]+')`":
144 internal = Crop, Tags
148 filter = (date =~ '198[2-9]+')
150 And even go further and merge genre in the filter using "`(genre == 'rock') AND
151 (date =~ '198[2-9]+')`".
156 internal = Crop, Tags
159 filter = (genre == 'rock' ) AND (date =~ '198[2-9]+')
161 Since the setup for the filter can be tricky and it can be useful to validate
162 the syntax and have a look at what kind of artists the filter would return.
164 You can call MPD_sima to controls the configuration file. For instance with a config in `sima.cfg` run:
168 ./mpd-sima --log-level info --config sima.cfg config-test
171 .. include:: ../links.rst
173 .. vim: spell spelllang=en