Thursday, 16 April 2009

CMus Review - A Great ncurses Music Player

CMus (also called C* Music Player) is an ncurses-based audio player which can be run in a shell, with no need for an X server.

CMus is very powerful and highly configurable, and it features Vi-like commands and keyboard shortcuts which can be bound to other keys if needed. It supports various audio formats, including Ogg Vorbis, FLAC, MP3 (with libmad), WAV, AAC or WMA. CMus is lightweight and I must say that it was a delight testing it, and although by default it lacks support for one of the features I consider a must-have, the song submission, this can be accomplished by applying a patch and recompiling it.

Usual look of CMus, using the default view mode

The first thing you will want to do when starting CMus is to add some music folders. You can do this by typing :add /path/to/music/folder/, then navigating through the playlist by using the J and K keys or using the Up/Down arrow keys. To start playing press Enter and to stop CMus use V.

CMus takes commands using a Vi-style, which means that you will have to type : then your command, for example:

:add /path/to/music/ will add audio files found in /path/to/music/
:clear will clear the playlist
:save ~/playlist_name.pls will save the current playlist into playlist_name.pls inside your home directory
:load playlist_name.pls will load playlist_name.pls
:set softvol=true will enable software volume control

I found CMus to be extremely fast and flexible. Although adding over 5000 songs can take a while, loading a playlist this large takes less than a few seconds on a medium-performance computer.

CMus offers no fewer than 7 view modes, and you can switch to any of those simply by using the 1-7 keys:
Library view (key 1), which is also the default view mode, includes an artist/album tree, with albums sorted by year
Sorted library view (key 2), which provides a simple, common playlist view with custom sorting
Playlist view (key 3), editable playlist
Play queue view (key 4), displays a queue of tracks
File Browser (key 5), a directory browser
Filters view (key 6), a list of user-defined filters
Settings view (key 7), displays keybinds and options

File browser mode

Sorted library view mode

In order to search for a song, you can use the / (slash) character, followed by the desired song name (you can enter words in any order). Press Enter when you're done, then Enter again to play the song. Press N in order to search for the next occurrence in the library.

Regarding the song submission issue: it does not seem implemented by default, at least not in the version included in Debian Lenny, but there is an available patch for it here. You can fetch the source, apply the patch, then recompile CMus in order to have support. Here I wrote an article on how to enable support in Debian and Ubuntu.

CMus also supports configurable colour schemes, which you can customise by using the :colorscheme command. Notice that the commands can be auto-completed using TAB, and you can also use Emacs-like shortcuts (for example Ctrl+U to delete all the characters to the left of the cursor etc.)

Using the green-mono-88 colour scheme

You can put commands and configuration options inside the ~/.cmus/rc file, where ~ is your home directory (create the file if it doesn't already exist).

Since it's not a graphical application, I can't talk about cover art, and it also seem to lack lyrics fetching support, but who knows, maybe it will get it in a future release.

Overall, except for the lack of support, CMus is one hell of an audio player for using in a terminal or in an environment without X. It is lightweight, powerful, fast, highly configurable and it seems, at least to me, intuitive and easy to use once you grasp the commands and keyboard shortcuts. A great piece of software, and I really hope for a future release to include by default integration.
CMus on Freshmeat

Updated: April 26, 2009


elmo40 said...

->if you wanted to compare, is another excellent ncurses audio player.
->this next one may be a little old but it has many excellent features. even a Spectrum Analyzer!
->then there is

Anonymous said...

mp3blaster is another good ncurses-based music player.

Unknown said...

What do I need write to ~/.cmus/rc to default dir of Browser was ~/download/music?

gp said...

To Саша: "cd ~/download/music" in ~/.cmus/rc will do the trick.