Fixing the obscure EMMS user interface

For years I am using a small shell wrapper script and mplayer to play mp3 songs in a loop, because I can’t sit at the computer and not listening to something. However, that script missed a lot of basic command such as “play the previous song” etc. Of yourse there are lots of terminal audio players, but most of them require a new set of key bindings to be learned. And to be honest, all my key binding related memory banks are full, I can’t just memoize yet another set of key bindings.

Then I discovered EMMS to my surprise. So I gave it a try.

And failed miserably.

The user interface of EMMS is not just bad, it is fucking crab. I needed more than an hour just to get it to play a damn song. Then when it finally did, I was unable to get it to stop playing because the buffer with the playlist went missing. A hidden buffer! What the hell were they thinking! Also it was (or rather IS) hard and complicated to create a new playlist and fill it with songs from a directory. Really this is the simplest task an audio player should be able to do. Not EMMS. I haven’t seen anything more fucked up than this.

From the deepest of my heart I really fucking hate EMMS!

On the other hand I truly love emacs. I love it so much that I am already mourning the day I’m dying because then I won’t be able to use emacs anymore.

Using emacs to me means, I am the sole dictator of what happens in my editor. And if I want it to play music and the code that offers such functionality doesn’t work the way I like it, I can and will just change it so that it does.

So, I went and wrote two functions which makes my live with EMMS much much easier. The first one (and the more complicated one) is audio-create-playlist. Here’s the docstring of the function:

Create a new audio playlist for EMMS player.

It asks interactively for NAME.  The playlistname will be derived
as     this: 'source-file-default-directory + \"playlist-\" + NAME.

If the playlist already exists nothing will be done.

Otherwise the  user will be  asked wether  to add a  directory or
file[s] to  the playlist.  In the  first case  the user  can then
interactively select a directory. In the latter case the user can
add interactively one or more files.

The playlist will be saved when  a directory has been selected or
the user declines to add another file.

So when I want to create a new playlist, I just call this function, enter a name, add a directory or a couple of files using the interactive way for this the function provides and be done with it.

When I want to use this playlist the next day, I just call the other function audio-open-playlist, which asks me for the playlist location, opens it in an EMMS buffer and starts playing. And the buffer will also be properly named so that I can easily find it. Also it is visible and not hidden somehow.

Inside this buffer I can then just use the usual EMMS keys to navigate the songs, like p, n, <space>, <ret> etc. Pretty easy.

If you want to use these functions and also take a look at my EMMS config: init-audio.el can be found on github.

#emacs

↷ 22.07.2023