Featureful ncurses based MPD client inspired by ncmpc with integration for Beets, spectrum visualization,Bandcamp/Soundcloud, asciimatics, cantata, and more
MusicPlayerPlus is a character-based console and terminal window music player
mppcava
fzf
The MusicPlayerPlus project provides integration and extension of several audio packages designed to stream and play music. MusicPlayerPlus interacts with the Music Player Daemon (MPD). Outputs from the MPD streaming audio server are used as MusicPlayerPlus inputs for playback and visualization. MusicPlayerPlus components are used to manage and control MPD and ALSA configuration.
MusicPlayerPlus integrations and extensions are primarily aimed at the character-based terminal user. They enable an easy to use seamlessly integrated control of audio streaming, playing, music library management, and visualization in a lightweight character-based environment.
Audio streaming is provided by the Music Player Daemon (MPD).
At the core of MusicPlayerPlus is the mpplus
command which acts as
a front-end for a variety of terminal and/or tmux
sessions.
The mpplus
command can be used to invoke:
mpcplus
tmuxp
fzf
[Note:] Typical use of mpplus
as a music player and spectrum visualizer
will invoke a tmux
session to display the MPD client, spectrum visualizer, and
album cover art all in a single terminal window. MusicPlayerPlus configures
tmux
with a custom key binding to exit tmux sessions. To exit an mpplus
tmux session, the Alt-x
key binding can be used.
Integration is provided for:
The goal of MusicPlayerPlus is to provide the user with a sophisticated set of complex music library tools that can be integrated and managed in a fairly simple to understand fashion. Also, to make some cool looking powerful stuff happen from the command-line in a character-based environment.
MusicPlayerPlus is compiled and packaged for installation on Linux platforms. It has been tested on the following platforms:
Installation and initialization require admistrative privilege. The mppinit
command, executed after installing MusicPlayerPlus, installs several packages
and therefore requires access to the Internet along with administrative
privilege (e.g. sudo
privilege).
Memory and storage requirements depend upon the size of the music library.
With a moderate sized music library, the Music Player Daemon can exceed a 2GB memory capacity. Therefore, 4GB or more of memory is recommended.
Storage should be sized to adequately host what will likely be a growing music library. Plan ahead and leave your library room to grow. A few hundred Gigabytes of storage might suffice for some music libraries but a Terabyte or more will provide room to grow. Testing is performed on systems with 4GB RAM and 2TB storage using a 600GB music library.
Essentia metadata extraction, Blissify similarity analysis, and transcoding all consume significant CPU resources. Testing has been performed on systems with the following CPU resources:
All of these processors were able to handle significant loads. However, import, metadata extraction, and transcoding are all much quicker on the 8 x Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz system. Although not necessary, these infrequent operations consume much less time on a more powerful CPU.
MusicPlayerPlus adds the following commands to your system:
fzf
fuzzy finder and mpc
MPD clientThe bliss-analyze
and blissify
commands are currently not available on
Raspberry Pi installations due to lack of support for that architecture in
the ffmpeg
library.
[Note:] MusicPlayerPlus functions as a front-end and management system for
any MPD/Mopidy/Navidrome client. The default MPD client is mpcplus
but any
MPD client can be configured by setting MPD_CLIENT
in ~/.config/mpprc
.
While mpcplus
is the recommended MPD client, ncmpcpp
is also supported
with some integration for visualizer data source management. Other MPD clients
available for use with MusicPlayerPlus include ncmpc, pms, vimpc, pimpd2,
nncmpp, mmtc, and mpq.
Additional detail and info can be found in the MusicPlayerPlus Wiki.
$HOME/Music
artist/album/songs
mppinit
command as your normal user
$HOME/Music
and $HOME/music
for music library locationmppinit -l /path/to/library
For many installations, installing the MusicPlayerPlus package and initializing
the user configuration with the mppinit
command is all that need be done.
Some common additional setup steps that can be performed include:
Configure the music library location by editing ~/.config/mpprc
and setting
MUSIC_DIR
to your music library location (default setting is ~/Music
).
Optionally configure any additional settings in ~/.config/mpprc
such as
your preferred terminal emulator, Bandcamp username, Soundcloud slug, or
more. Any changes to ~/.config/mpprc
must be followed by running the command
mppinit sync
.
[Important Note:] MusicPlayerPlus integrates several services, each of
which has its own configuration for the location of the music library. Because
of this, MusicPlayerPlus provides its own configuration file
~/.config/mpprc
. The MUSIC_DIR
setting in that config file is used as the
source of truth for the location of the music library. In order to keep all
of the services in sync with respect to the music library location, set the
location in ~/.config/mpprc
and run the command mppinit sync
.
If the music library is moved to a new location, repeat this procedure.
Download albums in your Bandcamp collections with mppinit bandcamp
.
Download favorites in your Soundcloud account with mppinit soundcloud
.
The following optional post-initialization steps can be performed individually
as described below or they can be performed in two steps using mppinit
.
Step 1, import the music library into Beets:
mppinit import
The mppinit import
command converts any WAV format media to MP3 format
and imports the music library into the Beets media library management system.
[Note:] A Beets import can take hours for a large music library. A test import using a music library over 500GB in size, with nearly 4000 artists, 3000 albums, and over 30,000 tracks consumed nearly 12 hours. Import times will vary from system to system and library to library depending on several factors. The above test may provide a ballpark idea of the length of time a Beets library import might take.
When the import is complete
Step 2, retrieve additional metadata:
mppinit metadata
The mppinit metadata
command identifies and deletes duplicate tracks,
retrieves album genres from Last.fm, downloads album cover art, and
(optionally) analyzes and retrieves metadata for all songs in the music library.
[Note:] A Beets metadata retrieval can take hours for a large music library.
The MusicPlayerPlus default Beets configuration uses ffmpeg
to compute
checksums for every track in the library to find duplicates.
An optional audio analysis can be performed during metadata retrieval. MusicPlayerPlus provides several optional methods for acoustic analysis. The method used for acoustic analysis and retrieval can be specified on the command line:
mppinit -a metadata
mppinit -b metadata
mppinit -e metadata
If none of the -a, -b, or -e
options are specified then acoustic
analysis, extraction, and retrieval is performed by Essentia.
The AcousticBrainz service is the fastest method but is being retired in 2023, the service is no longer being updated, and it is often inaccurate.
The Essentia acoustic analysis is the most thorough, adds acoustic metadata to the Beets library management system, and provides the greatest flexibility but at a cost of possibly days of analysis and extraction time. Metadata analysis and extraction with Essentia is the default behavior.
The Blissify analysis creates a similarity database of all songs in the music library. This can be used to automate the creation of playlists and other actions. The drawback of using Blissify is it does not add acoustic metadata to the Beets library so the results of a Blissify analysis are only available to Blissify and not Beets.
[Note:] Acoustic analysis with blissify
is currently not available on
Raspberry Pi installations due to lack of support for that architecture in
the ffmpeg
library.
It is sometimes desirable to augment one acoustic analysis with another. For example, the AcousticBrainz service seems to think a lot of songs have 0 beets per minute and tags them erroneously. After retrieving metadata using AcousticBrainz, list the songs that have a bpm value of 0:
beet list bpm:0
These songs can get an accurate setting for bpm and other audio parameters
by following the mppinit -a metadata
command with mpplus -X bpm:0
.
Download albums in your Bandcamp collections with mppinit bandcamp
.
Download favorites in your Soundcloud account with mppinit soundcloud
.
Convert WAV or M4A format media files in your library to MP3 format files with
the command mpplus -F
or mpplus -G
. Conversion from WAV to MP3 allows these
files to be imported into the Beets media library management system. Conversion
from M4A (Apple ALAC) to MP3 allows these files to be streamed and played in all
browsers supporting HTML5 audio (not necessary with Navidrome streaming).
If you wish to manage your music library with Beets, import the music library
with the command mpplus -I
.
Album cover art can be downloaded with the command mpplus -D art
.
Bandcamp collections can be downloaded with the command mpplus -D bandcamp
.
Soundcloud favorites can be downloaded with the command mpplus -D soundcloud
.
Download additional lyrics with the command mpplus -L
.
Activate the YAMS scrobbler for Last.fm with the command mpplus -Y
.
Analysis and retrieval of audio-based information can be performed with
the command mpplus -X 'query'
where ‘query’ is a Beets library query.
The special query term ‘all’ indicates the entire music library, i.e.
mpplus -X all
. Alternatively, query the AcousticBrainz service with
mpplus -x all
or create a “song similarity” database using Blissify
with mpplus -B
.
These common additional setup steps and more are covered in greater detail in the MusicPlayerPlus Beets README and the Post Installation Configuration section below.
To summarize, a MusicPlayer quickstart can be accomplished by:
mppinit
or mppinit -l /path/to/library
as your normal userMUSIC_DIR
by editing ~/.config/mpprc
mppinit sync
~/.config/mpprc
and run mppinit sync
mppinit bandcamp
mppinit soundcloud
mppinit import
mpplus -F
mpplus -I
mppinit metadata
beet duplicates -d
beet move
mpplus -D art
mpplus -B
creates a “song similarity” database with Blissify
mpplus -X all
analyze the entire Beets library with Essentiampplus -X 'query'
where ‘query’ is a Beets library querympplus -x all
query AcousticBrainz for the entire Beets librarympplus -Y
mpplus -L
The entire full tilt boogie initialization, for those with both Bandcamp and Soundcloud accounts with songs and albums in a collection or liked, and who wish to apply thorough, reliable, complete, and accurate metadata:
# Initialize MusicPlayerPlus, activate Music Player Daemon
# This is the only required setup step
mppinit
# For Bandcamp and Soundcloud users, a convenient way to download
mppinit bandcamp
mppinit soundcloud
# Beets library import (can take hours)
mppinit import
# Install, configure, and activate Mopidy music server
mppinit mopidy
# Install, configure, and activate Navidrome streaming music server
mppinit navidrome
# Perform analysis and extraction of acoustic metadata with Essentia
# This background process can take hours or even days for a large library
mppinit metadata
MusicPlayerPlus v2.0.1 and later can be installed on Linux systems using the Arch packaging format, the Debian packaging format, or the Red Hat Package Manager (RPM).
MusicPlayerPlus has been tested successfully on the following platforms:
MusicPlayerPlus_<version>-<release>-any.pkg.tar.zst
MusicPlayerPlus_<version>-<release>.deb
MusicPlayerPlus_<version>-<release>.rpm
MusicPlayerPlus_<version>-<release>.rpm
MusicPlayerPlus_<version>-<release>.deb
Many Linux distributions, most notably Ubuntu and its derivatives, use the Debian packaging system.
To tell if a Linux system is Debian based it is usually sufficient to
check for the existence of the file /etc/debian_version
and/or examine the
contents of the file /etc/os-release
.
To install on a Debian based Linux system, download the latest Debian format package from the MusicPlayerPlus Releases.
Install the MusicPlayerPlus package by executing the command
sudo apt install ./MusicPlayerPlus_<version>-<release>.deb
or
sudo dpkg -i ./MusicPlayerPlus_<version>-<release>.deb
or, on a Raspberry Pi:
sudo apt install ./MusicPlayerPlus_<version>-<release>.deb
or
sudo dpkg -i ./MusicPlayerPlus_<version>-<release>.deb
Red Hat Linux, SUSE Linux, and their derivatives use the RPM packaging format. RPM based Linux distributions include Fedora, AlmaLinux, CentOS, openSUSE, OpenMandriva, Mandrake Linux, Red Hat Linux, and Oracle Linux.
To install on an RPM based Linux system, download the latest RPM format package from the MusicPlayerPlus Releases.
Install the MusicPlayerPlus package by executing the command
sudo dnf localinstall ./MusicPlayerPlus_<version>-<release>.rpm
or
sudo rpm -i ./MusicPlayerPlus_<version>-<release>.rpm
Arch Linux, Manjaro, and other Arch Linux derivatives use the Pacman packaging format. In addition to Arch Linux, Arch based Linux distributions include ArchBang, Arch Linux, Artix Linux, ArchLabs, Asahi Linux, BlackArch, Chakra Linux, EndeavourOS, Frugalware Linux, Garuda Linux, Hyperbola GNU/Linux-libre, LinHES, Manjaro, Parabola GNU/Linux-libre, SteamOS, and SystemRescue.
To install on an Arch based Linux system, download the latest Pacman format package from the MusicPlayerPlus Releases.
Install the MusicPlayerPlus package by executing the command
sudo pacman -U ./MusicPlayerPlus_<version>-<release>-any.pkg.tar.zst
[Note:] Extensive post-installation steps are covered here.
Minimal post-installation configuration required is the execution
of the command mppinit
. If the MPD music library is located in
the default $HOME/Music
directory then no further configuration
may be necessary. See the Quickstart section.
After installing MusicPlayerPlus there are several recommended
configuration steps. If not already configured, the MPD server
will need to know where to locate your music library. This can
be configured by editing the MusicPlayerPlus configuration file
~/.config/mpprc
and running the command mppinit sync
.
Initialize the MusicPlayerPlus configuration by executing the command:
mppinit
Examine the generated configuration in ~/.config/mpprc
and make any desired changes.
The client configuration performed by mppinit
includes the configuration
of an MPD user service. The configuration, files, and folders used by
this user level MPD service are stored in ~/.config/mpd/
. Examine the
generated MPD configuration file ~/.config/mpd/mpd.conf
.
MusicPlayerPlus 2.0.1 release 3 and later provides the configuration file
~/.config/mpprc
which serves as the primary source for MusicPlayerPlus
user configurable settings. This configuration file is the “source of truth”
for several settings including the music library location. Settings in
mpprc
are propogated throughout several other component’s configurations.
The settings in mpprc
are dynamic and preserved across command invocations.
The dynamic nature of this configuration file means that options specified
on the mpplus
command line or in the mpplus
menu system are written back
out to ~/.config/mpprc
so the next invocation of mpplus
will use the
previous invocation’s options and settings as the default.
The default installed mpprc
contains:
## MusicPlayerPlus runtime configuration
#
# After modifying any of the following settings, run the command:
# mppinit sync
# as your normal MusicPlayerPlus user
## Music library location
#
MUSIC_DIR="~/Music"
# MPD client
MPD_CLIENT="mpcplus"
## General settings
#
# To enable any of these, set to 1
# For example, to enable cover art display in tmux sessions set COVER_ART=1
#
# Play audio during asciimatics animations
AUDIO=1
# Display cover art in tmux sessions
COVER_ART=1
# Display mpcplus and mppcava in a tmux session
USE_TMUX=1
## Terminal emulator / display mode
#
# Can be one of: console, current, gnome, kitty, retro, simple, tilix
# Where:
# 'console' will force a tmux session
# 'current' will force a tmux session in the current terminal window
# 'gnome' will use the gnome-terminal emulator if installed
# 'kitty' will use the Kitty terminal emulator if installed
# 'retro' will use cool-retro-term if installed
# 'simple' will use the ST terminal emulator if installed
# 'tilix' will use the Tilix terminal emulator if installed
# Default fallback if none specified or not available is Kitty
#
# Uncomment the preferred mode
#MPP_MODE=console
#MPP_MODE=current
#MPP_MODE=gnome
#MPP_MODE=retro
#MPP_MODE=simple
#MPP_MODE=tilix
MPP_MODE=kitty
## Service access
#
# The Bandcamp username can be found by visiting Bandcamp 'Settings' -> 'Fan'
# If you do not have a Bandcamp account, leave blank
BANDCAMP_USER=
# The Discogs username can be found by visiting discogs.com. Login, use the
# dropdown of your user icon in the upper right corner, click on 'Profile'.
# Your Discogs username is the last component of the profile URL.
DISCOGS_USER=
# The Discogs API token can be found by visiting
# https://www.discogs.com/settings/developers
DISCOGS_TOKEN=
# Location of the generated custom Discogs Obsidian vault
# Can be anywhere you have write permission
DISCOGS_DIR="~/Documents/Obsidian/Discogs"
# Your Last.fm username, api key, and api secret
# If you do not have a Last.fm account, leave blank
LASTFM_USER=
LASTFM_APIKEY=
LASTFM_SECRET=
# The Soundcloud user slug can be found by logging in to Soundcloud
# click on the username at top right then 'Profile'. The user slug
# is the last component of the URL when viewing your Soundcloud Profile.
# If you do not have a Soundcloud account, leave blank
SOUNDCLOUD_SLUG=
# Your Spotify client id and client secret
# If you do not have a Spotify account, leave blank
SPOTIFY_CLIENT=
SPOTIFY_SECRET=
# Your YouTube api key
# If you do not have a YouTube account, leave blank
YOUTUBE_APIKEY=
After mppinit
completes the MusicPlayerPlus initialization, edit the
~/.config/mpprc
configuration file and run mppinit sync
.
[Note:] MusicPlayerPlus version 1.0.3 release 1 and later perform
an automated MPD user configuration and systemd service activation.
This is performed by the mppinit
command. MusicPlayerPlus 1.0.3r1
and later installations need not perform the following manual procedures
but users may wish to review the automated MPD configuration and alter
the default MPD music directory location.
The default MPD and mpcplus
music directory is set to:
$HOME/Music
If your media library resides in another location then perform the following
steps and run mppinit sync
:
$HOME/.config/mpprc
and set the MUSIC_DIR
entry to the location of your music library (e.g. vi ~/.config/mpprc
)mppinit sync
commandFor example, to set the MPD music directory to the /u/audio/music
directory,
edit $HOME/.config/mpprc
and change the MUSIC_DIR setting:
MUSIC_DIR="/u/audio/music"
The MUSIC_DIR location must be writeable by your user.
Any time the MPD music directory is manually modified, run mppinit sync
.
[Note:] Beets is NOT the now defunct music service purchased by Apple. It is an open source media library management system.
MusicPlayerPlus includes the Beets media library management system
and preconfigured settings to allow easy integration with MPD and mpcplus
.
Beets is an application that catalogs your music collection, automatically
improving its metadata. It then provides a suite of tools for manipulating
and accessing your music. Beets includes an extensive set of plugins that
can be used to enhance and extend the functionality of the media library
management Beets provides. Many Beets plugins are installed and configured
automatically by MusicPlayerPlus.
To get started using the Beets media library management system, it is necessary to import your music library into the Beets database. This process catalogs your music collection and improves its metadata. The default Beets configuration provided by MusicPlayerPlus moves and tags files in the music library during this process. It adds music library data to the Beets database. To import your music library into Beets, issue the following command:
mppinit import
or to skip WAV format media conversion and just perform the Beets import:
mpplus -I
[Note:] If additional songs or albums are added to the music library
after the initial Beets import is performed, simply rerun mppinit import
or beet import /path/to/new/items
to import any new library items.
To remove duplicates and retrieve metadata for the newly imported items,
run mppinit metadata
.
After importing the music library into Beets, try playing something with:
beet play QUERY
Where ‘QUERY’ is a valid
Beets query.
This can be a simple string like
“blue” or “love” or a more complicated expression as described in the
Beets query documentation. The Beets play
plugin should match the
query string to songs in your music library, add those songs to the
MPD queue, and play them. Use beet ls QUERY
to see what would be played.
[Note:] MusicPlayerPlus has configured the Beets play plugin
to use the command /usr/share/musicplayerplus/scripts/mpcplay.sh
to play media with this plugin. This script clears the MPD queue,
adds any songs matching the query to the queue, and plays the MPD queue.
In addition, two arguments are supported: --shuffle
and --debug
.
These additional arguments are passed using the --args
feature.
For example, to play all media matching the string “velvet” and shuffle
the order of play, issue the command beet play --args --shuffle velvet
.
Example usage of the beet play
command:
beet play velvet
beet play playlist:1970s
beet play --args --shuffle playlist:1990s
beet play --args "--debug --shuffle" green eyes
For instructions on Beets media library setup and use see the MusicPlayerPlus Beets README.
Learn more about the Beets media library management system at https://beets.io/
MusicPlayerPlus includes two supported methods for augmenting music library metadata through acoustic analysis. These two methods are:
mppinit -e metadata
mppinit -b metadata
A third method using AcousticBrainz is no longer supported:
mppinit -a metadata
Acoustic analysis with Blissify does not require a prior Beets import.
The Blissify acoustic analysis creates a song similarity database for
all the songs in the MPD music library. Initialize the Blissify database
with the command blissify update <mpd music directory>
. For example,
assuming the default MPD music directory:
blissify update ~/Music
Blissify database initialization would have been automatically performed during setup if metadata initialization were done with:
mppinit -b metadata
After initialization of the Blissify database, the blissify
command can
be used to create an MPD playlist based on song similarities. For example,
to make a 30 song playlist that queues the closest song to the currently
playing song, then the closest song to the second song, etc, effectively
making a “path” through the songs, execute the command:
blissify playlist --seed-song 30
To save the current MPD playlist (queue), execute the command:
mpc save <playlist-name>
Note that the acoustic analysis and database creation performed by Blissify does not update the Beets library database. In order to add this additional acoustic metadata to the Beets library it is necessary to perform an acoustic analysis with Essentia or acoustic metadata retrieval with AcousticBrainz, both described in the next sections.
After completing the Beets music library import with either mppinit import
or mpplus -I
, additional Beets metadata can be retrieved with the command:
mppinit -e metadata
This will identify and delete duplicate tracks, retrieve album genres, download album cover art, and optionally analyze and retrieve metadata for all songs in the music library using the Essentia extractor and Essentia trained models.
MusicPlayerPlus mppinit -e metadata
uses Essentia for extracting acoustic
characteristics of music, including low-level spectral information, rhythm,
keys, scales, and much more, and automatic annotation by genres, moods, and
instrumentation.
This is the same sort of thing that AcousticBrainz does but the AcousticBrainz project is no longer collecting data and was withdrawn in 2023. MusicPlayerPlus provides the same functionality using pre-compiled and packaged Essentia binaries and models.
However, the process of analyzing, extracting, and retrieving metadata
can be time consuming for a large music library. The mppinit -e metadata
command performs several metadata retrieval steps in a non-interactive
manner and in the background so it can be left unattended if desired.
[No longer supported]
While it still exists the AcousticBrainz service can be queried to provide
a relatively quick way to update the Beets library with additional
acoustic metadata. The AcousticBrainz service has already analyzed the
acoustic characteristics of songs in the MusicBrainz catalog. To retrieve
this metadata for songs in your music library, after Beets import is complete,
run the command mppinit -a metadata
. Or, at any time after Beets import
run the command beet acousticbrainz
. The AcousticBrainz service is no longer
updated and was retired in 2023.
The individual metadata retrieval steps performed automatically by
mppinit [-a|-b|-e] metadata
can be performed manually using the instructions in
the MusicPlayerPlus Beets README.
YAMS is an acronym for “Yet Another MPD Scrobbler”. When YAMS is configured and running, any songs, artists, or albums played through MPD get “scrobbled” to Last.fm. This enables a tracking of your listening patterns and habits, creating a fairly extensive set of statistics viewable on Last.fm.
Features:
In order to activate the YAMS scrobbler you will need an account with Last.fm.
Free accounts with Last.fm include many of the service features and can
provide extensive listening history statistics. If you do not wish to
use Last.fm to analyze MPD track plays then this optional setup step
can be ignored and no action is required as MusicPlayerPlus disables
YAMS by default. Disable a previously activated YAMS service with the
command mpplus -y
.
Activate the YAMS scrobbler for Last.fm with the command:
mpplus -Y
The activation process must be run in a terminal window and will provide
you with a URL. Copy the URL and navigate to it using a web browser.
This will take you to Last.fm to authenticate if not already logged in
and authorize YAMS access. Once access is authorized there is no need
to authenticate for future Last.fm access with YAMS. There is also no
need to manually run the yams
command as a user service is activated
to run it automatically. Basically, nothing else to do, just play music
and it will be scrobbled by YAMS.
YAMS creates a configuration file $HOME/.config/yams/yams.yml
.
YAMS works fine with Libre.fm, a Free Software replacement for Last.fm. If you prefer to use Libre.fm rather than Last.fm, do the following:
base_url
config variable to https://libre.fm/2.0/
in $HOME/.config/yams/yams.yml
(don’t forget the trailing slash!).lastfm_session
fileslast.fm
with libre.fm
in the authorization URL printed out by YAMSAdjust the audio_output
settings in ~/.config/mpd/mpd.conf
.
MPD must have at least one audio_output
configured and in order
to use the spectrum visualizer as configured by default it is necessary
to configure a second audio_output
in MPD.
The default MPD audio_output
setting is PulseAudio
. To modify the MPD audio
output, uncomment one of ALSA
, PulseAudio
, or PipeWire
and restart MPD.
A FIFO audio_output
is used as a data source for the spectrum visualizer.
To configure this output, add the following to ~/.config/mpd/mpd.conf
:
audio_output {
type "fifo"
name "Visualizer feed"
path "~/.config/mpd/mpd.fifo"
format "44100:16:2"
}
An example ALSA audio_output
configuration in ~/.config/mpd/mpd.conf
:
audio_output {
type "alsa"
name "ALSA"
buffer_time "50000" # (50ms); default is 500000 microseconds (0.5s)
# device "hw:0,0" # optional
# mixer_type "hardware" # optional
# mixer_device "default" # optional
# mixer_control "PCM" # optional
# mixer_index "0" # optional
}
Or, to use PulseAudio:
audio_output {
type "pulse"
name "pulse audio"
device "pulse"
mixer_type "hardware"
}
Output with PipeWire can also be configured:
audio_output {
type "pipewire"
name "PipeWire Sound Server"
}
MPD is a powerful and flexible music player server with many configuration options. Additional MPD configuration may be desired. See the MPD User’s Manual
The fzmp
command lists, searches, and selects media from the MPD
library using the fzf
fuzzy finder command line utility. A default
fzmp
configuration file for each user is created when the mppinit
command is executed. The fzmp
configuration file is located at:
~/.config/mpcplus/fzmp.conf
The initial default fzmp
configuration should suffice for most use cases.
Some of the interactive key bindings may need to be modified if they are
already in use by other utilities. For example, the default key binding to
switch to playlist view is ‘F1’ but the xfce4-terminal
command binds ‘F1’
by default to its help window. In this case either the fzmp
playlist view
key binding must be changed or the XFCE4 terminal help window shortcut must
be disabled.
To disable the XFCE4 terminal help window shortcut, in xfce4-terminal
select:
Edit -> Preferences -> Advanced
Select the Disable help window shortcut key (F1 by default) and Close
the Preferences dialog. The XFCE4 terminal help window shortcut will no
longer be bound to ‘F1’ and no modification to the playlist view key binding
for fzmp
would be necessary.
To modify the fzmp
playlist view key binding, edit the fzmp
configuration
file ~/.config/mpcplus/fzmp.conf
and add a line like the following:
playlist_view_key F6
This revised configuration would change the playlist view key binding from ‘F1’ to ‘F6’ and the XFCE4 terminal help window shortcut could remain enabled and bound to ‘F1’.
Several other fzmp
bindings and options can be configured. See man fzmp
for details.
[Note:] MusicPlayerPlus version 1.0.3 release 1 and later perform
an automated MPD user configuration and systemd service activation.
Initialization with mppinit
for these installations should automatically
start the user MPD service. No further action should be required for
MusicPlayerPlus v1.0.3r1 or later installations.
Status of the MPD service can be checked with:
systemctl --user status mpd.service
Installation and initialization of MusicPlayerPlus prior to v1.0.3r1 will need to start mpd as a system-wide service by executing the commands:
sudo systemctl start mpd
If you want MPD to start automatically on subsequent reboots, run:
sudo systemctl enable mpd
Alternatively, if you want MPD to start automatically when a client attempts to connect:
sudo systemctl enable mpd.socket
Once the music directory has been set correctly, album art downloaded,
music library imported, and mppinit sync
has completed initialization,
some system checks can optionally be performed.
mpd
service is running and if not then start it:
systemctl --user is-active mpd.service
systemctl --user start mpd.service
mpc update
mpd
service is enabled and if not enable it
systemctl --user is-enabled mpd.service
systemctl --user enable mpd.service
mpplus
man mpcpluskeys
for help navigating the mpplus
windowsman mpplus
for different ways to invoke the mpplus
command[Note:] MusicPlayerPlus version 1.0.3 release 1 and later perform an
automated MPD music database initialization during execution of mppinit
.
For versions of MusicPlayerPlus prior to v1.0.3r1, initialize the music
database with an MPD client and update the database. The mpcplus
MPD
client can be used for this or the standard mpc
MPD client can be used.
With mpcplus
, launch the mpcplus
MPD client, verify the client window
has focus, and type u
to update the database. With mpc
simply execute
the command mpc update
.
If your music library is very large this process can take several minutes to complete. Once the music database has been updated you should see the songs, albums, and playlists in your music library appear in the client view.
To install, configure, and activate Mopidy issue the command mppinit mopidy
.
After Mopidy initialization completes, open http://<ip address>:6680/iris
.
After adding music to the local music library, run mopidy local scan
.
[Note:] In order to use the Mopidy-Beets extension, perform a
mppinit import
and optionally mppinit metadata
prior to mppinit mopidy
.
The default music server in MusicPlayerPlus is the Music Player Daemon (MPD). An alternate music server, Mopidy, is supported and can perform the same functions as MPD, is compatible with MPD clients, and can be extended to offer many more features.
Activating Mopidy will first deactivate MPD. The MusicPlayerPlus Mopidy
activation runs as a user level system service. Configuration for Mopidy
and Mopidy extensions resides in $HOME/.config/mopidy/
. The MusicPlayerPlus
activation of Mopidy auto-configures Mopidy and the installed extensions.
In addition to the
bundled Mopidy extensions,
the mppinit mopidy
command installs the following Mopidy extensions:
http://<ip address>:6680/iris
http://IP_Address:6680
in a browser~/.config/mopidy/mopidy.conf
Additional Mopidy extensions can be installed and configured. For example, to stream Spotify with Mopidy, install and configure the Mopidy-Spotify extension. Learn more at https://mopidy.com/ext/
[Note:] MusicPlayerPlus uses a Python virtual environment and Mopidy extensions are Python modules. In order to install a Mopidy extension it must be installed in the MusicPlayerPlus Python virtual environment. For example, to install the Mopidy Spotify extension run the following commands:
source ~/.venv/bin/activate
python3 -m pip install Mopidy-Spotify
To view the effective Mopidy configuration run the command mopidy config
.
This will display the full Mopidy configuration with passwords masked out
so that you can safely share the output with others for debugging.
[Note:] The Mopidy MPD extension provides compatibility with MPD clients but does not implement all MPD features. MPD is much more powerful and flexible in terms of its configurable inputs and outputs. After activating Mopidy some features may not work the same as they did with MPD. For example, spectrum visualization may fail or player stats may not be available. However, Mopidy offers many features unavailable with MPD. It’s a tradeoff.
To re-activate MPD and disable Mopidy, issue the command mppinit mpd
.
Easily switch back and forth between MPD and Mopidy with mppinit mpd
and mppinit mopidy
. Note that MusicPlayerPlus continues to use the
configured MUSIC_DIR
as the master music library location.
To change the location of the music library, edit
~/.config/mpprc
, set MUSIC_DIR
to the new location,
and run mppinit sync
to synchronize the music library location across
Beets, MPD, Mopidy, and downloaders.
The default music server in MusicPlayerPlus is the Music Player Daemon (MPD). An alternate music server and streamer, Navidrome, is also supported. To install, configure, and activate Navidrome issue the command:
mppinit navidrome
The MusicPlayerPlus Navidrome activation runs as a user level system service.
Configuration for Navidrome resides in $HOME/.config/navidrome/navidrome.toml
.
The MusicPlayerPlus activation of Navidrome auto-configures, starts, and
enables the Navidrome service. The Navidrome log file can be found at
$HOME/.config/navidrome/navidrome.log
.
After installing Navidrome, you need to create your first user. This will be your admin user, a super user that can manage all aspects of Navidrome, including the ability to manage other users. Browse to Navidrome’s homepage at http://localhost:4533
Fill out the username and password you want to use, confirm the password and click on the “Create Admin” button. You should now be able to browse and listen to all your music.
[Note:] It usually take a couple of minutes for your music to start appearing in Navidrome’s UI. Check the logs to see what is the scan progress.
[Security Note:] Navidrome comes with an embedded, full-featured HTTP
server but in order to provide additional security (e.g. SSL) Navidrome
should be run behind a reverse proxy like Nginx or Apache. MusicPlayerPlus
does not configure a reverse proxy for Navidrome. See the Navidrome network
configuration documentation at https://www.navidrome.org/docs/usage/security/
to get started securing Navidrome. To use the MusicPlayerPlus default
configuration of Navidrome, use http://...
rather than https://...
.
If all you want is a Navidrome streaming music server and you do not care
about Beets library management, additional downloads, or a Mopidy server
then setup can be accomplished with just mppinit
followed by
mppinit navidrome
.
The Navidrome self-hosted music service can stream your music to many devices.
MusicPlayerPlus tested and recommended free open source Navidrome clients:
Character based terminal/console Navidrome clients:
Navidrome clients are not installed by MusicPlayerPlus. Install Navidrome clients using your device’s app store or following the installation instructions at the client link above.
If you do not have or wish to use a Navidrome client, then most modern
browsers are supported Navidrome clients. To use a browser as a Navidrome
web client, open the URL http://ip-address:4533
where ip-address is
the IP address of the Navidrome server.
For a list of Airsonic compatible applications, see https://airsonic.github.io/docs/apps/
For a list of Subsonic compatible clients, see https://www.navidrome.org/docs/overview/#apps
Sonixd is a cross-platform desktop Subsonic client compatible with Navidrome. On Apple MacOS, install sonixd with Homebrew:
brew install --cask sonixd
Sublime is a native Subsonic client compatible with Navidrome for the Linux Desktop. See https://sublime-music.gitlab.io/sublime-music/index.html to install Sublime on a variety of Linux distributions.
Spotify
and YouTube Music
players can be installed, configured, and launched
via either the mpplus
menu system or mppinit
.
The Spotify
player is the character-based spotify_player
available at
https://github.com/aome510/spotify-player and can be installed via the main menu
(mpplus -i
) or with the command mppinit spotify
. This Spotify
player runs
in a terminal window or on the console and has full-feature parity with Spotify
.
Configuration of the Spotify
player is located in ~/.config/spotify-player/app.toml
.
The YouTube Music
player is a YouTube Music
desktop app available at
https://github.com/th-ch/youtube-music and bundled with custom plugins and
built-in ad blocker/downloader. The YouTube Music
player can be installed
via the main menu (mpplus -i
) or with the command mppinit youtube
.
Configuration of the YouTube Music
player is located in ~/.config/YouTube Music/config.json
.
Supported terminal emulators in MusicPlayerPlus include kitty
, tilix
,
gnome-terminal
, st
, and cool-retro-term
. Kitty is the default terminal
emulator used by MusicPlayerPlus except on Raspberry Pi OS where st
is used
as the default.
[Note:] The kitty terminal emulator is very cool. A default kitty theme is provided (the ‘Music Player Plus’ theme) and should suffice for most users. An alternate kitty theme can be configured using the kitty themes kitten. To use this kitten, run:
kitty +kitten themes
An alternate terminal emulator can be specified on the mpplus
command line:
mpplus -c ... # indicates use the current terminal and a tmux session
mpplus -e ... # indicates use the simple terminal emulator (st)
mpplus -g ... # indicates use the gnome terminal emulator
mpplus -k ... # indicates use the kitty terminal emulator
mpplus -r ... # indicates use the cool-retro-term terminal emulator
mpplus -t ... # indicates use the tilix terminal emulator
If an alternate terminal emulator is not specified on the command line
then the default will be used unless console mode is detected. Console mode
is used when no DISPLAY can be opened (e.g. running on a console, running
over SSH without a display, running on a headless server). In console mode
MusicPlayerPlus utilizes tmux
sessions to display the character-based music
player mpcplus
and spectrum visualizer mppcava
.
The mppcava
spectrum visualizer looks better when the font used by the
terminal emulator in which it is running is a small sized font. Some
terminal emulators rely on a profile from which they draw much of
their configuration. Profiles are used in MusicPlayerPlus to provide
an enhanced visual presentation.
In order to use the Gnome, Simple, or Tilix terminal emulators they must be
installed manually (except on Raspberry Pi OS where the Simple terminal
emulator is installed if no supported terminal emulator is found).
If you wish to use the Gnome, Simple, or Tilix terminal emulators,
then use your system’s package manager to install them prior to
initializing MusicPlayerPlus with the mppinit
command. If either or both
of Gnome or Tilix terminal emulators are installed after MusicPlayerPlus
initialization with mppinit
then run mppinit profiles
after installing
gnome-terminal or tilix terminal emulator(s).
There are four terminal profiles in two terminal emulators used by
MusicPlayerPlus. The gnome-terminal
emulator and the tilix
terminal
emulator each have two custom profiles created during mppinit
initialization.
These profiles are named “MusicPlayer” and “Visualizer”.
The custom MusicPlayerPlus terminal profiles are used to provide font sizes and background transparencies that enhance the visual appeal of both the MusicPlayerPlus control window and the spectrum visualizer.
To modify these terminal emulator profiles, launch the desired terminal emulator and modify the desired profile in the Preferences dialog.
MusicPlayerPlus includes support for the auto-generation of an Obsidian vault from either a Discogs user collection or a local music library. The extremely rich data available from Discogs can be used to generate markdown format files reflecting the artists, albums, tracks, and items in your collection or library. The generated markdown reflecting your Discogs collection or music library includes a preconfigured Obsidian vault along with plugins, settings, and theme. The Obsidian Dataview plugin can be used to query the Obsidian vault in a variety of ways similar to a database of your library. Several example Dataview queries are included.
In order to use this facility, both DISCOGS_USER
and DISCOGS_TOKEN
must be
configured in $HOME/.config/mpprc
. If these are set then the resulting Obsidian
vault from the either the command mppinit discogs
or mppinit discogs local
will be located in the folder specified by DISCOGS_DIR
in mpprc
.
See the Obsidian Custom Discogs README for details on setup and maintenance of a Discogs Obsidian vault.
MusicPlayerPlus includes several services, some installed by default and
others optionally installed with the mppinit
command post-installation.
Clients that can be used to access these services are also provided.
The following services are included with MusicPlayerPlus:
curl -s http://localhost:8337/album/ | jq -r .
mppinit mopidy
mppinit navidrome
mppinit yams
All of the MusicPlayerPlus services are user-level systemd services and can
be controlled by the MusicPlayerPlus user without the need for root
privilege.
The mpplus -i
interactive menu system includes menu entries for controlling
each of these services as well as a status report on them by selecting the
“Manage Music Services” from the Main Menu. Alternately, each service can
be controlled from the command line using systemctl --user ...
. For example,
to stop the MPD Stats Service, run the command systemctl --user stop mpdstats
.
Depending upon the use case and personal preference, a variety of combinations of MusicPlayerPlus services can be activated. Mopidy with the Mopidy-MPD extension conflicts with the MPD service. YAMS and MPD Stats only work with MPD. Therefore, if Mopidy is activated the MPD, YAMS, and MPD Stats services are automatically deactivated. Similarly, if the MPD service is reactivated, the YAMS and MPD Stats services are reactivated and Mopidy deactivated.
Choose which service you prefer, MPD or Mopidy, and activate it with either
mppinit mopidy
or mppinit mpd
(after activating Mopidy then deciding to
reactivate MPD). Using these two commands, mppinit mopidy
and mppinit mpd
,
it is easy to switch between the two conflicting services.
The advantage of MPD is its stability, maturity, flexibility, power, and
extensive configuration options. However, it is difficult to enable streaming
with MPD. The advantage of Mopidy is its streaming capability and the variety
of useful extensions, many of which are installed by default with
mppinit mopidy
.
An even better streaming solution is provided by Navidrome. Activating Navidrome enables access to the music library from any desktop, phone, tablet, or remote device with a browser. There are numerous Navidrome clients available for all devices and platforms. Activating Navidrome does not conflict with any of the other MusicPlayerPlus services so it can be streaming the music library while MPD or Mopidy is serving up the same library locally. Navidrome can optionally scrobble to Last.FM so if that option is enabled then deactivate the YAMS service.
[Summary] MusicPlayerPlus provides several different selections of
services appropriate for a variety of use cases. All service configurations
require a prior MusicPlayerPlus initialization with mppinit
. Some common
MusicPlayerPlus service configurations include:
mppinit
mpplus
, mpcplus
, mpc
, etc to play music on local systemmppinit import
beet ...
, mpplus
, mpcplus
, mpc
, to search, filter, play, …http://<ip address>:8337
mppinit import
, and mppinit mopidy
beet ...
, mpplus
, mpcplus
, mpc
, to search, filter, play, …http://<ip address>:8337
http://<ip address>:6680
mppinit import
, mppinit mopidy
, mppinit navidrome
beet ...
, mpplus
, mpcplus
, mpc
, to search, filter, play, …http://<ip address>:8337
http://<ip address>:6680
http://<ip address>:4533
mppinit import
after new mppinit bandcamp|soundcloud
downloadsmppinit navidrome
mppinit import|metadata|mopidy|yams
mpplus -i
menu system to stop and disable all other services
http://<ip address>:4533
mppinit import
after mppinit bandcamp|soundcloud
downloadsThe following clients are included with MusicPlayerPlus:
man mpplus
mpcplus
MPD client and mppcava
spectrum visualizermpplus
man mpcplus
mpcplus
man mpc
mpc stop
, mpc current
, mpc play
man beet
beet play jethro tull
, beet info -l aqualung
http://<ip address>:8337
mppinit mopidy
http://<ip address>:6680
mppinit mopidy
http://<ip address>:6680/iris
mppinit mopidy
http://<ip address>:6680/mobile
mppinit navidrome
http://<ip address>:4533
[NEW:] MusicPlayerPlus documentation is now available on Read the Docs
All MusicPlayerPlus commands have manual pages. Execute man <command-name>
to view the manual page for a command. The mpplus
frontend is the primary
user interface for MusicPlayerPlus and the manual page for mpplus
can be
viewed with the command man mpplus
. Most commands also have
help/usage messages that can be viewed with the -u argument option,
e.g. mpplus -u
.
tmuxp
session configurationsmpcplus
MPD client navigationThe primary MusicPlayerPlus user interface is the mpplus
command.
Execute mpplus -o
to open the mpcplus
MPD client and the mppcava
spectrum visualizer. The command mpplus
without arguments displays
a series of interactive menus from which most of the MusicPlayerPlus
tasks can be launched.
The mpc
command provides a quick and easy command line interface
to control the Music Player Daemon playback. The mpc
command has
many command line options, see man mpc
for a full description.
To get started with simple MPD playback control using mpc
:
The beet play [QUERY]
command can be used to specify a song or songs
to play where ‘QUERY’ is a Beets query matching songs in the music library.
The usage messages for mppinit
, mpplus
, mpcplus
, and mppcava
provide a brief summary of the command line options.
mppinit
performs one-time initializations.
## Videos - [![MusicPlayerPlus Intro](https://i.imgur.com/UH2A21h.png)](https://www.youtube.com/watch?v=r7XLA9tO45Q "MusicPlayerPlus ASCIImatics Intro") - [![MusicPlayerPlus Demo](https://i.imgur.com/ZntE1sH.jpg)](https://www.youtube.com/watch?v=y2yaHm04ELM "MusicPlayerPlus Demo") ## Building MusicPlayerPlus from source MusicPlayerPlus can be packaged and installed from the source code repository. This should be done as a normal user with `sudo` privileges: ``` # Retrieve the source code from the repository git clone https://github.com/doctorfree/MusicPlayerPlus.git # Enter the MusicPlayerPlus source directory cd MusicPlayerPlus # Create an installation package ./mkpkg # Install MusicPlayerPlus and its dependencies ./Install ``` These steps are detailed below. ### Clone MusicPlayerPlus repository ``` git clone https://github.com/doctorfree/MusicPlayerPlus.git cd MusicPlayerPlus ``` **[Note:]** The `mkpkg` script in the top level of the MusicPlayerPlus repository can be used to build an installation package on all supported platforms. After cloning, `cd MusicPlayerPlus` and `./mkpkg`. The resulting installation package(s) will be found in `./releases/