Command line is one of the strongest merits of Linux and that is the reason it has a very strong following. When it comes to performance and convenient interactivity, command line users want everything command line and text-based including music players. Therefore, in this article we shall be discussing three of the most popular and efficient command line music players available on Linux.
Even though text-based, users would never want a messy and ugly user interface. Hence, even a command line player needs to have an organized look and feel (just like their graphical counterparts). With the ncurses tookit, it is pretty much possible. We shall see in this article, even with just ASCII characters, the user interface can be so pleasing and conducive.
NOTE- Unless specified, all the installation and execution examples/images shown in this article are Ubuntu specific.
Command Line Music Players
CMus is one of the popular and fast command line audio player available for users of Unix-like operating systems. It is based on open source ncurses. It has a terminal based user interface which works with key shortcuts.
The player comes up with following features
- Support for various audio formats like MP3, MPEG, WMA, Musepack, WavPack, MOD, Ogg Vorbis, SHN, TTA, FLAC etc
- Even with thousands of track, the player starts pretty fast.
- Gapless playback and replaying support
- Ogg and MP3 streaming from Shoutcast and Icecast
- Music Library filters and live filtering
- Amazing compilations handling
- Easy to use directory browser
- Customizable colors and dynamic key bindings.
- Vi style search and command modes
- cmus remote command to control the player remotely
Excited to have such a quick music player on your system, here is how we go about installation.
For Debian/Ubuntu systems, use command
$ sudo apt-get install cmus
For Red Hat based systems, it uses ‘yum’ as
$ yum install cmus
Once the installation completes, it is time to launch the player. It is super simple by just running the ‘cmus’ as a command
The below image is a snapshot for the first look of the cmus music player, just after it is launched.
As one can see, the player has a view for the playlist. To start using it, first we need to add music to the list. To browse through music on your system, press ‘5’.
To open the directories view to browse, which looks like
Navigate through the directories using up/down and enter/backspace keys. I know my music files are in ‘Music’ directory, and hence I navigate to that directory.
Now, select and press key ‘a’. This is the way to add a file or a folder to the cmus music library. When we press ‘a’ key, it adds file/folder to the cmus library and moves to the next file/folder in the browser. Alongwith, the time information in the bottom row increments.
I see three songs there, and so add two of them to my cmus library.
Type following to save the library
However, whenever we quit from the player, it does an auto-save. Hence, generally we don’t have to explicitly save or be scared of losing the library.
To go back to the first view, press ‘2’. Coming back to the original view, now I see two of my added songs in the playlist view.
Again, to navigate through the music library queue, use up/down arrow keys and press ‘enter’ at whatever music one would like to play. For removing any of the added music, use ‘shift + d’.
At the bottom, cmus player displays details about the duration, timings, Album, Artist and other related metadata.
Here are the keys for generic playback operations
Key playback operation
-> Forward seek by 10 sec
<- Reverse seek by 10 sec
> Forward seek by 1 minute
< Reverse seek by 1 minute
Besides, the player shows two types of information on the bottom-right part of the player. The first part, which says
all from library
signifies what to play next after the current song ends. There are three options:
- all from library – Play all the songs from the cmus music library sequentially.
- album from library – Play all the songs from the particular album of the selected music
- artist from library – Play all the songs of the particular artist as of the selected one.
The present set option says to play the next music in sequence, as it plays all from the cmus music library. One can toggle through all the options by pressing ‘m’ key.
The second part which looks like,
These are toggles and whichever is one, is displayed here. The three types and their ascribed implications are:
C – Continue :: If this is ON, it means to continue to the next set song(as per the option described in the above sub-section). However, if it is OFF, then stop after the current playing song ends. To toggle ON/OFF this state, use ‘shift + c’.
R – Repeat :: If this is ON, (along with C state), once the player ends the playback of the group of songs it is playing, it will trigger the repeat playback from the beginning. Press ‘r’ to toggle this state.
S – Shuffle :: With this option ON, the player will shuffle the music group while playing so that it plays a randomly selected song from a particular group of selected songs. Use key ‘s’ to toggle through this state.
Next is, managing a queue of music which we want to play at a moment. There is another music queue apart from the music library. What songs we need to play at a moment becomes the part of the queue. To add any song to this queue, without interrupting the currently playing song, go to the song and press ‘e’. It works as any data structure queue i.e. first in first out.
To view/edit this queue at anytime, press ‘4’. Press ‘p’ to order it.
For removing any entry, use ‘shift + d’.
Further, we have another list called the playlist. It is also like the set of music files in the music library, except that we can order it. One can have plenty of playlists depending upon the mood swings of the day.
To view the playlist, press ‘3’ and to add to this playlist press ‘y’ key. Again, to delete any of the added song from the playlist, use ‘shift + d’.
There are two major styles of searching, one can do in cmus music player. First, something similar to vi/vim search. Type ‘/’ and type the word which one desires to search while looking up the music track. Press enter to see the first found entry.
To move on to the next one, press ‘n’.
An alternative style of searching is the tree view. Press ‘1’ to move onto the tree view. It looks similar to the following figure,
Looking for a track is well organized in this view, where any album/artist can be expanded by pressing spacebar. Further, use ‘tab’ key to switch between the left and right tabs.
The Key binding settings information can be evinced in the view reached out by pressing ‘7’.
To exit the player, type ‘q’ and then ‘y’ or ‘:q’ and then enter.
[On page 2 :: Read about Mp3Blaster and Music on Console]