mpc(1) Program for controlling Music Player Daemon (MPD)

SYNOPSIS

mpc [options] <command> [<arguments>]

DESCRIPTION

mpc is a client for MPD, the Music Player Daemon. mpc connects to a MPD and controls it according to commands and arguments passed to it. If no command is given, the current status is printed (same as 'mpc status').

OPTIONS

-f,--format

Configure the format of song display for status and the playlist. The metadata delimiters are:


%name% Unknown (doesn't produce output)
%artist% Artist file tag
%album% Album file tag
%albumartist% Album Artist file tag
%comment% Comment file tag (not enabled by default in mpd.conf's metadata_to_use)
%composer% Composer file tag
%date% Date file tag
%disc% Disc file tag
%genre% Genre file tag
%performer% Performer file tag
%title% Title file tag
%track% Track file tag
%time% Duration of file
%file% Path of file, relative to mpd's `music_directory` variable
%position% Playlist track number
%mtime% Date and time of last file modification
%mdate% Date of last file modification

The [] operator is used to group output such that if no metadata delimiters are found or matched between '[' and ']', then none of the characters between '[' and ']' are output. '&' and '|' are logical operators for and and or. '#' is used to escape characters. Some useful examples for format are: "%file%" and "[[%artist% - ]%title%]|[%file%]". This command also takes the following defined escape sequences:


\\ - backslash
\[ - left bracket
\] - right bracket
\a - alert
\b - backspace
\t - tab
\n - newline
\v - vertical tab
\f - form-feed
\r - carriage return

--wait

Wait for operation to finish (e.g. database update).
-q,--quiet,--no-status

Prevents the current song status from being printed on completion of some of the commands.
-v,--verbose

Verbose output.
-h,--host
The host to connect to; if not given, the value of the environment variable MPD_HOST is checked before defaulting to localhost. This default can be changed at compile-time.

To use a password, provide a value of the form "password@host".

If you specify an absolute path, mpc attempts a connection via Unix Domain Socket.

-p,--port
The port to connect to; if not given, the value of the environment variable MPD_PORT is checked before defaulting to 6600. This default can be changed at compile-time.

COMMANDS

Commands can be used from the least unambiguous prefix (e.g insert or ins)
add <file>
Adds a song from the music database to the playlist. Can also read input from pipes. Use "mpc ls | mpc add" to add all files to the playlist.
insert <file>
The insert command works similarly to add except it adds song(s) after the currently playing one, rather than at the end. When random mode is enabled, the new song is queued after the current song.
clear
Empties playlist.
crop
Remove all songs except for the currently playing song.
current [--wait]
Show the currently playing song

With --wait, mpc waits until the song changes (or until playback is started/stopped) before it queries the current song from the server.

crossfade [<seconds>]
Gets and sets the current amount of crossfading between songs (0 disables crossfading).
mixrampdb [<db>]
Gets and sets the volume level at which songs with MIXRAMP tags will be overlapped. This disables the fading of the crossfade command and simply mixes the songs. -50.0 will effectively remove any gaps, 0.0 will mash tracks together. The amount of overlap is limited by the audio_buffer_size MPD configuration parameter.
mixrampdelay [<seconds>]
Gets and sets the current amount of extra delay added to the value computed from the MIXRAMP tags. (A negative value disables overlapping with MIXRAMP tags and restores the previous value of crossfade).
del <songpos>
Removes a playlist number from the playlist. Can also read input from pipes (0 deletes the current playing song).
disable [only] <output # or name> [...]
Disables the output(s); a list of one or more names or numbers is required. If "only" is the first argument, all other outputs are enabled.
enable [only] <output # or name> [...]
Enables the output(s); a list of one or more names or numbers is required. If "only" is the first argument, all other outputs are disabled.
idle [events]
Waits until an event occurs. Prints a list of event names, one per line. See the MPD protocol documentation for further information.

If you specify a list of events, only these events are considered.

idleloop [events]
Similar to "idle", but re-enters "idle" state after events have been printed.

If you specify a list of events, only these events are considered.

listall [<file>]
Lists <file> from playlist. If no <file> is specified, lists all songs.
load <file>
Loads <file> as playlist.
ls [<directory>]
Lists all files/folders in <directory>. If no <directory> is specified, lists all files in music directory.
lsplaylists
Lists available playlists.
mv, move <from> <to>
Moves song at position <from> to the position <to> in the playlist.
next
Starts playing next song on playlist.
outputs
Lists all available outputs
pause
Pauses playing.
play <position>
Starts playing the song-number specified. If none is specified, plays number 1.
playlist [<playlist>]
Lists all songs in <playlist>. If no <playlist> is specified, lists all songs in the current playlist.
prev
Starts playing previous song.
random <on|off>
Toggle random mode if state ("on" or "off") is not specified.
repeat <on|off>
Toggle repeat mode if state ("on" or "off") is not specified.
replaygain [<off|track|album>]
Sets the replay gain mode. Without arguments, it prints the replay gain mode.
single <on|off>
Toggle single mode if state ("on" or "off") is not specified.
consume <on|off>
Toggle consume mode if state ("on" or "off") is not specified.
rm <file>
Deletes a specific playlist.
save <file>
Saves playlist as <file>.
search <type> <query> [<type> <query>]...
Searches for substrings in song tags. Any number of tag type and query combinations can be specified. Possible tag types are: artist, album, title, track, name, genre, date, composer, performer, comment, disc, filename, or any (to match any tag).
find <type> <query> [<type> <query>]...
Same as search, but tag values must match <query>s exactly instead of doing a substring match.
findadd <type> <query> [<type> <query>]...
Same as find, but add the result to the current playlist instead of printing them.
list <type> [<type> <query>]...
Return a list of all tags of given tag <type>. Optional search <type>s/<query>s limit results in a way similar to search.
seek [+-][<HH:MM:SS>] or <[+-]<0-100>%>
Seeks by hour, minute or seconds, hours or minutes can be omitted. If seeking by percentage, seeks within the current song in the specified manner. If a "+" or "-" is used, the seek is done relative to the current song position. Absolute seeking by default.
shuffle
Shuffles all songs on the playlist.
stats
Displays statistics about MPD.
stop
Stops playing.
toggle
Toggles between play and pause. If stopped starts playing. Does not support start playing at song number (use play).
update [--wait] [<path>]
Scans for updated files in the music directory. The optional parameter <path> (relative to the music directory) may limit the scope of the update.

With --wait, mpc waits until MPD has finished the update.

version
Reports the version of MPD.
volume [+-]<num>
Sets the volume to <num> (0-100). If "+" or "-" is used, then it adjusts the volume relative to the current volume.
channels
List the channels that other clients have subscribed to.
sendmessage <channel> <message>
Send a message to the specified channel.
waitmessage <channel>
Wait for at least one message on the specified channel.
subscribe <channel>
Subscribe to the specified channel and continuously receive messages.

ENVIRONMENT VARIABLES

All environment variables are overridden by any values specified via command line switches.
MPD_HOST
Specifies the hostname of the mpd server. This can be a hostname, IP address or an absolute path. If it is an absolute path, mpc will use Unix Domain Sockets instead of TCP/IP.

If the server requires a password, it can be specified using password@host in the MPD_HOST variable.

MPD_PORT
Specifies the port the mpd server is listening on.

EXAMPLES


For useful examples of mpc use in playlist parsing, see mpd-m3u-playlist.sh and mpd-pls-playlist.sh.

BUGS

Report bugs on http://bugs.musicpd.org/

NOTE

Since MPD uses UTF-8, mpc needs to convert characters to the charset used by the local system. If you get character conversion errors when you're running mpc you probably need to set up your locale. This is done by setting any of the LC_CTYPE, LANG or LC_ALL environment variables (LC_CTYPE only affects character handling).