[ Tuesday, 15 May 2007, Roman ]
MOC is a console-based (build on ncurses library) audio player for Linux/BSD. It’s very easy to use, fast and functional so basically it has all the features of a decent player except for a fancy GUI. What is more — it takes a fraction of system resources consumed by most popular GUI players but still plays all popular formats „out-of-the-box”.
Author: Roman Tworkowski
Installing MOC is trivial. You can either download the sources, compile them and run or get a package specific to your distribution of choice and install it this way.
If you are using Debian or Ubuntu you can use these repositories:
deb http://www.lxtec.de/debarchiv unstable main deb-src http://www.lxtec.de/debarchiv unstable main
Even though MOC is available in the default repos, it’s better to use those from lxtec.de since they are updated more frequently. After adding the lines above to /etc/apt/sources.list file you should run aptitude update && aptitude install moc to get the latest version from the repo.
If you are a hardcore player, use the MOC Subversion repository svn://daper.net/moc/trunk to get the creeping edge version of software.
In the first place, MOC doesn’t require any special configuration. Still if you would like to play with the options feel free to copy the example config file from /usr/share/doc/moc/examples/ to your home folder in ~/.moc. Easy way to do it is by using this shell command: zcat /usr/share/doc/moc/examples/config.example.gz > ~/.moc/config. Then just edit the file manually with your most hated editor like vim. The options are a no-brainer so I won’t continue explaining them here. Consult the manual if you encounter any problems.
Let’s switch to the most important part of this article — how to actually use play music with MOC . First run the program with mocp command. A window with your file system on the left should appear. The right side is reserved for the playlist. Now you can:
- ENTER – switch to a folder, start playing the song, etc
- ‘o’ – play URL (for instance some Internet radio)
- ‘p’ or space bar – pause playing
- ‘s’ – stop playing
- ‘l’ – switch between one and two-column view
- ‘a’ – add current file to the playlist
- ‘A’ – add current folder (recursively) to the playlist
- ‘C’ – clear the playlist
- ‘q’ – turn the console interface off (MOC server is still running and you can come back by entering mocp again)
- ‘Q’ – hard power-off MOC
MOC can be also manipulated when the console interface is switched off. Here are some commands that may be useful for that:
- ‘mocp -S’ – run the MOC server
- ‘mocp -p’ – start playing the playlist
- ‘mocp -f’ – switch to the next track on the playlist
- ‘mocp -r’ – switch to the previous track on the playlist
- ‘mocp -s’ – stop playing
- ‘mocp -P’ – pause playing
- ‘mocp -U’ – resume playing
- ‘mocp -x’ – kill the server
More options can be obviously found in the MOC manual by entering man mocp.
MOC may be a bit different than any other audio player you know. These differences are in plus in my opinion .
First, after when you select a song from a folder, MOC will keep playing the next song in the same folder when the selected one is over.
Secondly, MOC automatically remembers the playlist on exit and reads it when you next time run it.
Third, thanks to pre-caching system, there are no annoying breaks between the played tracks. It is especially noticeable when playing an audio CD.
Finally I have a few tips from an experienced MOC user that may help you enjoy using MOC even more .
Yes, it’s themeable too! The default MOC theme is… well pretty disgusting. For black terminals and those with transparency on the ‘transparent-background’ theme looks much better. You can set it in ~/.moc/config. If none of the themes fits your needs, no problem! Just download one from somewhere in the Internet and set it to default in the config file. Some MOC themes are located in /usr/share/moc/themes.
In case you don’t need another window on your crowded desktop, you can use ‘q’ to turn the MOC interface off and then run it again if you need the control. The tracks will keep playing anyway thanks to the build-in sound server.
I hope with this little article I made you want MOC on your desktop. If so, please feel free to leave a comment about your experience with MOC.