From ffc8dbf43b09596db3aa78bbfa8e56220aafc694 Mon Sep 17 00:00:00 2001 From: Martyn Jago Date: Tue, 22 Nov 2011 05:59:20 +0000 Subject: [PATCH] Build fixed - re-commit ob-doc-lilypond without Org examples * org-contrib/babel/languages/ob-doc-lilypond.org: Changed links to avoid loading Org files, to avoid them being exported to HTML by build system --- org-contrib/babel/languages/ob-doc-lilypond.org | 197 ++++++++++++++++++++++++ 1 file changed, 197 insertions(+) create mode 100644 org-contrib/babel/languages/ob-doc-lilypond.org diff --git a/org-contrib/babel/languages/ob-doc-lilypond.org b/org-contrib/babel/languages/ob-doc-lilypond.org new file mode 100644 index 0000000..dd5107b --- /dev/null +++ b/org-contrib/babel/languages/ob-doc-lilypond.org @@ -0,0 +1,197 @@ +#+OPTIONS: H:3 num:nil toc:2 \n:nil @:t ::t |:t ^:{} -:t f:t *:t TeX:t LaTeX:t skip:nil d:(HIDE) tags:not-in-toc +#+STARTUP: align fold nodlcheck hidestars oddeven lognotestate hideblocks +#+SEQ_TODO: TODO(t) INPROGRESS(i) WAITING(w@) | DONE(d) CANCELED(c@) +#+TAGS: Write(w) Update(u) Fix(f) Check(c) noexport(n) +#+TITLE: Org-babel-lilypond +#+AUTHOR: Martyn Jago +#+LANGUAGE: en +#+STYLE: + +#+begin_html +
+

+ Org Babel support for + Lilypond (Score Engraving and Arrangement) +

+

+ + + +

