In this guide, we’re going to look at how to Install and configure mpd and ncmpcpp on MacOS. This will cover installation of packages, generation of configuration files and some tweakings for both Mpd and Ncmpcpp.

For Linux users, especially Arch, have a look at

What is Mpd?

For those new to Mpd, it is referred to as Music Player Daemon in full. Mpd is a flexible, powerful, server-side application for playing music. Through plugins and libraries, it can play a variety of sound files while being controlled by its network protocol. Mpd allows you to remotely play your music, handle playlists, deliver music (HTTP streams with various sub-protocols) and organize playlists.

What is Ncmpcpp?

Ncmpcpp is an mpd client for Mpd with a UI interface similar to the one on ncmpc. It also has some good features such as support for regular expressions for library searches, extended song format, items filtering, the ability to sort playlists, and a local filesystem browser.

To be able to use ncmpcpp, you need to have a running mpd service since this is a client/server relationship.

Installing Mpd and Ncmpcpp on macOS

Installation of Mpd and Ncmpcpp on mac is done using brew. If you don’t have a brew command on your Mac, refer to my previous article Install OpenOffice and LibreOffice on MacOS Sierra. It has the steps to install Homebrew.

You can search for the packages using:

$ brew search mpd
==> Formulae
bandcamp-dl         libmpd              libmpdclient        mpd                 mpdas               mpdecimal ✔         mpdscribble         rtmpdump ✔          mpv                 mpc                 mad

==> Casks
cisdem-pdf-converter-ocr             gimp@dev                             jump-desktop-connect                 kmbmpdc                              mps                                  tmpdisk

$ brew search ncmpcpp 
==> Formulae
ncmpcpp                                                                                                         ncmpc

Now that you have Homebrew installed, run the following commands to install mpd and ncmpcpp.

brew install mpd mpc ncmpcpp

Configure Mpd and Ncmpcpp on macOS

Once the installation is done, we need to do some configurations before we can run the applications. We’ll start with Mpd then move to ncmpcpp.

Create Mpd media directories.

mkdir -p ~/.mpd/playlists
touch ~/.mpd/{mpd.conf,mpd.db,mpd.log,mpd.pid,mpdstate}
ls ~/.mpd/

Now create a valid and working ~/.mpd/mpd.conf file which is processed whenever you start mpd daemon.

vim ~/.mpd/mpd.conf

My configuration looks like below, you can modify it to your liking.

music_directory "~/Music"
playlist_directory "~/.mpd/playlists"
db_file "~/.mpd/mpd.db"
log_file "~/.mpd/mpd.log"
pid_file "~/.mpd/mpd.pid"
state_file "~/.mpd/mpdstate"
auto_update "yes"
auto_update_depth "2"
follow_outside_symlinks "yes"
follow_inside_symlinks "yes"

audio_output {
 type "osx"
 name "CoreAudio"
 mixer_type "software"
}

decoder {
 plugin "mp4ff"
 enabled "no"
}

bind_to_address "127.0.0.1"
port "6600"

# Visualizer
audio_output {
 type "fifo"
 name "my_fifo"
 path "/tmp/mpd.fifo"
 format "44100:16:2"
 auto_resample "no"
 use_mmap "yes"
}

Starting Mpd

Start mpd service using the command:

brew services start mpd
# OR
mpd

Update mpd database:

mpc update

Verify the service is running:

brew services list

Mpd process can be killed by running the command.

brew services stop mpd
mpd --kill

Accessing ncmpcpp interface

You can access your ncmpcpp interface by using the command below on your terminal.

ncmpcpp

Update database using

u

See the following complete list of shortcuts:

Up k    : Move Cursor up
r - repeat mode [r-----]
z - random mode [-z----]
y - single mode [--s---] (Repeats the current track after reaching the end.)
R - consume mode [---c--] (Removes the current track from playlist after reaching the end.)
x - crossfade mode [----x-]

     Down j   : Move Cursor down
     Page Up   : Page up
     Page Down  : Page down
     Home    : Home
     End     : End
     Tab     : Switch between playlist and browser
     1 F1    : Help screen
     2 F2    : Playlist screen
     3 F3    : Browse screen
     4 F4    : Search engine
     5 F5    : Media library
     6 F6    : Playlist editor
     7 F7    : Tag editor
     0 F10    : Clock screen
   Keys - Global
  -----------------------------------------
     s      : Stop
     P      : Pause
     >      : Next track
     <      : Previous track
     f      : Seek forward
     b      : Seek backward
     Left -   : Decrease volume
     Right +   : Increase volume
     t      : Toggle space mode (select/add)
     T      : Toggle add mode
     |      : Toggle mouse support
     v      : Reverse selection
     V      : Deselect all items
     A      : Add selected items to playlist/m3u file
     r      : Toggle repeat mode
     Z      : Shuffle playlist
     i      : Show song's info
     I      : Show artist's info
     L      : Toggle lyrics database
     l      : Show/hide song's lyrics
     q Q     : Quit

+ - Increase volume 2%
- - Decrease volume 2%
# - Display bitrate of file
= - Clock
F1 - Help


r - repeat mode [r-----]
z - random mode [-z----]
y - single mode [--s---] (Repeats the current track after reaching the end.)
R - consume mode [---c--] (Removes the current track from playlist after reaching the end.)
x - crossfade mode [----x-]
u - Database update

You should get something like this.

mpd ncmpcpp interface

All my dotfiles for MacOS are available on my gitbub dotfiles repository. Thanks for checking out the Install and configure mpd and ncmpcpp on MacOS guide.