6

In the Emacs Multi-Media System, shuffling by song is as easy as M-xemms-shuffle, but i cant figure out how to shuffle by album, or to add a random album to the playlist. Is this possible?

1
  • I don't think that's a feature (yet), but it seems like it could be fairly straightforward to adapt the code from emms-shuffle to get that behavior.
    – Dan
    Mar 12 '15 at 13:46
2

Here is an extremely crude function that will play a random album in EMMS.

(defun emms-play-random-album ()
  (interactive)
  (emms-browse-by-album)
  (goto-random-line)
  (emms-browser-add-tracks-and-play))

It depends on functions posted to the Emacs Wiki by sburke@cpan.org.

(defun goto-random-line ()
  "Go to a random line in this buffer."
  ; good for electrobibliomancy.
  (interactive)
  (goto-line (1+ (random (buffer-line-count)))))

(defun buffer-line-count () 
  "Return the number of lines in this buffer."
  (count-lines (point-min) (point-max))) 

I'm making this answer a community wiki as I'm sure it could be improved on.

1
1

If calling an external Python script is not a problem, then give Albumbler a try. The website lists EMMS support as "untested", and I haven't had the chance to try it myself, but it might work for you.

1
  • 1
    it does seem to essentially work, but album art is not displayed in the playlist buffer as it typically would be if you added it manually. Mar 14 '15 at 22:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.