/ root / pages / goodsong.html

You're using an old link! - Thankfully, you no longer need to specify a nonstandard port (8080) to access my site. You could've used the more standard: http://pbrisbin.com/pages/goodsong.html.

Goodsong


If you're like me, (which you're probably not...) you enjoy listening to your music with the great music playing daemon known as mpd. You also have your entire collection on shuffle. Occasionally, I'll fall into a valley of bad music and end up hitting next far too much to get to a good song. For this reason I wrote goodsong.

What is it?

Essentially, you press one key command to say the currently playing song is good; then press a different key to say play me a good song.

Goodsong accomplishes exactly that. It creates a playlist file which you can auto-magically add the currently playing song to with the command goodsong. Subsequently, running goodsong -p will play a random track from that same list.

Oh, don't be fooled, goodsong has plenty of other useful options too, here's the --help:

  usage: goodsong [option]

    options:
          -p, --play       play random song from list, now
          -b, --build      build playlist from your list, play it
          -s, --show       display a random song from list
          -S, --smart      select a song from your list
                           find it in your current playlist
                           or add it; when the current song ends,
                           play it
          -h, --help       display this

          none             append playing song to list

Installation

Run the following in a terminal to install this script:

  wget -O ./goodsong http://pbrisbin.com/bin/goodsong
  chmod +x ./goodsong
  sudo mv ./goodsong /usr/bin

Usage

Using goodsong is easy. You can always just run it from CLI, but I find it's best when bound to keys. I'll leave the method for that up to you; xbindkeys is a nice WM-agnostic way to bind some keys, or you can use your a WM-specific configuration to do so.

Personally, I keep Alt-g as goodsong and Alt-Shift-g as goodsong -p.

You're going to have to spend some time logging songs as "good" before the -p option becomes useful.

The script in its current "Live" form can be viewed here. Always refer back to that link for the most up to date version. It's a symlink to my own ~/.bin so it doesn't get any fresher.

Enjoy!

Update

I recently received a patch from a reader for this script. It adds a few features which I've happily merged in.

Because of that last one, the -b flag to goodsong is pretty much useless and will probably be removed at some point in the future. You should simply load the playlist from mpc or ncmpcpp just like any other.

Comments





pbrisbin dot com 2010