presentation.org 0000644 0001750 0001750 00000014502 13761053776 014233 0 ustar shoshin shoshin #+TITLE: Bard Bivou(m)acs
#+AUTHOR: Grant Shangreaux
#+EMAIL: grant@churls.world
* Publishing Music with Emacs
[[file:intro.png]]
** Motivation
*** Music is not a consumer good
- it is a form of knowledge, like an algorithm
- it permeates, informs, and shapes culture
- it can be shared without impacting anyone's freedom
- there is much more to say about this, but i don't have time ;)
*** Emacs is ✨super magical✨!
*THE SUPER MAGICAL, ALL-IN-ONE SOLUTION!*
- GNU software aligns with Creative Commons 💙
- File management 🗄
- HTML, CSS, JavaScript authoring (even literate style!)
- can be extended to handle media and metadata
- Version control
- Remote server access
** How do you use Emacs to publish music?
- [X] audition unlabeled audio tracks
- [X] easily add metadata to various audio formats
- [X] automatically rename files
- [X] programmatically produce web page
:100:
*** EMMS - The Emacs Multi-Media System
- organize playlists
- browse and edit track and album metadata
- play many formats using configurable external players
**** 💪🏾 Superpowered 💪🏾 metadata authoring
- enable markable playlists ~(require 'emms-mark)~
- add the files you want to edit to a playlist and mark
- press ~E~ to open the tag editor
- ~M-x emms-tag-editor-set-all~ or ~C-c C-r~ sets tag value on all tracks
- access to all emacs keybindings/editing commands
- keyboard macros and registers to speed things up
*** Emacs makes HTML trivial
As I was developing the script to produce the HTML
for the album, the flexibility of Emacs to generate
and manipulate text gave me several options to fit
the needs of the project.
**** Buffer Scripting
Everything you can do in an Emacs buffer is scriptable.
I could think about how I would write it myself, and
turn it into a repeatable script. However, this becomes
hard to think about for a larger block of text.
***** simple example
#+begin_src emacs-lisp
(with-temp-buffer
(insert "
") (newline)
(insert (concat " my cool content x "
(int-to-string (random 100))))
(newline)
(insert "
")
(buffer-string))
#+end_src
#+RESULTS:
:
: my cool content x 84
:
***** building a list element for a track
#+BEGIN_SRC emacs-lisp
(defun encode-track-list-element (track)
"Creates an HTML list element with TRACK"
(let ((file (cdr (assoc 'name (cdr track))))
(title (cdr (assoc 'info-title (cdr track))))
(number (cdr (assoc 'info-tracknumber (cdr track)))))
(insert "
") (newline)))
#+END_SRC
**** Snippets (skip)
- started with yasnippet html snippets
- can programmatically insert snippets with (yas-insert-snippet ...)
- this works well with buffer scripting
- in the end i dropped it in favor of format strings
**** ~format~ strings
- ~format~ is a powerful Elisp macro for formatting text
- in my use case, its basically string interpolation
#+begin_src emacs-lisp
(format "I ate %s %s at %s." (random 10) 'apples 'lunch))
#+end_src
#+RESULTS:
: I ate 2 apples at lunch.
***** use in the generator code
#+BEGIN_SRC emacs-lisp
(defun generate-album-html (dir)
(interactive "DDirectory: ")
(let* ((tracks (process-dir-to-tracks dir))
(cover (concat (file-name-as-directory dir) "cover.png"))
(artist (cdr (assoc 'info-artist (cdr (cadr tracks)))))
(album (cdr (assoc 'info-album (cdr (cadr tracks)))))
(title (concat artist " - " album)))
(with-temp-file "basement-days.html"
(html-mode)
(insert
;; title(page) | tracklist | title | cover
(format bard-bivoumacs-template title (tracklist-html tracks) title cover))
(indent-region (point-min) (point-max)))))
#+END_SRC
*** Org Babel for multi-language elements
**** HTML Blocks as format templates
This is actually slightly problematic, due to how org handles noweb expansion,
but there are several ways to accomplish this.
#+name: main-content
#+BEGIN_SRC html
:
**** CSS/JS blocks either tangled or inlined
#+name: style
#+BEGIN_SRC css
body {
background: steelblue;
}
#+END_SRC
#+name: script
#+BEGIN_SRC javascript
var someStuff;
console.log(someStuff)
#+END_SRC
#+BEGIN_SRC html :noweb yes
My Page
<>
#+END_SRC
**** SVG authoring and preview for buttons
[[file:play-button.svg]]
#+BEGIN_SRC xml :tangle play-button.svg
#+END_SRC
*** Additional Considerations
- Fonts that use a free license
- Content License - CC By-SA
- server hardware/software
- remove idiosyncracy
- not requiring web browser
- easy album downloads
** Bard Bivoumacs alpha in action!
- http://churls.world/casiopeia%20-%20basement%20days/basement-days.html
- http://churls.world will have more to come (and easier to write down)
- shoshin on #emacs and sr.ht, gcentauri on github
- personal: grant@churls.world, professional: grant@unabridgedsoftware.com
intro.png 0000644 0001750 0001750 00000570161 13756317746 012664 0 ustar shoshin shoshin �PNG
IHDR � � f�� 5zTXtRaw profile type exif xڭ�i��'�E���Z�p��w���sy9H�2��������}���qp�����_!��].��Q��<��t����k�����s�����?w�|�6�k�����z>������/�������]��ob����_p��Oҝ���������y���_ߛ���������_�����K�œB����.�������)���I�%�?����ۿ����������P8_�>P�2F_?�/?���F��'
�Ǭ���Ưy���ݻ����v3WF�������;>����V��������w�o������_sa��ߐ�3�pޯ�G���Ư1㮟��∖4Y��[i�ԙc�?�?�%���w?�;��'c�b�o��_���7���н��4��x