~nytpu/bgm-mpd

Play music with gaps between tracks like video game background music
fix issue of socket connection breaking after a long sleep
fix leaked mpd_statuses
README: add note about AUR package

clone

read-only
https://git.sr.ht/~nytpu/bgm-mpd
read/write
git@git.sr.ht:~nytpu/bgm-mpd

You can also use your local clone with git send-email.

#BGM-MPD — Play music with gaps between tracks, in the style of video game background music

builds.sr.ht status license: AGPL-3.0-only

An MPD client that plays through a song and then pauses for a random period of time before playing the next song, emulating the way games like Minecraft or Dwarf Fortress play their background music.

Note that this is a single-purpose MPD client. You must use another MPD client such as Cantata in order to queue music, manage your library, et al.

Usage: bgm-mpd [-h] [-H host] [-P port] [min time] [max time]
	-h        Display this help message.
	-H host   Host IP or socket path to use to connect to MPD.  Also supports
	          the MPD_HOST environment variable.
	-P port   Port to use to connect to MPD (ignored if using socket file).
	          Also supports the MPD_PORT environment variable.
	min time  Minimum time to wait between songs, in seconds.  (Default: "20")
	max time  Maximum time to wait between songs, in seconds.  (Default: "90")

Press Control-C at any time in the program's terminal to pause playback, restore
some changed settings, and exit the program.

Use shell redirects and operators to background BGM-MPD in the terminal, hide its various output messages, etc. For example, this will run it in the background so the terminal can be used for other things, but still display its status messages as they're printed:

bgm-mpd &

To cancel the above command, run the fg command and then use Control-C as normal.

#Obtaining

There is an AUR package: bgm-mpd-git.

You can also download prebuilt x86-64 Linux binary by clicking the latest builds on the CI page: https://builds.sr.ht/~nytpu/bgm-mpd. Artifacts are only saved for 90 days so there unfortunately may be no artifacts available if there has been a gap between pushing new commits or tags. The binaries depend on glibc and libmpdclient.

Or just compile as instructed below, it's as easy as any program you'll ever encounter.

#Dependencies

  • C11/C17 and POSIX 2008/2017 C compiler and standard library
  • libmpdclient
  • MPD (of course)
  • POSIX sh(1) and standard utilities
  • POSIX make(1) (Both GNU make and BSD make should work)

#Compiling

git clone https://git.sr.ht/~nytpu/bgm-mpd
./configure
make
sudo make install

#Contributing

The upstream URL of this project is https://git.sr.ht/~nytpu/bgm-mpd. Send suggestions, bugs, patches, and other contributions to alex@nytpu.com or ~nytpu/public-inbox@lists.sr.ht. For help sending a patch through email, see https://git-send-email.io.

If you aren't comfortable sending a patch through email, get in touch with a link to your repo and I'll pull the changes down myself!

Copyright (C) 2024 nytpu <alex [at] nytpu.com>.

Licensed under the terms of the GNU Affero General Public License, version 3. You can view a copy of the GNU AGPL in LICENSE or at https://www.gnu.org/licenses/agpl-3.0.html.