Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/debanjum/org-music

Play music from your music library in org-mode
https://github.com/debanjum/org-music

emacs emms music-library org-mode youtube-dl

Last synced: about 1 month ago
JSON representation

Play music from your music library in org-mode

Awesome Lists containing this project

README

        

* Org-Music
- Play music from your music library in [[https://orgmode.org][Org-mode]] via Youtube
- Get [[https://syncthing.net/][syncing]], [[https://magit.vc][versioning]], [[https://orgmode.org/guide/Tags.html][tagging]], [[https://orgmode.org/manual/Org-Export.html#Org-Export][sharing]], [[https://orgmode.org/worg/org-tutorials/advanced-searching.html][advanced search]], dynamic playlists straight out of the box

** Usage
1. Install Org-Music by following instructions below
5. Open [[./sample/sample.org][sample.org]] in Emacs
6. ~M-x org-music-mode~
7. Press speed-key ~o~ on a song to play it

*** Demo
[[./sample/play-org-music-demo.gif]]

** Setup
*** Straight.el
- Add below snippet to your Emacs init.el
#+begin_src elisp
;; Org-Music Mode
(use-package org-music
:straight (org-music :type git :host github :repo "debanjum/org-music")
:after (org emms)
:init (progn
(setq
org-music-file "~/Notes/Music.org"
org-music-media-directory "~/Music/OrgMusic/"
org-music-operating-system "linux")
(add-hook
'org-mode-hook
(lambda()
(if (equal buffer-file-name (expand-file-name org-music-file))
(org-music-mode))))))
#+end_src

*** Basic
1. Install below dependencies
2. Copy [[./org-music.el][org-music.el]] to your Emacs [[https://www.emacswiki.org/emacs/LoadPath][load-path]]
3. Add below minimal snippet to your Emacs init.el
#+begin_src elisp
;; Org-Music Mode
(use-package org-music
:load-path "lisp/org-music.el" ; relative path to org-music.el on your local device
:init (progn
(setq
org-music-file "~/Notes/Music.org"
org-music-media-directory "~/Music/OrgMusic/"
org-music-operating-system "linux")))
#+end_src
4. ~M-x load-file RET init.el~

*** Dependencies
1. [[https://ytdl-org.github.io/youtube-dl/][youtube-dl]]: For downloading songs from youtube.
2. [[https://www.gnu.org/software/emms/][emms]]: For playing songs on emacs

** Why was this tool created?
I was sick of the ad-hoc ephemerality of my music collection. I loved the simple sturdiness of plain-text, emacs and org-mode.
Who wants to lose songs, playlists and discover the latest in clunky search interfaces when you can flow in plaintext with emacs and org-mode forever?

** Where are all the features?
- It's plain text so you get versioning, syncing, full-text search with your tool of choice out of the box
- It's an org-mode file so you get tags, semantic search, dynamic playlists
- It's Emacs so you get to play, interact and extend your library (and org-music) without ever leaving Emacs

- Arrange your music collection the way you like it.
Let your music library reflect the path dependent nature of it's creation or convert it into a sanitary, homogenized artist/album/song library.
You can choose to do whatever you want with it.

- Don't let you playlists be locked away on someone else's cloud.
Carry or sync your music collection everywhere. It's a text file after all.

** Where is the actual music?
*The org file is just metadata about your media collection*.
1. Org-music maintains a local cache directory where recently played media files reside
2. If the song is not available in the cache directory it downloads music from Youtube by default
3. The user can also explicitly specify the data source and query to search and stream music.
Currently Youtube (default), nextcloud and local storage are supported as data sources.
It can be easily extended to work with other data sources.

** When was this tool actually created?
It has been in non-continuous development for way longer than I'd care to admit (or remember).
It's been my primary music library since 2014 and primary music player since 2018.

It started of as a soft-linked ghost replica of my then music library.
I'd click the file, that'd call a shell script, that'd search on Duckduckgo for a Youtube url of the clicked filename, that VLC would then stream from Youtube!
The setup has become a bit more civilized since then.