+
+#+end_html + +* Introduction + +An /Emacs Org Babel language/ - provided to allow [[http://lilypond.org][LilyPond]] Music Score generation, complete +with optional auditioning via Midi, whilst leveraging the full power of Org mode, and [[http://en.wikipedia.org/wiki/Literate_programming][Literate Programming]]. + +* Usage + +There are two modes available with ob-lilypond + + - *basic-mode* (default) + + - *arrange-mode* + +Which you use depends on what you intend to do. +(A quick way to switch modes is via `*M-x ly-toggle-arrange-mode*'). + +* basic-mode + +*basic-mode* (the default) allows you to embed LilyPond snippets into an Org-mode file, and +compile and export them using typical Org-mode commands (such as *C-c +C-e d* for pdf export). This is useful if you want to mix +blocks of Lilypond-generated score with text, and perhaps other images for export to Latex, +Docbook, pdf, or HTML. In other words, *basic-mode* could be used as a +very flexible replacement to *lilypond-book*. + +*Warning!* in *basic-mode* a Lilypond source block requires to be passed + a *:file* parameter as shown below, as failure to do so will result + in an error message. + +: #+begin_src lilypond :file Mixolydian.png +: +: \relative c’ { +: g a b c d e f g f e d c b a g a b c d e f g f e d c b a g1 +: } + +The previous block will produce an image file in .png format, which +would be suitable for exporting to HTML for instance. See +[[https://github.com/mjago/ob-lilypond/blob/master/examples/basic-mode/html-example/html-example.org][html-example.org]] for a more complete example. + +To generate a nice image for embedding into a pdf or Latex document, +you might consider using the .eps format as shown in the example +below. + +: #+begin_src lilypond :file Mixolydian.eps +: +: \relative c’ { +: g a b c d e f g f e d c b a g a b c d e f g f e d c b a g1 +: } + +See [[https://github.com/mjago/ob-lilypond/blob/master/examples/basic-mode/pdf-example/pdf-example.org][pdf-example.org]] for a more complete example. + +* Examples + +Following are some examples generated in ob-lilypond Basic Mode: + +** pdf export + + - [[https://github.com/mjago/ob-lilypond/blob/master/examples/basic-mode/pdf-example/pdf-example.pdf?raw=true][Here is an example]] of a pdf file containing high quality vector graphics generated by Org and ob-lilypond. + - [[https://raw.github.com/mjago/ob-lilypond/master/examples/basic-mode/pdf-example/pdf-example.org][and the Org file]] that compiled the LilyPond snippets and exported the pdf. + +** HTML export + + - [[https://github.com/mjago/ob-lilypond/raw/master/examples/basic-mode/html-example/html-example.html][Here is an example ]]of an html page containing images (png) generated by Org-mode and ob-lilypond. + - [[https://raw.github.com/mjago/ob-lilypond/master/examples/basic-mode/html-example/html-example.org][and the Org file]] that compiled the LilyPond snippets and exported the html page. + +* Compiling LilyPond Blocks +In *basic-mode* the key sequence *C-c C-c* within a Lilypond block +will compile the block. Exporting of all blocks and Org file contents +is initialted with the sequence *C-c C-e* (standard Org-mode export keys). + +* Arrange Mode +*arrange-mode* allows you to develop complete pieces of score, whilst +organising sections of the piece using typical Org-mode techniques. And because +you are in Org-mode, you are free to use Literate Programming +techniques to generate things programatically - store information in +tables etc. + +In addition, there are automated features to automatically audition +the piece (via MIDI) and or display the resultant pdf output. + +To change the default mode to Arrange Mode, put the following in your emacs init file: + +: (setq ly-arrange-mode t) + +...or to temporarily switch between modes use the following command: + +: *M-x ly-toggle-arrange-mode* + +Following are examples generated using ob-lilypond in Arrange Mode... + +** Modal Cycles + - [[https://github.com/mjago/ob-lilypond/blob/master/examples/arrange-mode/Modal-Cycle/modal-cycle.pdf?raw=true][Modal Cycles (Utilises org-babel and noweb to generate notes)]] (pdf) + - [[https://github.com/mjago/ob-lilypond/blob/master/examples/arrange-mode/Modal-Cycle/modal-cycle.midi?raw=true][Generated Midi File]] + - [[https://raw.github.com/mjago/ob-lilypond/master/examples/arrange-mode/Modal-Cycle/modal-cycle.org][Source Org File]] + +** Modal Cycles 2 + - [[https://github.com/mjago/ob-lilypond/blob/master/examples/arrange-mode/Modal-Cycle-2/modal-cycle-2.pdf?raw=true][Modal Cycles 2 (Utilises org-babel and noweb to generate notes)]] (pdf) + - [[https://github.com/mjago/ob-lilypond/blob/master/examples/arrange-mode/Modal-Cycle-2/modal-cycle-2.midi?raw=true][Generated Midi File]] + - [[https://raw.github.com/mjago/ob-lilypond/master/examples/arrange-mode/Modal-Cycle-2/modal-cycle-2.org][Source Org File]] + +** Modes in the Key of C + - [[https://github.com/mjago/ob-lilypond/blob/master/examples/arrange-mode/Modes-in-Key-of-C/modes-in-key-of-c.pdf?raw=true][Modes in the Key of C (another example of polyglot lilypond programming)]] (pdf) + - [[https://github.com/mjago/ob-lilypond/blob/master/examples/arrange-mode/Modes-in-Key-of-C/modes-in-key-of-c.midi?raw=true][Generated Midi File]] + - [[https://raw.github.com/mjago/ob-lilypond/master/examples/arrange-mode/Modes-in-Key-of-C/modes-in-key-of-c.org][Source Org File]] + +* Tangling and Compiling LilyPond Blocks +In *arrange-mode*, the key sequence *C-c C-c* within a Lilypond block +initiates `ly-tangle' (tangling of all Lilypond blocks within the +current Org file). Depending on the feature settings, ob-lilypond will +then either /display a pdf/ of the score, /play the generated MIDI +file/, both, or neither. + +The command *M-x ly-tangle* can also be called from anywhere in the file +and could be tied to a function key with something like... + +: (global-set-key [f8] 'ly-tangle) + +Some commands are included in arrange-mode to quickly enable / disable certain post-tangle +activities, including: + + - *ly-toggle-midi-play* (toggle whether midi will be played following a successful compilation) + - *ly-toggle-pdf-display* (toggle whether pdf will be displayed following a successful compilation) + +*NOTE:-* If using [[http://timidity.sourceforge.net/][Timidity]] for MIDI playback, kill the MIDI stream with C-g in Emacs + +* Setup +To use *ob-lilypond*, you must be on a *very recent* version of +org-mode, (since it relies on a command that has been changed very +recently) and will break on older versions (ob-lilypond is also +included in the latest Org-mode by default). + +For information on obtaining the latest Org-mode follow this link +to the [[http://orgmode.org/manual/Installation.html][Org-mode Manual]] and follow the instructions. + +Then, add lilypond to your list of babel languages (in your init +file): + +: (org-babel-do-load-languages +: 'org-babel-load-languages +: '( +: (emacs-lisp . t) +: (sh t) +: (org t) +: (lilypond t))) + +Alternatively you may *require* the ob-lilypond babel language directly: + +: (require 'lilypond) + +To ensure all is correct consider *running the tests* (see below). + +* Requirements + +** Mac OS X + - LilyPond may be [[http://lilypond.org/][downloaded here]] + +** Nix + - LilyPond is [[http://lilypond.org/][available here]] or via the the system-relevant package manager. + - For MIDI, *Timidity* is [[http://timidity.sourceforge.net/][available here]] or via the system-relevant package manager. + - For pdf, *Evince* is [[http://live.gnome.org/Evince/Downloads][available here]] or via package manager. + +** Win32 + - Currently untested, although it should be made to work with minimal fuss. + +* Testing +Tests are provided and can be executed by running the following commands... +(for more help and information on testing see [[file:../../../org-tests/index.html][Testing Org]]. + +: M-x load-file RET testing/lisp/test-ob-lilypond.el +: M-x ert t + +* Issues +Any issues should be reported to the [[http://orgmode.org][Org-mode Mailing-list]] + -- 2.11.4.GIT