MOC (Music on Console): Light music player for the terminal

Introduction

In the world of free software, finding tools that consume few resources and offer a full experience is always an advantage. MOC (Music on Console) is an audio player designed exclusively for terminal operation, ideal for servers, old equipment or users who prefer to work without heavy graphic environments. Its ncurses-based interface allows you to browse folders, create playlists and control playback with intuitive keys, all while maintaining virtually insignificant CPU and memory consumption.

What is MOC?

MOC is a text-mode music player that supports a wide variety of formats such as MP3, Ogg Vorbis, FLAC, WAV and more, thanks to FFmpeg or libmad decoding libraries. It consists of two parts: the daemonmocpwhich manages the background reproduction and the interface client that is launched with the same command. This architecture allows you to close the terminal window without stopping the music, as the process continues to run in background.

Installation in Linux distributions

  • Ubuntu / Debian:sudo apt-get update && sudo apt-get install moc
  • Fedora:sudo dnf install moc
  • Arch Linux:sudo pacman -S moc
  • OpenSUSE:sudo zypper install moc

After installation, the service does not start automatically; just runmocpin any terminal to launch both the daemon and the interface.

Basic configuration

The configuration file is found in~/.moc/config. There you can adjust options such as the default music directory, the color theme, the behavior at the end of a list and the use of equalizer. For example, to set the music folder in~/Músicaand activate the dark theme, simply add the lines:
MusicDir = "~/Música"
Theme = "dark_background"
Then save the file and restartmocpfor the changes to take effect.

Daily use: essential commands

  • Launch the player:mocp
  • Browse folders: use the arrows up / down to move andEnterto enter a directory or play a file.
  • Reproduction control:Spacepause / resume,nnext track,bprevious,sStop.
  • Create playlist: pressato add the current item to the waiting list,Cto erase it.
  • Go out without stopping the music: pressq; reproduction will continue in the background and can be reopened with anothermocp.

Advanced features

  • Format support: In addition to the standard, MOC can read AAC, M4A, WMA and FLAC files using the codecs installed in the system.
  • Themes and colors: there are several predefined themes (e.g.,dark_background, transparent_background) and it is possible to create one's own by modifying the color values in the configuration file.
  • Integration with scripts: using the server mode (mocp -S) can be sent bymocp -p(play),mocp -g(next) ormocp -t(toggle) from any bash script or external application.
  • Equalizer and effects: a 10-band equalizer can be activated by the optionEqualizer = "yes"and adjust bands byEq1aEq10.
  • Letras and methadata: with the pluginlyrics(available in some repositories) MOC shows the lyrics of the current song in real time.

Advantages to other players

Compared to graphic players such as Clementine, Rhythmbox or VLC, MOC stands out for its low resource consumption, making it perfect for machines with limited hardware or for remote working sessions using SSH. Its dependence on only ncurses libraries and audio decoding eliminates the need to load complete graphic environments, reducing the attack surface and improving stability. In addition, the ability to control reproduction through line commands facilitates automation, integration with tiling window managers and use in embedded systems such as Raspberry Pi.

Conclusion

MOC shows that power does not always need a striking interface; sometimes efficiency and simplicity are the best virtues of a software. If you are looking for a music player that is fast, configurable and works smoothly in any terminal environment, MOC is an option worth testing. Just install, set up your music folder and let the terminal become your auditory entertainment center.

This work is under aCreative Commons License Attribution 4.0 International for Francesc Roig francesc @ vivaldi.net.

EnglishenEnglishEnglish