reddit / emacs
What is the best music player out there for emacs?
thefuckingpineapple · 2022-06-29 07:07
I'm looking for something as good as cmus but on emacs
doolio_ · 2022-06-29 07:40
[Emms](https://www.gnu.org/software/emms/)?
zobi8225 · 2022-06-29 07:45
I build this stuff long time ago :
[https://github.com/thomasluquet/playerctl.el](https://github.com/thomasluquet/playerctl.el)
pajuch · 2022-06-29 07:59
Broken link
[deleted] · 2022-06-29 08:00
[deleted]
unixbhaskar · 2022-06-29 08:12
Somebody in the comment already mentioned EMMS ....that is seems more native and I do use it.
Easy to configure ...easy to use.
While listening music , it should not be a hassle , right?
EMMS fits the bill for me.
thefuckingpineapple · 2022-06-29 08:25
do you use it as your main music/video player?
I was hoping it to have different list views like cmus does but haven't been able to find it. everything added shows in playlist-mode and I can't find the specific ones I want as the folder names are not shown
unixbhaskar · 2022-06-29 08:34
>do you use it as your main music/video player?
While inside emacs , I do use it . Outside on the system , I do use CMUS as my main music player. I do use MPV too as music/video facility on system too. (In fact you can tap mpv from emacs too).
EMMS has precisely 289 options (if you do , Meta-X emms), I am sure one of the option will satisfy your precise need.
pajuch · 2022-06-29 08:37
Emms is really not the ultimate solution, doesn't work like cmus without a bunch of work, and for me is buggy (audio glitching). However I've not found anything better... There's also bongo, but I don't like it. Following to hear more obscure packages
zobi8225 · 2022-06-29 09:15
i have repared it
redguardtoo · 2022-06-29 10:03
Emms is is kind of standard answer.
You can start emacs as a daemon, then run `emacsclient` in batch mode to pass some emms command to the daemon. In this way, you can easily use the multimedia keyboard to control the emms which is running inside emacs daemon.
See http://blog.binchen.org/posts/configure-emms-emacs-multi-media-system-for-multimedia-keyboard/ for how I set up i3wm to control emms.
some sample emms setup,
```lisp
(defun my-strip-path (path strip-count)
"Strip PATH with STRIP-COUNT."
(let* ((i (1- (length path)))
str)
(while (and (> strip-count 0)
(> i 0))
(when (= (aref path i) ?/)
(setq strip-count (1- strip-count)))
(setq i (1- i)))
(setq str (if (= 0 strip-count) (substring path (1+ i)) path))
(replace-regexp-in-string "^/" "" str)))
;; {{ emms
(with-eval-after-load 'emms
;; minimum setup is more robust
(emms-minimalistic)
;; only show file track's base name
(setq emms-track-description-function
(lambda (track)
(let ((desc (emms-track-simple-description track))
(type (emms-track-type track)))
(when (eq 'file type)
(setq desc (my-strip-path desc 2)))
desc)))
(setq emms-source-file-exclude-regexp
(concat "\\`\\(#.*#\\|.*,v\\|.*~\\|\\.\\.?\\|\\.#.*\\|,.*\\)\\'\\|"
"/\\(CVS\\|RCS\\|\\.dropbox.attr\\|\\.git\\|,.*\\|\\.svn\\)\\(/\\|\\'\\)"))
(setq emms-player-list '(emms-player-mplayer
emms-player-vlc)))
;; }}
```
I try to keep everything simple, so I use mplayer to play the music (vlc is just backup player I rarely use).
Play my favourite music,
```lisp
(defun my-music ()
"My music."
(interactive)
(emms-play-directory-tree "~/Dropbox/music")
(emms-shuffle)
(emms-next))
```
I use emms to play workout video,
```lisp
(defun my-own-gym ()
"I'm my own gym."
(interactive)
(emms-play-playlist "~/workout/workout.m3u"))
```
Play random Mozart,
```lisp
(defvar my-emms-playlist-random-track-keyword "mozart"
"Keyword to find next random track in emms playlist.")
(defun my-emms-playlist-random-track ()
"Play random track in emms playlist."
(interactive)
;; shuffle the playlist
(emms-shuffle)
(emms-next)
(with-current-buffer emms-playlist-buffer-name
(goto-char (point-min))
(let* ((case-fold-search t))
(search-forward my-emms-playlist-random-track-keyword)
(emms-playlist-mode-play-smart)))
;; show current track info
(emms-show))
```
Play media files (mp3, mkv, mp4, flac ...) under current directory,
https://github.com/redguardtoo/emacs.d/blob/d66c484c9416df59937f27684f515e5ac4a97f2a/lisp/init-misc.el#L1172
In summary, emms is too powerful. A bit knowledge of shell, cli, lisp might be useful to help you truly master emms. For example, if you know mplayer is the best video/audio cli player and use mplayer as emms backend, you won't have any audio glich issue.
thefuckingpineapple · 2022-06-29 10:16
wow, what you're doing with function use is amazing.
Would you know how I can make EMMS show album/artist like cmus does?
https://en.wikipedia.org/wiki/Cmus#/media/File:Cmus-aamode.png
redguardtoo · 2022-06-29 11:11
Not sure. But see https://www.gnu.org/software/emms/manual/#Track-Information
Looks you need corresponding command line tools and set up `emms-info-functions`
Mortal_Scum · 2022-06-29 11:34
I'm actually a fan of the built-in mpc mode in Emacs. It's literally just a front-end for mpd (issuing commands via mpc). Some folks find the layout a bit confusing, but I kind of like it since it's basically like a giant panel with all the info you need, all music metadata is buffer-searchable, and there are no playlist conflicts since mpd runs everything. It needs a few quality-of-life custom commands but it's pretty hackable and I was able to get to a comfortable configuration without any programming experience. Plus, since it's mpd that's running, you can assign any system-wide keybindings you want without involving the Emacs daemon.
I think EMMS and bongo inarguably provide a wider suite of functionality, but I honestly found them harder to set up and a bit more clunky when navigating between all the associated buffers. Plus there's other stuff out there like mpdel, mingus, etc. - there are a lot of options.
F0rmbi · 2022-06-29 13:02
I like mingus (an mpd interface)
CloudsOfMagellan · 2022-06-29 13:21
I use a custom fork of smudge
It it's for interfacing with Spotify then I use Spotifyd as my player
pajuch · 2022-06-29 14:50
emms-browser
atgreen · 2022-06-29 15:14
I love that this is even a question.
Extension_Try_6870 · 2022-06-29 20:04
I'm also a fan of the built-in mpc mode. I'm interested to see what custom commands you implemented if any.
Mortal_Scum · 2022-06-30 00:53
Nice - there are dozens of us!
It's a fair bit of code, so it's probably easier to just look at my Emacs configuration [here](https://gitlab.com/matogoro/emacs-config). They're in the main init file, under the `use-package` declaration for `mpc`.
I'd say the most useful functions are the ones that allow you to deselect all songs, or move all selected selected songs to a point (instead of just appending them every time). Hopefully you find them useful!
thefuckingpineapple · 2022-06-30 05:24
?
arthurno1 · 2022-06-30 10:31
That would definitely depend on your expectations.
My personal favorite is mpv player on both gnu/LInux and Windows since it can play almost any file on its own.
I sometimes play a directory or a file just by executing M-& (async sheell command), sometimes I play directories via emms. Sometimes I play a file by opening in external command via [openwith.el script](https://github.com/amno1/.emacs.d/blob/main/lisp/openwith.el), if I am in dired buffer. It all depends, but I don't have need for playlists, cover search and all that jazz that musicplayers usually do. I know there are also some other pacakges that wrap mpv for Emacs, nvlisp has one I think, but you will have to search, I don't use any of other players.
arthurno1 · 2022-06-30 10:36
> do you use it as your main music/video player?
Emms is not a player itself, it is a packages that manages your interaction with external audio/video players. Emacs on its own does not play mp3 and video files, you need an external audio/video player such as mpv, vlc, etc.
You can interact with those from within Emacs so you don't have to switch back and forth between external applications and Emacs, and Emms is probably the most advanced (and complex) pacakges that tries to provide framework for interacting with any external player. I recommend Emms, but you can also search around and use any of numerous lighter packages that interact with your favorite music player exclusively.
dzecniv · 2022-07-01 06:48
I quite used Bongo: https://github.com/dbrock/bongo not as fully featured as Emms or cmus, but good and simple.
~~mpg123: even simpler. https://www.emacswiki.org/emacs/Mpg123~~ broken in Emacs 27. Too bad, I liked it.
dzecniv · 2022-07-01 06:53
https://wikemacs.org/wiki/Media_player
EMMS, Bongo, Dionysos, mpdel, Vuiet
seagle0128 · 2022-07-01 17:33
[https://github.com/dbrock/bongo](https://github.com/dbrock/bongo) or builtin mpc?
Extension_Try_6870 · 2022-07-02 12:38
Thanks.