From mboxrd@z Thu Jan 1 00:00:00 1970 From: "David O'Toole" Subject: Re: ob-lilypond Date: Tue, 28 Jun 2011 09:18:38 -0400 Message-ID: References: <4E09C50D.5020302@christianmoe.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([140.186.70.92]:45369) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QbYBi-0000DD-Sm for emacs-orgmode@gnu.org; Tue, 28 Jun 2011 09:18:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QbYBg-0000ZS-74 for emacs-orgmode@gnu.org; Tue, 28 Jun 2011 09:18:46 -0400 Received: from mail-gw0-f41.google.com ([74.125.83.41]:53578) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QbYBf-0000ZL-P4 for emacs-orgmode@gnu.org; Tue, 28 Jun 2011 09:18:44 -0400 Received: by gwaa12 with SMTP id a12so84197gwa.0 for ; Tue, 28 Jun 2011 06:18:42 -0700 (PDT) In-Reply-To: <4E09C50D.5020302@christianmoe.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: mail@christianmoe.com Cc: Martyn Jago , Org Mode this is fantastic :) org mode is becoming like the Jupiter of the emacsian solar system. On Tue, Jun 28, 2011 at 8:11 AM, Christian Moe wrot= e: > Hi, > > I'm thrilled that Lilypond has been added to Babel, grateful for the extr= a > thought given to Mac users -- and completely bowled over by your demos! > > Rather than put together complex scores or generate arpeggios the literat= e > programming way, though, all I'd like to do is to easily include simple > snippets of music notation in Org documents (elaboration follows). > > So please consider this a polite request to bump up "Consider the option = to > embed resultant partial musical output into org file" from SOMEDAY to TOD= O > in your task list... > > Use cases: > > - Self-contained documentation, e.g. using Org to author a text like the > Lilypond documentation: much prose with code examples and the results of > those examples interspersed. > > - Writing a musicology paper, with captioned and cross-referenced example= s > (not /my/ use case, but someone might...) > > - Putting together a simple song booklet, such as for a summer camp, with > lyrics and possibly illustrations. (This is my main interest.) > > Ways to do it: > > One (imperfect) solution would be a header argument to just surround the > exported content of Lilypond blocks with the appropriate HTML tags / LaTe= X > environment for lilypond-book to act on, and perhaps a post-processing st= ep > to automatically call lilypond-book on the exported document. I can proba= bly > set up something like this for myself. > > But much better, IMO, would be a way to `evaluate' a single Lilypond bloc= k > and get #+RESULTS with a link to a PNG representing just that snippet of > music. The snippet would then show up in subsequent exports as an include= d > graphic without any post-processing, and could also be viewed in-buffer w= ith > `C-c C-x C-v'. (For my money, this and not `tangle all' would be the > intuitive use of `C-c C-c' on a block, but I understand how your choice > makes sense for other uses.) > > Yours, > Christian > > > > On 6/27/11 3:00 PM, Martyn Jago wrote: >> >> Hi >> >> This is an invitation to try / test ob-lilypond - enabling LilyPond >> Score Generation / Arrangement from within org-mode. >> >> Available on Github at https://github.com/mjago/ob-lilypond >> >> This is a beta release, but includes examples, instructions, and >> tests, and has been tested on OSX and nix. >> >> Any further testing would be helpful. >> >> Following is the readme.org file which is rendered correctly on >> Github... >> >> ---> >> >> * Emacs Org Babel LilyPond Mode >> ** Purpose >> Allow LilyPond Score Generation to take place within Emacs Org-mode >> using literate programming principles. >> >> ** Examples >> Several examples are included >> *** Misty (Jazz Standard utilising org-mode to organise voice and other >> data) >> =A0 =A0 =A0 - Here is an example Org LilyPond File]] exported as HTML >> =A0 =A0 =A0 - Resultant Score exported in pdf format >> =A0 =A0 =A0 - Generated Score export of individual Pages (png) >> *** Modal Cycles (Utilises org-babel and noweb to generate notes) >> =A0 =A0 =A0 - Generated Score >> =A0 =A0 =A0 - Generated Midi File >> *** Modal Cycles 2 (Utilises org-babel and noweb to generate notes) >> =A0 =A0 =A0 - Generated Score >> =A0 =A0 =A0 - Generated Midi File >> *** Modes in the Key of C (another example of polyglot lilypond >> programming) >> =A0 =A0 =A0 - Generated Score >> =A0 =A0 =A0 Generated MIDI File >> >> ** Features >> =A0- Optional Automated LilyPond Compilation following the "Tangling" >> =A0 of a "Literate Org LilyPond" file >> =A0- Optional Automated display of resultant Musical Score following >> compilation >> =A0- Optional Automated playing of the resultant MIDI file following >> compilation >> =A0- Highlights syntax errors in Org file following a failed compilation >> =A0- Integrates with LilyPond-Mode >> =A0- Cross-Platform (OSX, nix, win32) >> >> ** Usage >> >> *** Compiling lilypond source >> Hitting 'C-c C-c' within a lilypond block initiates ly-tangle (tangling = of >> all >> lilypond blocks). Depending on the feature settings, ob-lilypond will >> then either display a pdf of the score, play the generated midi file, >> both, or neither. >> >> 'M-x ly-tangle' can also be called from anywhere in the file >> and can be tied to a function key with something like... >> >> #+begin_src emacs-lisp >> >> =A0(global-set-key [f8] 'ly-dev-tangle) >> >> #+end_src >> >> *** Commands >> >> Some commands are included to quickly disable certain post-tangle >> activities... >> =A0- ly-toggle-midi-play (toggle whether midi will be played following a >> =A0 =A0 =A0successful compilation) >> =A0- ly-toggle-pdf-display (toggle whether pdf will be displayed followi= ng >> =A0 =A0 a successful compilation) >> >> >> NOTE:- If using Timidity for midi playback, kill the midi stream with >> C-g in Emacs >> >> ** Setup (add to emacs init file) >> *** Cloning ob-lilypond >> >> The Files need to be downloaded to your relevant dotfiles directory... >> >> #+BEGIN_SRC sh >> >> git clone https://github.com/mjago/ob-lilypond.git ob-lilypond >> >> #+END_SRC >> >> *** Emacs Initialisation file setup >> >> Require library... >> #+BEGIN_SRC emacs-lisp >> >> (add-to-list 'load-path >> =A0 =A0 =A0 =A0 =A0 =A0 =A0(concat dotfiles-dir =A0"ob-lilypond/lib")) >> (require 'ob-lilypond) >> >> #+END_SRC >> >> >> Add lilypond to your list of babel languages... >> >> #+BEGIN_SRC emacs-lisp >> (org-babel-do-load-languages >> =A0'org-babel-load-languages >> =A0'((ruby . t) >> =A0 =A0(C . t) >> =A0 =A0(emacs-lisp . t) >> =A0 =A0(sh t) >> =A0 =A0(dot t) >> =A0 =A0(clojure t) >> =A0 =A0(ditaa t) >> =A0 =A0(lilypond t) >> =A0 =A0)) >> >> #+END_SRC >> >> ** Requirements >> *** Mac OS X >> =A0- [[http://lilypond.org/][Lilypond]] can be obtained >> [[http://lilypond.org/][here]] >> >> *** nix >> =A0- Lilypond is available here or via the the package manager >> =A0- For MIDI, [[http://timidity.sourceforge.net/][Timidity]] is availab= le >> [[http://timidity.sourceforge.net/][here]] or via the package manager >> =A0- For PDF, [[http://live.gnome.org/Evince/Downloads][Evince]] is >> available >> [[http://live.gnome.org/Evince/Downloads][here]] or via package manager >> >> *** Win32 >> =A0- Currently untested >> >> ** Testing >> >> Tests are provided and can be run by opening >> test/ob-lilypond-tests.org and running the following commands... >> >> =A0- M-x eval-buffer (within ob-lilypond-tests.org >> =A0- M-x ert (t) >> >> Tests are run automatically on source/test file save if ly-project >> (below) has been executed >> >> ** Development >> >> Included also is dev/ob-lilypond.org which includes various helper >> commands used for development, and the development todo list >> =A0- ly-project (code block - evaluate with C-c C-c and execute M-x >> ly-project) >> =A0 =A0- load appropriate files >> =A0 =A0- set up windows >> =A0 =A0- setup project development environment >> =A0 =A0- add continuous testing post-save hook >> =A0 =A0- map F4 to switch between src or test files to control file >> (dev/ob-lilypond.org) >> =A0 =A0- map F8 to 'ly-dev-tangle (tangle test/test-build/test.org file = from >> anywhere) >> =A0- Remove post-save-hook code block >> =A0- Development todo list >> >> <--- >> >> Regards >> >> Martyn >> >> >> > > >