Linux Format

Feature-rich music players for minimalist­s

Simplicity, elegance, usefulness and sheer fun are all qualities that describe Shashank Sharma. They’re also features he values most in applicatio­ns.

-

Music players come in all shapes, colours and sizes. Modern ones have a number of common features such as support for multitude of file formats, gapless playback, player queue, search, playlist filters, ability to play mp3 and ogg streams, and a customisab­le appearance. Released under the GPLv2 and written in C, cmus or C* Music Player is a nifty little CLI utility that supports all these features and more.

While most modern command-line applicatio­ns make use of Python, Ruby, or Go, the choice of C for cmus should already give you an idea about the project’s age. First released just a little over 17 years ago, cmus follows the old Unix philosophy of doing one thing well. That one thing being that it’s the only music player you’ll ever need.

One advantage of being such an old-school utility is that you’ll find it in the software repositori­es of most modern desktop distributi­ons, so installati­on is as easy as running either the sudo apt install cmus or sudo dnf install cmus command, depending on your choice of distributi­on. At the time of writing, the latest release was 2.9.1; however, with the exception of Arch and a few others, most other distributi­ons carry an older version.

Getting started

To install the latest release, you’ll have to manually run the classic trifecta of ./configure , make and make install . Download the latest tarball from the project’s GitHub page (https://github.com/cmus/cmus) and extract the files with the tar xvf cmus-2.9.1.tar.gz command. Depending on your distributi­on, it’s possible that you’ll have to install a number of additional packages for optimum results. You’ll find a list of such optional dependenci­es on the project’s website (https://cmus.github.io/#developmen­t), These dependenci­es can all be installed using the software repositori­es on your distributi­on.

With that done, change into the extracted cmus directory and run the ./configure command. The generated output will reveal if any library or package is missing. You can alternativ­ely open the generated config.mk file in your favourite text editor. Look for lines starting with CONFIG_. You’ll have to rerun the

./configure command every time you install any dependenci­es. Next, run the make and make install commands to finalise the installati­on.

Read up on the music player

To help you acclimatis­e to its way of doing things, cmus

ships with a robust man page, which is a recommende­d read, and also a useful guide to help you make sense of its interface. Run the man cmus-tutorial command to launch the tutorial which walks you through the usage. It covers everything from launching cmus, adding music, managing playlists, finding tracks and more.

Because it’s a command-line utility, you control the behaviour of the tool using defined keyboard shortcuts, so it makes sense to read the man page as well as run through the tutorial.

You can launch cmus by running the cmus

command. You’ll be greeted by a two-pane Artist/Album view. Because we’ve just launched the program, the view is understand­ably bereft of any informatio­n. Cmus

has a built-in file browser that you can use to identify the songs you wish to listen to. Press 5 to switch to the file-browser view.

You can now use the arrow keys to select the song or directory you wish to add, and press ‘a’ to add it to the cmus library. Press Enter to navigate into a directory and the Backspace key to move up to the parent directory. If all your tracks are sorted neatly into directorie­s, you can add the entire directory into the library by pressing ‘a’ after selecting the directory.

You can move back to the Artist/Album view by pressing 1. You’ll find all the Albums are listed in alphabetic­al order on the left pane, while the tracks are listed on the right. The left pane, Artist/Album, is selected by default. Press Tab if you wish to navigate the tracks on the right pane. You can alternativ­ely switch to the library view, which lists all the music files listed in alphabetic­al order, by pressing 2.

The cmus player utilises different views, such as Artist/Album, Library, Playlist, Play queue, File browser, Library Filter and Settings. You can switch between these different views by pressing the number keys 1 to 7.

To save your music library, move to any of views 1 to 4, type :save and press Enter. This will ensure that you don’t have to keep adding your music files to the library every time you run cmus.

Let’s play

Hit Enter to play the currently selected song from your library. The selected song will be highlighte­d and the currently playing song is displayed in the status bar at the bottom of the cmus interface.

There are a number of keys that control playback. You will find a complete list of keybinding­s by pressing 7, but the following are all you need to start enjoying your music collection:

In addition to music files, you can also add playlists to your cmus library. Even better, you can add your favourite internet radio station as well, but only if it provides a mp3 or ogg stream. Such internet streams are sorted under the name on the Artist/ Album view.

If you want to play certain tracks in sequence, you can select the song from the library view and press ‘e’. Keep doing this for all the tracks you wish to play in the order, and these will be added to the player queue, which you can view by pressing 4. To rearrange the songs from the player queue, you can use the P or ‘p’ keys to move tracks up or down respective­ly.

While we’ve only talked of playing music with cmus, you can just as readily use the tool to listen to your favourite podcasts, or even audio books. The only downside being that the program won’t remember the location in a given chapter.

If you care about speed then you’ll enjoy working with cmus, which is an incredibly fast and robust music player. We were particular­ly impressed by the program’s search feature, which returns results instantane­ously. We recommend giving cmus a whirl today.

The key bindings on the Settings view (7) are sorted into two categories: browser and common. The browser settings are ones that can only be used from the file browser view, while the others can be used from any of the different views. For instance, pressing ‘i’ in browser view will display hidden files.

 ?? ?? The bottom of the screen shows the total run time of all your added tracks. Search for a track by pressing /keyword from views 1 and 2.
The bottom of the screen shows the total run time of all your added tracks. Search for a track by pressing /keyword from views 1 and 2.
 ?? ??
 ?? ?? You can change cmus’s behaviour by editing its settings. Pressing , (comma) seeks backwards by one minute. Select this setting, press Enter, and change -1m to -30s. Press Enter to save.
You can change cmus’s behaviour by editing its settings. Pressing , (comma) seeks backwards by one minute. Select this setting, press Enter, and change -1m to -30s. Press Enter to save.
 ?? ??

Newspapers in English

Newspapers from Australia