emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* ob-lilypond
@ 2011-06-27 13:00 Martyn Jago
  2011-06-27 18:53 ` ob-lilypond Eric Schulte
  2011-06-28 12:11 ` ob-lilypond Christian Moe
  0 siblings, 2 replies; 30+ messages in thread
From: Martyn Jago @ 2011-06-27 13:00 UTC (permalink / raw)
  To: emacs-orgmode

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)
      - Here is an example Org LilyPond File]] exported as HTML
      - Resultant Score exported in pdf format
      - Generated Score export of individual Pages (png)
*** Modal Cycles (Utilises org-babel and noweb to generate notes)
      - Generated Score
      - Generated Midi File
*** Modal Cycles 2 (Utilises org-babel and noweb to generate notes)
      - Generated Score
      - Generated Midi File
*** Modes in the Key of C (another example of polyglot lilypond programming)
      - Generated Score
      Generated MIDI File

** Features
 - Optional Automated LilyPond Compilation following the "Tangling"
  of a "Literate Org LilyPond" file
 - Optional Automated display of resultant Musical Score following compilation
 - Optional Automated playing of the resultant MIDI file following compilation
 - Highlights syntax errors in Org file following a failed compilation
 - Integrates with LilyPond-Mode
 - 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

 (global-set-key [f8] 'ly-dev-tangle)

#+end_src

*** Commands

Some commands are included to quickly disable certain post-tangle
activities...
 - 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 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
             (concat dotfiles-dir  "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
 'org-babel-load-languages
 '((ruby . t)
   (C . t)
   (emacs-lisp . t)
   (sh t)
   (dot t)
   (clojure t)
   (ditaa t)
   (lilypond t)
   ))

#+END_SRC
 
** Requirements
*** Mac OS X
 - [[http://lilypond.org/][Lilypond]] can be obtained [[http://lilypond.org/][here]]

*** nix
 - Lilypond is available here or via the the package manager
 - For MIDI, [[http://timidity.sourceforge.net/][Timidity]] is available 
[[http://timidity.sourceforge.net/][here]] or via the package manager
 - For PDF, [[http://live.gnome.org/Evince/Downloads][Evince]] is available 
[[http://live.gnome.org/Evince/Downloads][here]] or via package manager

*** Win32
 - Currently untested

** Testing

Tests are provided and can be run by opening
test/ob-lilypond-tests.org and running the following commands...

 - M-x eval-buffer (within ob-lilypond-tests.org
 - 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
 - ly-project (code block - evaluate with C-c C-c and execute M-x ly-project) 
   - load appropriate files
   - set up windows
   - setup project development environment
   - add continuous testing post-save hook
   - map F4 to switch between src or test files to control file (dev/ob-lilypond.org)
   - map F8 to 'ly-dev-tangle (tangle test/test-build/test.org file from anywhere)
 - Remove post-save-hook code block
 - Development todo list

<---

Regards

Martyn

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: ob-lilypond
  2011-06-27 13:00 ob-lilypond Martyn Jago
@ 2011-06-27 18:53 ` Eric Schulte
  2011-06-28  9:38   ` ob-lilypond Martyn Jago
  2011-06-28 12:11 ` ob-lilypond Christian Moe
  1 sibling, 1 reply; 30+ messages in thread
From: Eric Schulte @ 2011-06-27 18:53 UTC (permalink / raw)
  To: Martyn Jago; +Cc: emacs-orgmode

Hi Martyn,

This looks great, I look forward to testing it out, although my music
composition experience is limited to using Finale in a high-school music
theory class.

It sounds like your plan is to keep this on github during the first
trial and debugging stages.  At some point I would love to include this
into the Org-mode core.

Part of me is tempted to push for immediate integration so that this is
released with Emacs24 (we could push bug fixes throughout the fall),
however this may be too much code for just before an Org-mode release.

Thanks for sharing! -- Eric

Martyn Jago <martyn.jago@btinternet.com> writes:

> 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)
>       - Here is an example Org LilyPond File]] exported as HTML
>       - Resultant Score exported in pdf format
>       - Generated Score export of individual Pages (png)
> *** Modal Cycles (Utilises org-babel and noweb to generate notes)
>       - Generated Score
>       - Generated Midi File
> *** Modal Cycles 2 (Utilises org-babel and noweb to generate notes)
>       - Generated Score
>       - Generated Midi File
> *** Modes in the Key of C (another example of polyglot lilypond programming)
>       - Generated Score
>       Generated MIDI File
>
> ** Features
>  - Optional Automated LilyPond Compilation following the "Tangling"
>   of a "Literate Org LilyPond" file
>  - Optional Automated display of resultant Musical Score following compilation
>  - Optional Automated playing of the resultant MIDI file following compilation
>  - Highlights syntax errors in Org file following a failed compilation
>  - Integrates with LilyPond-Mode
>  - 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
>
>  (global-set-key [f8] 'ly-dev-tangle)
>
> #+end_src
>
> *** Commands
>
> Some commands are included to quickly disable certain post-tangle
> activities...
>  - 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 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
>              (concat dotfiles-dir  "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
>  'org-babel-load-languages
>  '((ruby . t)
>    (C . t)
>    (emacs-lisp . t)
>    (sh t)
>    (dot t)
>    (clojure t)
>    (ditaa t)
>    (lilypond t)
>    ))
>
> #+END_SRC
>  
> ** Requirements
> *** Mac OS X
>  - [[http://lilypond.org/][Lilypond]] can be obtained [[http://lilypond.org/][here]]
>
> *** nix
>  - Lilypond is available here or via the the package manager
>  - For MIDI, [[http://timidity.sourceforge.net/][Timidity]] is available 
> [[http://timidity.sourceforge.net/][here]] or via the package manager
>  - For PDF, [[http://live.gnome.org/Evince/Downloads][Evince]] is available 
> [[http://live.gnome.org/Evince/Downloads][here]] or via package manager
>
> *** Win32
>  - Currently untested
>
> ** Testing
>
> Tests are provided and can be run by opening
> test/ob-lilypond-tests.org and running the following commands...
>
>  - M-x eval-buffer (within ob-lilypond-tests.org
>  - 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
>  - ly-project (code block - evaluate with C-c C-c and execute M-x ly-project) 
>    - load appropriate files
>    - set up windows
>    - setup project development environment
>    - add continuous testing post-save hook
>    - map F4 to switch between src or test files to control file (dev/ob-lilypond.org)
>    - map F8 to 'ly-dev-tangle (tangle test/test-build/test.org file from anywhere)
>  - Remove post-save-hook code block
>  - Development todo list
>
> <---
>
> Regards
>
> Martyn
>
>

-- 
Eric Schulte
http://cs.unm.edu/~eschulte/

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: ob-lilypond
  2011-06-27 18:53 ` ob-lilypond Eric Schulte
@ 2011-06-28  9:38   ` Martyn Jago
  2011-06-28 10:07     ` ob-lilypond Bastien
  2011-06-28 13:38     ` ob-lilypond Cameron Horsburgh
  0 siblings, 2 replies; 30+ messages in thread
From: Martyn Jago @ 2011-06-28  9:38 UTC (permalink / raw)
  To: emacs-orgmode


Hi Eric

> Eric Schulte <schulte.eric <at> gmail.com> writes:
>
> Hi Martyn,
> 
> This looks great, I look forward to testing it out, although my music
> composition experience is limited to using Finale in a high-school music
> theory class.
> 
> It sounds like your plan is to keep this on github during the first
> trial and debugging stages.  At some point I would love to include this
> into the Org-mode core.
> 

Thanks - I'm no LilyPond expert myself, and so a heads-up from a more 
proficient LilyPond user would be great. Likewise the ins and outs of 
LilyPond-mode. That said, it is working well for me and my use-case, and 
it is great to be generating music and score out of org-mode - it feels a 
good fit, which is testament to the flexability of org-babel and org-mode.

> Part of me is tempted to push for immediate integration so that this is
> released with Emacs24 (we could push bug fixes throughout the fall),
> however this may be too much code for just before an Org-mode release.
> 
> Thanks for sharing! -- Eric
> 

I'll leave that decision to you, but certainly if the software is useful 
to others, I am happy to see it distributed. Actually, I only recently 
discovered how busy Lilypond development is, so there must be potential 
users out there. Perhaps I should bite the bullet and approach the Lilypond
user mailing list to see if there is any interest there?

Regards

Martyn


> Martyn Jago <martyn.jago <at> btinternet.com> writes:
<...>
> 

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: ob-lilypond
  2011-06-28  9:38   ` ob-lilypond Martyn Jago
@ 2011-06-28 10:07     ` Bastien
  2011-06-28 10:21       ` ob-lilypond Bastien
  2011-06-28 13:38     ` ob-lilypond Cameron Horsburgh
  1 sibling, 1 reply; 30+ messages in thread
From: Bastien @ 2011-06-28 10:07 UTC (permalink / raw)
  To: Martyn Jago; +Cc: emacs-orgmode

Hi Martyn,

Martyn Jago <martyn.jago@btinternet.com> writes:

> Actually, I only recently discovered how busy Lilypond development is,
> so there must be potential users out there.

Indeed -- Lilypond is an old GNU project, I guess there are many Emacs
gnusers.  I would love to include ob-lilypond.el in the next release, it
adds a nice functionality and cannot break anything.

Thanks!

-- 
 Bastien

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: ob-lilypond
  2011-06-28 10:07     ` ob-lilypond Bastien
@ 2011-06-28 10:21       ` Bastien
  2011-06-28 20:45         ` ob-lilypond Eric Schulte
  0 siblings, 1 reply; 30+ messages in thread
From: Bastien @ 2011-06-28 10:21 UTC (permalink / raw)
  To: Martyn Jago; +Cc: emacs-orgmode

Bastien <bzg@altern.org> writes:

> Indeed -- Lilypond is an old GNU project, I guess there are many Emacs
> gnusers.  I would love to include ob-lilypond.el in the next release, it
> adds a nice functionality and cannot break anything.

I forgot to mention that I leave this decision to Eric, of course.

-- 
 Bastien

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: ob-lilypond
  2011-06-27 13:00 ob-lilypond Martyn Jago
  2011-06-27 18:53 ` ob-lilypond Eric Schulte
@ 2011-06-28 12:11 ` Christian Moe
  2011-06-28 13:18   ` ob-lilypond David O'Toole
  2011-06-28 17:06   ` ob-lilypond Martyn Jago
  1 sibling, 2 replies; 30+ messages in thread
From: Christian Moe @ 2011-06-28 12:11 UTC (permalink / raw)
  To: Martyn Jago; +Cc: Org Mode

Hi,

I'm thrilled that Lilypond has been added to Babel, grateful for the 
extra thought given to Mac users -- and completely bowled over by your 
demos!

Rather than put together complex scores or generate arpeggios the 
literate 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 TODO 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 
examples (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 
/ LaTeX environment for lilypond-book to act on, and perhaps a 
post-processing step to automatically call lilypond-book on the 
exported document. I can probably set up something like this for myself.

But much better, IMO, would be a way to `evaluate' a single Lilypond 
block 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 included graphic without any post-processing, and could also be 
viewed in-buffer with `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)
>        - Here is an example Org LilyPond File]] exported as HTML
>        - Resultant Score exported in pdf format
>        - Generated Score export of individual Pages (png)
> *** Modal Cycles (Utilises org-babel and noweb to generate notes)
>        - Generated Score
>        - Generated Midi File
> *** Modal Cycles 2 (Utilises org-babel and noweb to generate notes)
>        - Generated Score
>        - Generated Midi File
> *** Modes in the Key of C (another example of polyglot lilypond programming)
>        - Generated Score
>        Generated MIDI File
>
> ** Features
>   - Optional Automated LilyPond Compilation following the "Tangling"
>    of a "Literate Org LilyPond" file
>   - Optional Automated display of resultant Musical Score following compilation
>   - Optional Automated playing of the resultant MIDI file following compilation
>   - Highlights syntax errors in Org file following a failed compilation
>   - Integrates with LilyPond-Mode
>   - 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
>
>   (global-set-key [f8] 'ly-dev-tangle)
>
> #+end_src
>
> *** Commands
>
> Some commands are included to quickly disable certain post-tangle
> activities...
>   - 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 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
>               (concat dotfiles-dir  "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
>   'org-babel-load-languages
>   '((ruby . t)
>     (C . t)
>     (emacs-lisp . t)
>     (sh t)
>     (dot t)
>     (clojure t)
>     (ditaa t)
>     (lilypond t)
>     ))
>
> #+END_SRC
>
> ** Requirements
> *** Mac OS X
>   - [[http://lilypond.org/][Lilypond]] can be obtained [[http://lilypond.org/][here]]
>
> *** nix
>   - Lilypond is available here or via the the package manager
>   - For MIDI, [[http://timidity.sourceforge.net/][Timidity]] is available
> [[http://timidity.sourceforge.net/][here]] or via the package manager
>   - For PDF, [[http://live.gnome.org/Evince/Downloads][Evince]] is available
> [[http://live.gnome.org/Evince/Downloads][here]] or via package manager
>
> *** Win32
>   - Currently untested
>
> ** Testing
>
> Tests are provided and can be run by opening
> test/ob-lilypond-tests.org and running the following commands...
>
>   - M-x eval-buffer (within ob-lilypond-tests.org
>   - 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
>   - ly-project (code block - evaluate with C-c C-c and execute M-x ly-project)
>     - load appropriate files
>     - set up windows
>     - setup project development environment
>     - add continuous testing post-save hook
>     - map F4 to switch between src or test files to control file (dev/ob-lilypond.org)
>     - map F8 to 'ly-dev-tangle (tangle test/test-build/test.org file from anywhere)
>   - Remove post-save-hook code block
>   - Development todo list
>
> <---
>
> Regards
>
> Martyn
>
>
>

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: ob-lilypond
  2011-06-28 12:11 ` ob-lilypond Christian Moe
@ 2011-06-28 13:18   ` David O'Toole
  2011-06-28 17:06   ` ob-lilypond Martyn Jago
  1 sibling, 0 replies; 30+ messages in thread
From: David O'Toole @ 2011-06-28 13:18 UTC (permalink / raw)
  To: mail; +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 <mail@christianmoe.com> wrote:
> Hi,
>
> I'm thrilled that Lilypond has been added to Babel, grateful for the extra
> thought given to Mac users -- and completely bowled over by your demos!
>
> Rather than put together complex scores or generate arpeggios the literate
> 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 TODO
> 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 examples
> (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 / LaTeX
> environment for lilypond-book to act on, and perhaps a post-processing step
> to automatically call lilypond-book on the exported document. I can probably
> set up something like this for myself.
>
> But much better, IMO, would be a way to `evaluate' a single Lilypond block
> 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 included
> graphic without any post-processing, and could also be viewed in-buffer with
> `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)
>>       - Here is an example Org LilyPond File]] exported as HTML
>>       - Resultant Score exported in pdf format
>>       - Generated Score export of individual Pages (png)
>> *** Modal Cycles (Utilises org-babel and noweb to generate notes)
>>       - Generated Score
>>       - Generated Midi File
>> *** Modal Cycles 2 (Utilises org-babel and noweb to generate notes)
>>       - Generated Score
>>       - Generated Midi File
>> *** Modes in the Key of C (another example of polyglot lilypond
>> programming)
>>       - Generated Score
>>       Generated MIDI File
>>
>> ** Features
>>  - Optional Automated LilyPond Compilation following the "Tangling"
>>   of a "Literate Org LilyPond" file
>>  - Optional Automated display of resultant Musical Score following
>> compilation
>>  - Optional Automated playing of the resultant MIDI file following
>> compilation
>>  - Highlights syntax errors in Org file following a failed compilation
>>  - Integrates with LilyPond-Mode
>>  - 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
>>
>>  (global-set-key [f8] 'ly-dev-tangle)
>>
>> #+end_src
>>
>> *** Commands
>>
>> Some commands are included to quickly disable certain post-tangle
>> activities...
>>  - 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 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
>>              (concat dotfiles-dir  "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
>>  'org-babel-load-languages
>>  '((ruby . t)
>>    (C . t)
>>    (emacs-lisp . t)
>>    (sh t)
>>    (dot t)
>>    (clojure t)
>>    (ditaa t)
>>    (lilypond t)
>>    ))
>>
>> #+END_SRC
>>
>> ** Requirements
>> *** Mac OS X
>>  - [[http://lilypond.org/][Lilypond]] can be obtained
>> [[http://lilypond.org/][here]]
>>
>> *** nix
>>  - Lilypond is available here or via the the package manager
>>  - For MIDI, [[http://timidity.sourceforge.net/][Timidity]] is available
>> [[http://timidity.sourceforge.net/][here]] or via the package manager
>>  - For PDF, [[http://live.gnome.org/Evince/Downloads][Evince]] is
>> available
>> [[http://live.gnome.org/Evince/Downloads][here]] or via package manager
>>
>> *** Win32
>>  - Currently untested
>>
>> ** Testing
>>
>> Tests are provided and can be run by opening
>> test/ob-lilypond-tests.org and running the following commands...
>>
>>  - M-x eval-buffer (within ob-lilypond-tests.org
>>  - 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
>>  - ly-project (code block - evaluate with C-c C-c and execute M-x
>> ly-project)
>>    - load appropriate files
>>    - set up windows
>>    - setup project development environment
>>    - add continuous testing post-save hook
>>    - map F4 to switch between src or test files to control file
>> (dev/ob-lilypond.org)
>>    - map F8 to 'ly-dev-tangle (tangle test/test-build/test.org file from
>> anywhere)
>>  - Remove post-save-hook code block
>>  - Development todo list
>>
>> <---
>>
>> Regards
>>
>> Martyn
>>
>>
>>
>
>
>

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: ob-lilypond
  2011-06-28  9:38   ` ob-lilypond Martyn Jago
  2011-06-28 10:07     ` ob-lilypond Bastien
@ 2011-06-28 13:38     ` Cameron Horsburgh
  2011-06-28 16:46       ` ob-lilypond Martyn Jago
  1 sibling, 1 reply; 30+ messages in thread
From: Cameron Horsburgh @ 2011-06-28 13:38 UTC (permalink / raw)
  To: Martyn Jago; +Cc: emacs-orgmode

This is very exciting. I use LilyPond a lot for various projects and I
think integration with orgmode is an obvious solution to a problem I
hope to find very soon!

LilyPond is largely written in Scheme and I'm pretty sure a few of the
devs use emacs. There are some interesting emacs/Lily projects around,
not least Nicolas Sceaux' lyqi-mode which does some pretty groovy
things, including midi keyboard input via rumor.

I'm looking forward to having a chance to play with this. Well done,
and thank you!


Cameron Horsburgh
blog: http://spiritcry.wordpress.com



On 28 June 2011 19:38, Martyn Jago <martyn.jago@btinternet.com> wrote:
>
> Hi Eric
>
>> Eric Schulte <schulte.eric <at> gmail.com> writes:
>>
>> Hi Martyn,
>>
>> This looks great, I look forward to testing it out, although my music
>> composition experience is limited to using Finale in a high-school music
>> theory class.
>>
>> It sounds like your plan is to keep this on github during the first
>> trial and debugging stages.  At some point I would love to include this
>> into the Org-mode core.
>>
>
> Thanks - I'm no LilyPond expert myself, and so a heads-up from a more
> proficient LilyPond user would be great. Likewise the ins and outs of
> LilyPond-mode. That said, it is working well for me and my use-case, and
> it is great to be generating music and score out of org-mode - it feels a
> good fit, which is testament to the flexability of org-babel and org-mode.
>
>> Part of me is tempted to push for immediate integration so that this is
>> released with Emacs24 (we could push bug fixes throughout the fall),
>> however this may be too much code for just before an Org-mode release.
>>
>> Thanks for sharing! -- Eric
>>
>
> I'll leave that decision to you, but certainly if the software is useful
> to others, I am happy to see it distributed. Actually, I only recently
> discovered how busy Lilypond development is, so there must be potential
> users out there. Perhaps I should bite the bullet and approach the Lilypond
> user mailing list to see if there is any interest there?
>
> Regards
>
> Martyn
>
>
>> Martyn Jago <martyn.jago <at> btinternet.com> writes:
> <...>
>>
>
>
>
>
>
>

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: ob-lilypond
  2011-06-28 13:38     ` ob-lilypond Cameron Horsburgh
@ 2011-06-28 16:46       ` Martyn Jago
  0 siblings, 0 replies; 30+ messages in thread
From: Martyn Jago @ 2011-06-28 16:46 UTC (permalink / raw)
  To: emacs-orgmode

Hi Cameron

> Cameron Horsburgh <cammoblammo <at> gmail.com> writes:
>
> This is very exciting. I use LilyPond a lot for various projects and I
> think integration with orgmode is an obvious solution to a problem I
> hope to find very soon!
> 
> LilyPond is largely written in Scheme and I'm pretty sure a few of the
> devs use emacs. There are some interesting emacs/Lily projects around,
> not least Nicolas Sceaux' lyqi-mode which does some pretty groovy
> things, including midi keyboard input via rumor.

I had come across lyqi-mode but haven't checked it out yet. Added to the TODO
list. Thanks for the feedback.

Regards

Martyn

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: ob-lilypond
  2011-06-28 12:11 ` ob-lilypond Christian Moe
  2011-06-28 13:18   ` ob-lilypond David O'Toole
@ 2011-06-28 17:06   ` Martyn Jago
  2011-06-28 18:51     ` ob-lilypond Christian Moe
                       ` (2 more replies)
  1 sibling, 3 replies; 30+ messages in thread
From: Martyn Jago @ 2011-06-28 17:06 UTC (permalink / raw)
  To: emacs-orgmode

Hi Cameron 

> Hi,
> 
> I'm thrilled that Lilypond has been added to Babel, grateful for the 
> extra thought given to Mac users -- and completely bowled over by your 
> demos!
> 
> 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 TODO in your task list...

Thanks for the encouraging comments!

Status changed from SOMEDAY to TODO. 

> 
> But much better, IMO, would be a way to `evaluate' a single Lilypond 
> block 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 included graphic without any post-processing, and could also be 
> viewed in-buffer with `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
> 

This is very doable since it is the first thing I tried on initial
experimentation. I think I had some difficulty cropping the snippet (png)
in that the result had no padding at all, but I'm guessing that can be
overcome. 
Certainly with the use cases you suggest, the defaults would need to
change, and C-c C-c would need to act as you describe, but that wouldn't
be an issue if we can define seperate 'modes' for the different ways of
working (I think for now the 'modes' can be considered  mutually exclusive).

Regards

Martyn

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: ob-lilypond
  2011-06-28 17:06   ` ob-lilypond Martyn Jago
@ 2011-06-28 18:51     ` Christian Moe
  2011-06-28 19:00     ` ob-lilypond Michael Brand
  2011-06-28 20:00     ` ob-lilypond Christian Moe
  2 siblings, 0 replies; 30+ messages in thread
From: Christian Moe @ 2011-06-28 18:51 UTC (permalink / raw)
  To: Martyn Jago; +Cc: emacs-orgmode

On 6/28/11 7:06 PM, Martyn Jago wrote:

> Status changed from SOMEDAY to TODO.

Great, I'll be looking out for it.

Yours,
Christian

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: ob-lilypond
  2011-06-28 17:06   ` ob-lilypond Martyn Jago
  2011-06-28 18:51     ` ob-lilypond Christian Moe
@ 2011-06-28 19:00     ` Michael Brand
  2011-06-28 20:00     ` ob-lilypond Christian Moe
  2 siblings, 0 replies; 30+ messages in thread
From: Michael Brand @ 2011-06-28 19:00 UTC (permalink / raw)
  To: Martyn Jago; +Cc: emacs-orgmode

Hi Martyn

Thank you very much for sharing your work.

On Tue, Jun 28, 2011 at 19:06, Martyn Jago <martyn.jago@btinternet.com> wrote:
>> But much better, IMO, would be a way to `evaluate' a single Lilypond
>> block 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 included graphic without any post-processing, and could also be
>> viewed in-buffer with `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
>
> This is very doable since it is the first thing I tried on initial
> experimentation. I think I had some difficulty cropping the snippet (png)
> in that the result had no padding at all, but I'm guessing that can be
> overcome.
> Certainly with the use cases you suggest, the defaults would need to
> change, and C-c C-c would need to act as you describe, but that wouldn't
> be an issue if we can define seperate 'modes' for the different ways of
> working (I think for now the 'modes' can be considered  mutually exclusive).

For me it would be great to have Lilypond snippets that can be
evaluated into a linked score image file visible inline the Org
buffer, permanently in #+results: or temporarily as an overlay
(similar to org-preview-latex-fragment).

Michael

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: ob-lilypond
  2011-06-28 17:06   ` ob-lilypond Martyn Jago
  2011-06-28 18:51     ` ob-lilypond Christian Moe
  2011-06-28 19:00     ` ob-lilypond Michael Brand
@ 2011-06-28 20:00     ` Christian Moe
  2011-06-28 21:19       ` ob-lilypond Martyn Jago
  2 siblings, 1 reply; 30+ messages in thread
From: Christian Moe @ 2011-06-28 20:00 UTC (permalink / raw)
  To: Martyn Jago; +Cc: emacs-orgmode



> This is very doable since it is the first thing I tried on initial
> experimentation. I think I had some difficulty cropping the snippet (png)
> in that the result had no padding at all, but I'm guessing that can be
> overcome.

I guess most of us who would be interested in this would have 
ImageMagick *convert* at hand, if it's difficult to get Lilypond or 
lilypond-book to do it directly.

> Certainly with the use cases you suggest, the defaults would need to
> change, and C-c C-c would need to act as you describe, but that wouldn't
> be an issue if we can define seperate 'modes' for the different ways of
> working (I think for now the 'modes' can be considered  mutually exclusive).

I'd tentatively suggest things should be done in a way that is roughly 
analogous with how other Babel languages work, not in the way that 
makes one or another use case super-easy to do. For our different use 
cases we might then each have to tweak some :tangle, :exports, 
:results or :file header arguments.

But using Org-Babel's provisions for system-wide, language-specific 
and buffer-wide heading arguments, the user should be able to define 
her own `modes' by changing a few settings, and avoid littering a 
complex document with those header arguments.

Maybe. Haven't thought this very far through...

Yours,
Christian

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: ob-lilypond
  2011-06-28 10:21       ` ob-lilypond Bastien
@ 2011-06-28 20:45         ` Eric Schulte
  2011-06-28 23:07           ` ob-lilypond Bastien
  2011-06-29 17:07           ` ob-lilypond Martyn Jago
  0 siblings, 2 replies; 30+ messages in thread
From: Eric Schulte @ 2011-06-28 20:45 UTC (permalink / raw)
  To: Bastien; +Cc: Martyn Jago, emacs-orgmode

Bastien <bzg@altern.org> writes:

> Bastien <bzg@altern.org> writes:
>
>> Indeed -- Lilypond is an old GNU project, I guess there are many Emacs
>> gnusers.  I would love to include ob-lilypond.el in the next release, it
>> adds a nice functionality and cannot break anything.
>
> I forgot to mention that I leave this decision to Eric, of course.

Great,

I have a commit ready to push to add lilypond support to Org-mode, first
I just have two questions.

1. I see Shelagh Manton mentioned as an author, would it be possible for
   Shelagh to complete the FSF copyright assignment forms?  Otherwise I
   don't believe we can add ob-lilypond to the Org-mode core, although
   we could still place it in the contrib directory with ob-oz.

2. I see you have a test suite which is fantastic.  Additionally this
   test suite uses ert, which is what the main Org-mode test suite uses.
   Would it be possible to fold this test suite into Org-mode's test
   suite in the testing directory?
   
   If these tests require a lilypond executable we may have to partition
   them off from the main Org-mode test suite so that they can be run
   independently of each other.

I'm happy to continue to push in updates to the Org-mode core as
ob-lilypond development continues.

Thanks to Martyn for this exciting addition! -- Eric

-- 
Eric Schulte
http://cs.unm.edu/~eschulte/

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: ob-lilypond
  2011-06-28 20:00     ` ob-lilypond Christian Moe
@ 2011-06-28 21:19       ` Martyn Jago
  0 siblings, 0 replies; 30+ messages in thread
From: Martyn Jago @ 2011-06-28 21:19 UTC (permalink / raw)
  To: emacs-orgmode

Hi 

> I guess most of us who would be interested in this would have 
> ImageMagick *convert* at hand, if it's difficult to get Lilypond or 
> lilypond-book to do it directly.
> 

I tentatively disagree. 

Arrangement mode needs to work for me with the minimal of fuss.

Annotation mode similarly for you.

That aside you can configure locally all you wish.

Thus is the beauty of org-babel's configuration.

Regards 

Martyn

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: ob-lilypond
  2011-06-28 20:45         ` ob-lilypond Eric Schulte
@ 2011-06-28 23:07           ` Bastien
  2011-06-29  0:41             ` ob-lilypond Eric Schulte
  2011-06-29 17:07           ` ob-lilypond Martyn Jago
  1 sibling, 1 reply; 30+ messages in thread
From: Bastien @ 2011-06-28 23:07 UTC (permalink / raw)
  To: Eric Schulte; +Cc: Martyn Jago, emacs-orgmode

Hi Eric,

Eric Schulte <schulte.eric@gmail.com> writes:

> 1. I see Shelagh Manton mentioned as an author, would it be possible for
>    Shelagh to complete the FSF copyright assignment forms?  Otherwise I
>    don't believe we can add ob-lilypond to the Org-mode core, although
>    we could still place it in the contrib directory with ob-oz.

There is little chance to get the assignement before the release of 7.6,
so yes, let's take that route (contrib/) for now.

-- 
 Bastien

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: ob-lilypond
  2011-06-28 23:07           ` ob-lilypond Bastien
@ 2011-06-29  0:41             ` Eric Schulte
  0 siblings, 0 replies; 30+ messages in thread
From: Eric Schulte @ 2011-06-29  0:41 UTC (permalink / raw)
  To: Bastien; +Cc: Martyn Jago, emacs-orgmode

Bastien <bzg@altern.org> writes:

> Hi Eric,
>
> Eric Schulte <schulte.eric@gmail.com> writes:
>
>> 1. I see Shelagh Manton mentioned as an author, would it be possible for
>>    Shelagh to complete the FSF copyright assignment forms?  Otherwise I
>>    don't believe we can add ob-lilypond to the Org-mode core, although
>>    we could still place it in the contrib directory with ob-oz.
>
> There is little chance to get the assignement before the release of 7.6,
> so yes, let's take that route (contrib/) for now.

This is now located in contrib/babel/langs.

Best -- Eric

-- 
Eric Schulte
http://cs.unm.edu/~eschulte/

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: ob-lilypond
  2011-06-28 20:45         ` ob-lilypond Eric Schulte
  2011-06-28 23:07           ` ob-lilypond Bastien
@ 2011-06-29 17:07           ` Martyn Jago
  2011-06-29 21:15             ` ob-lilypond Eric Schulte
  1 sibling, 1 reply; 30+ messages in thread
From: Martyn Jago @ 2011-06-29 17:07 UTC (permalink / raw)
  To: emacs-orgmode

Hi 

> I have a commit ready to push to add lilypond support to Org-mode, first
> I just have two questions.
> 
> 1. I see Shelagh Manton mentioned as an author, would it be possible for
>    Shelagh to complete the FSF copyright assignment forms?  Otherwise I
>    don't believe we can add ob-lilypond to the Org-mode core, although
>    we could still place it in the contrib directory with ob-oz.

Initially this project was intended to be a joint project between Shelagh and 
myself, but short of the initial commit, Shelagh hasn't been involved 
(unfortunately, since she will certainly know LilyPond better than I do - I 
believe she is very busy). The initial commit was broken and wasn't used. 
I'll try to contact her, but haven't an email address, so must use Github.


> 2. I see you have a test suite which is fantastic.  Additionally this
>    test suite uses ert, which is what the main Org-mode test suite uses.
>    Would it be possible to fold this test suite into Org-mode's test
>    suite in the testing directory?

My test suite can live anywhere - it requires altering relative paths. Currently 
my test suite requires the test-build directory and contained files.

>    If these tests require a lilypond executable we may have to partition
>    them off from the main Org-mode test suite so that they can be run
>    independently of each other.

They don't.
 
Regards

Martyn

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: ob-lilypond
  2011-06-29 17:07           ` ob-lilypond Martyn Jago
@ 2011-06-29 21:15             ` Eric Schulte
  2011-06-30  6:38               ` ob-lilypond Martyn Jago
  0 siblings, 1 reply; 30+ messages in thread
From: Eric Schulte @ 2011-06-29 21:15 UTC (permalink / raw)
  To: Martyn Jago; +Cc: emacs-orgmode

Martyn Jago <martyn.jago@btinternet.com> writes:

> Hi 
>
>> I have a commit ready to push to add lilypond support to Org-mode, first
>> I just have two questions.
>> 
>> 1. I see Shelagh Manton mentioned as an author, would it be possible for
>>    Shelagh to complete the FSF copyright assignment forms?  Otherwise I
>>    don't believe we can add ob-lilypond to the Org-mode core, although
>>    we could still place it in the contrib directory with ob-oz.
>
> Initially this project was intended to be a joint project between Shelagh and 
> myself, but short of the initial commit, Shelagh hasn't been involved 
> (unfortunately, since she will certainly know LilyPond better than I do - I 
> believe she is very busy). The initial commit was broken and wasn't used. 
> I'll try to contact her, but haven't an email address, so must use Github.
>

If Shelagh hasn't actually authored any of ob-lilypond.el (or at least
hasn't authored more than 10 lines of) then we could simply remove her
name from the authors list and include it into the Org-mode core.  This
however may not be the best long-term solution if you anticipate her
increased participation later-on in the project.  Please let me know
(soon) if you would like me to make this change.

>
>
>> 2. I see you have a test suite which is fantastic.  Additionally this
>>    test suite uses ert, which is what the main Org-mode test suite uses.
>>    Would it be possible to fold this test suite into Org-mode's test
>>    suite in the testing directory?
>
> My test suite can live anywhere - it requires altering relative paths. Currently 
> my test suite requires the test-build directory and contained files.
>

Alright, I think we can wait for this integration, but please don't
delete your github repo in the mean time as I would like to fold this
test suite in at some point.

Ultimately this points to the more general issue of how to include Babel
language-specific tests into the Org-mode test suite s.t. they can be
executed independently of the core of the test suite.

Thanks -- Eric

>
>>    If these tests require a lilypond executable we may have to partition
>>    them off from the main Org-mode test suite so that they can be run
>>    independently of each other.
>
> They don't.
>  
> Regards
>
> Martyn
>
>
>

-- 
Eric Schulte
http://cs.unm.edu/~eschulte/

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: ob-lilypond
  2011-06-29 21:15             ` ob-lilypond Eric Schulte
@ 2011-06-30  6:38               ` Martyn Jago
  2011-06-30 18:10                 ` ob-lilypond Eric Schulte
  0 siblings, 1 reply; 30+ messages in thread
From: Martyn Jago @ 2011-06-30  6:38 UTC (permalink / raw)
  To: emacs-orgmode

Hi

> 
> If Shelagh hasn't actually authored any of ob-lilypond.el (or at least      
> hasn't authored more than 10 lines of) then we could simply remove her
> name from the authors list and include it into the Org-mode core.  This
> however may not be the best long-term solution if you anticipate her
> increased participation later-on in the project.  Please let me know
> (soon) if you would like me to make this change.
> 

I've modified the author status in my repository.

> Ultimately this points to the more general issue of how to include Babel
> language-specific tests into the Org-mode test suite s.t. they can be
> executed independently of the core of the test suite.
> 
> Thanks -- Eric
> 

My unit-tests don't currently require the Lilypond to be initialised "as a babel
language" nor a Lilypond executable AFAICT, so currently they possibly don't
need to be run "independently". I'll investigate this further. 

> >

One distinction that has occurred to me (especially following comments on 
the mailing list) is that of "babel language" and "babel language work-flow".
In other words, I can visualise refactoring ob-lilypond to be no more than
a specification of the Lilypond syntax, and working in parallel, on a 
work-flow implementation for Lilypond that is "opinionated" in terms of 
adjusting org-babel settings away from their defaults / removing work-flow 
noise etc. ( org-lilypond.el ) ? Would this make sense, and if so where would 
it live (aligned to org-babel / a native Emacs mode perhaps)? 
I hope that makes sense.

Regards

Martyn

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: ob-lilypond
  2011-06-30  6:38               ` ob-lilypond Martyn Jago
@ 2011-06-30 18:10                 ` Eric Schulte
  2011-07-01 12:01                   ` ob-lilypond Christian Moe
  2011-07-01 13:43                   ` ob-lilypond Martyn Jago
  0 siblings, 2 replies; 30+ messages in thread
From: Eric Schulte @ 2011-06-30 18:10 UTC (permalink / raw)
  To: Martyn Jago; +Cc: emacs-orgmode

Martyn Jago <martyn.jago@btinternet.com> writes:

> Hi
>
>> 
>> If Shelagh hasn't actually authored any of ob-lilypond.el (or at least      
>> hasn't authored more than 10 lines of) then we could simply remove her
>> name from the authors list and include it into the Org-mode core.  This
>> however may not be the best long-term solution if you anticipate her
>> increased participation later-on in the project.  Please let me know
>> (soon) if you would like me to make this change.
>> 
>
> I've modified the author status in my repository.
>

Great, I've just moved this into the Org-mode core and added it to the
list of Babel languages.

>
>> Ultimately this points to the more general issue of how to include Babel
>> language-specific tests into the Org-mode test suite s.t. they can be
>> executed independently of the core of the test suite.
>> 
>> Thanks -- Eric
>> 
>
> My unit-tests don't currently require the Lilypond to be initialised "as a babel
> language" nor a Lilypond executable AFAICT, so currently they possibly don't
> need to be run "independently". I'll investigate this further. 
>

That's good to hear.  Are you up for trying to merge them into the rest
of the Org-mode test suite?  This should be as simple as placing any
org-mode example files you have in

org-mode/testing/examples/

placing the .el file defining your tests into

org-mode/testing/lisp/

and renaming all of your tests so that they start with the prefix
"ob-lilypond/"

I fully understand if you don't have the time to do this, and I should
be able to take a shot at it some time in the not-too-distant future.

>
> One distinction that has occurred to me (especially following comments on 
> the mailing list) is that of "babel language" and "babel language work-flow".
> In other words, I can visualise refactoring ob-lilypond to be no more than
> a specification of the Lilypond syntax, and working in parallel, on a 
> work-flow implementation for Lilypond that is "opinionated" in terms of 
> adjusting org-babel settings away from their defaults / removing work-flow 
> noise etc. ( org-lilypond.el ) ? Would this make sense, and if so where would 
> it live (aligned to org-babel / a native Emacs mode perhaps)? 
> I hope that makes sense.
>

That sounds like a good idea.  Ideally ob-lilypond should include just
those elements expected by the code block interface, namely functions
for session/external evaluation, for expanding variables in code block
bodies, and for returning results to Org-mode.  I think that it would be
a good idea to develop an external org-lilypond to support a more
comprehensive workflow.

Thanks -- Eric

>
> Regards
>
> Martyn
>
>
>
>
>
>

-- 
Eric Schulte
http://cs.unm.edu/~eschulte/

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: ob-lilypond
  2011-06-30 18:10                 ` ob-lilypond Eric Schulte
@ 2011-07-01 12:01                   ` Christian Moe
  2011-07-01 13:43                   ` ob-lilypond Martyn Jago
  1 sibling, 0 replies; 30+ messages in thread
From: Christian Moe @ 2011-07-01 12:01 UTC (permalink / raw)
  To: Eric Schulte; +Cc: Martyn Jago, emacs-orgmode

On 6/30/11 8:10 PM, Eric Schulte wrote:
> Martyn Jago<martyn.jago@btinternet.com>  writes:
>> (...)
> Great, I've just moved this into the Org-mode core and added it to the
> list of Babel languages.

Great!

>>
>> One distinction that has occurred to me (especially following comments on
>> the mailing list) is that of "babel language" and "babel language work-flow".
>> In other words, I can visualise refactoring ob-lilypond to be no more than
>> a specification of the Lilypond syntax, and working in parallel, on a
>> work-flow implementation for Lilypond that is "opinionated" in terms of
>> adjusting org-babel settings away from their defaults / removing work-flow
>> noise etc. ( org-lilypond.el ) ? Would this make sense, and if so where would
>> it live (aligned to org-babel / a native Emacs mode perhaps)?
>> I hope that makes sense.
>>
>
> That sounds like a good idea.  Ideally ob-lilypond should include just
> those elements expected by the code block interface, namely functions
> for session/external evaluation, for expanding variables in code block
> bodies, and for returning results to Org-mode.  I think that it would be
> a good idea to develop an external org-lilypond to support a more
> comprehensive workflow.

I like this.

I certainly see that the already complex task of making arrangements 
like those in Martyn's examples should be made as easy as possible.

As for the comparatively simple use cases I brought up, once they're 
supported by ob-lilypond I'd be perfectly happy to throw header 
arguments at them.

Yours,
Christian

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: ob-lilypond
  2011-06-30 18:10                 ` ob-lilypond Eric Schulte
  2011-07-01 12:01                   ` ob-lilypond Christian Moe
@ 2011-07-01 13:43                   ` Martyn Jago
  2011-07-01 19:27                     ` ob-lilypond Eric Schulte
  1 sibling, 1 reply; 30+ messages in thread
From: Martyn Jago @ 2011-07-01 13:43 UTC (permalink / raw)
  To: Eric Schulte; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 580 bytes --]

Hi

> 
> That's good to hear.  Are you up for trying to merge them into the rest
> of the Org-mode test suite?  This should be as simple as placing any
> org-mode example files you have in
> 
> org-mode/testing/examples/
> 
> placing the .el file defining your tests into
> 
> org-mode/testing/lisp/
> 
> and renaming all of your tests so that they start with the prefix
> "ob-lilypond/"
> 
> I fully understand if you don't have the time to do this, and I should
> be able to take a shot at it some time in the not-too-distant future.

Hopefully this patch will work for you...


[-- Attachment #2: port-test-ob-lilypond.patch --]
[-- Type: application/octet-stream, Size: 16197 bytes --]

diff --git a/lisp/ob-lilypond.el b/lisp/ob-lilypond.el
index 031eb8f..39aa78c 100644
--- a/lisp/ob-lilypond.el
+++ b/lisp/ob-lilypond.el
@@ -242,14 +242,15 @@ LINE is the erroneous line"
 FILE-NAME is full path to lilypond file.
 LINENO is the number of the erroneous line"
  
-  (set-buffer (get-buffer-create "temp-buf"))
-  (insert-file-contents (ly-switch-extension file-name ".ly")
-                        nil nil nil t)
-  (if (> lineNo 0)
-      (progn
-        (goto-line lineNo)
-        (buffer-substring (point) (point-at-eol)))
-    nil))
+  (with-temp-buffer
+    (insert-file-contents (ly-switch-extension file-name ".ly")
+			  nil nil nil t)
+    (if (> lineNo 0)
+	(progn
+	  (goto-char (point-min))
+	  (forward-line (- lineNo 1))
+	  (buffer-substring (point) (point-at-eol)))
+      nil)))
     
 (defun ly-attempt-to-open-pdf (file-name &optional test)
   "Attempt to display the generated pdf file
diff --git a/testing/examples/ob-lilypond-broken.ly b/testing/examples/ob-lilypond-broken.ly
new file mode 100644
index 0000000..e836f6d
--- /dev/null
+++ b/testing/examples/ob-lilypond-broken.ly
@@ -0,0 +1,31 @@
+line 1 
+line 2 
+line 3 
+line 4 
+line 5 
+line 6 
+line 7 
+line 8 
+line 9 
+line 10
+line 11
+line 12
+line 13
+line 14
+line 15
+line 16
+line 17
+line 18
+line 19
+line 20
+line 21
+line 22
+line 23
+line 24
+line 25
+line 26
+line 27
+line 28
+line 29
+line 30
+
diff --git a/testing/examples/ob-lilypond-broken.org b/testing/examples/ob-lilypond-broken.org
new file mode 100644
index 0000000..557418b
--- /dev/null
+++ b/testing/examples/ob-lilypond-broken.org
@@ -0,0 +1,39 @@
+* Faulty lilypond org file for test purposes (do not adjust)
+line 2
+line 3
+line 4
+line 5
+line 6
+line 7
+line 8
+line 9
+line 10
+line 11
+line 12
+line 13
+line 14
+line 15
+line 16
+line 17
+line 18
+line 19
+line 20
+line 21
+line 22
+line 23
+line 24
+line 25
+line 26
+line 27
+line 28
+line 29
+line 30
+line 31
+line 32
+line 33
+line 34
+line 35
+line 36
+line 37
+line 38
+line 39
diff --git a/testing/examples/ob-lilypond-test.error b/testing/examples/ob-lilypond-test.error
new file mode 100644
index 0000000..ceae291
--- /dev/null
+++ b/testing/examples/ob-lilypond-test.error
@@ -0,0 +1,15 @@
+Processing `xxx'
+Parsing...
+/path/to/tangled/file/test.ly:25:0: error: syntax error, unexpected \score, expecting '='
+
+\score {
+Interpreting music... [8][16][24][32]
+Preprocessing graphical objects...
+Interpreting music... 
+MIDI output to `xxx'
+Finding the ideal number of pages...
+Fitting music on 2 or 3 pages...
+Drawing systems...
+Layout output to `xxx'
+Converting to `xxx'...
+error: failed files: "/Path/to/tangled/file/test.ly/example.ly"
diff --git a/testing/examples/ob-lilypond-test.ly b/testing/examples/ob-lilypond-test.ly
new file mode 100644
index 0000000..745600d
--- /dev/null
+++ b/testing/examples/ob-lilypond-test.ly
@@ -0,0 +1,30 @@
+
+% [[file:~/.emacs.d/martyn/martyn/ob-lilypond/test/test-build/test.org::*LilyPond%2520Version][LilyPond-Version:1]]
+
+\version "2.12.3"
+
+% LilyPond-Version:1 ends here
+
+% [[file:~/.emacs.d/martyn/martyn/ob-lilypond/test/test-build/test.org::*lilypond%2520block%2520for%2520test%2520purposes][lilypond-block-for-test-purposes:1]]
+
+\score {
+  \relative c' {
+    c8 d e f g a b c |
+    b a g f e d c4   |
+  }
+
+% lilypond-block-for-test-purposes:1 ends here
+
+% [[file:~/.emacs.d/martyn/martyn/ob-lilypond/test/test-build/test.org::*lilypond%2520block%2520for%2520test%2520purposes][lilypond-block-for-test-purposes:2]]
+
+\layout {
+  }
+  \midi {
+    \context {
+      \Score
+      tempoWholesPerMinute = #(ly:make-moment 150 4)
+    }
+  }
+}
+
+% lilypond-block-for-test-purposes:2 ends here
diff --git a/testing/examples/ob-lilypond-test.org b/testing/examples/ob-lilypond-test.org
new file mode 100644
index 0000000..cd8587a
--- /dev/null
+++ b/testing/examples/ob-lilypond-test.org
@@ -0,0 +1,37 @@
+* Test org lilypond file
+
+This is a simple file for test purposes
+
+** LilyPond Version
+
+#+begin_src lilypond
+  
+\version "2.12.3"
+
+#+end_src 
+
+** DONE lilypond block for test purposes
+
+#+begin_src lilypond
+  
+  \score {
+    \relative c' {
+      c8 d e f g a b c |
+      b a g f e d c4   |
+    }
+   
+#+end_src
+
+#+begin_src lilypond
+  
+    \layout {
+      }
+      \midi {
+        \context {
+          \Score
+          tempoWholesPerMinute = #(ly:make-moment 150 4)
+        }
+      }
+    }
+  
+#+end_src
diff --git a/testing/lisp/test-ob-lilypond.el b/testing/lisp/test-ob-lilypond.el
new file mode 100644
index 0000000..16d6f09
--- /dev/null
+++ b/testing/lisp/test-ob-lilypond.el
@@ -0,0 +1,323 @@
+(save-excursion
+  (set-buffer (get-buffer-create "test-ob-lilypond.el"))
+  (setq ly-here
+        (file-name-directory
+         (buffer-file-name
+          (current-buffer)))))
+ 
+(ert-deftest ob-lilypond/assert ()
+  (should t))
+ 
+(ert-deftest ob-lilypond/feature-provision ()
+  (should (featurep 'ob-lilypond)))
+  
+(ert-deftest ob-lilypond/check-lilypond-alias ()
+  (should (fboundp 'lilypond-mode)))
+
+(ert-deftest ob-lilypond/org-babel-tangle-lang-exts ()
+  (let ((found nil)
+        (list org-babel-tangle-lang-exts))
+    (while list
+      (when (equal (car list) '("LilyPond" . "ly"))
+        (setq found t))
+      (setq list (cdr list)))
+    (should found)))
+     
+(ert-deftest ob-lilypond/org-babel-prep-session:lilypond ()
+  (should-error (org-babel-prep-session:lilypond nil nil))
+  :type 'error)
+
+(ert-deftest ob-lilypond/ly-version-const () 
+  (should (boundp 'ly-version)))
+
+(ert-deftest ob-lilypond/ly-version-command ()
+  (should (equal "ob-lilypond version 0.2" (ly-version)))
+  (with-temp-buffer
+    (ly-version t)
+    (should (equal "ob-lilypond version 0.2"
+                   (buffer-substring (point-min) (point-max))))))
+
+(ert-deftest ob-lilypond/ly-compile-lilyfile ()
+  (should (equal
+           `(,(ly-determine-ly-path)    ;program
+             nil                        ;infile
+             "*lilypond*"               ;buffer
+             t                          ;display
+             ,(if ly-gen-png  "--png"  "") ;&rest...
+             ,(if ly-gen-html "--html" "")   
+             ,(if ly-use-eps  "-dbackend=eps" "")
+             ,(if ly-gen-svg  "-dbackend=svg" "")
+             "--output=test-file"
+             "test-file.ly")
+           (ly-compile-lilyfile "test-file.ly" t))))
+
+(ert-deftest ob-lilypond/ly-compile-post-tangle ()
+  (should (boundp 'ly-compile-post-tangle)))
+
+(ert-deftest ob-lilypond/ly-display-pdf-post-tangle ()
+  (should (boundp 'ly-display-pdf-post-tangle)))
+
+(ert-deftest ob-lilypond/ly-play-midi-post-tangle ()
+  (should (boundp 'ly-play-midi-post-tangle)))
+
+(ert-deftest ob-lilypond/ly-OSX-ly-path ()
+  (should (boundp 'ly-OSX-ly-path))
+  (should (stringp ly-OSX-ly-path)))
+
+(ert-deftest ob-lilypond/ly-OSX-pdf-path ()
+  (should (boundp 'ly-OSX-pdf-path))
+  (should (stringp ly-OSX-pdf-path)))
+
+(ert-deftest ob-lilypond/ly-OSX-midi-path ()
+  (should (boundp 'ly-OSX-midi-path))
+  (should (stringp ly-OSX-midi-path)))
+
+(ert-deftest ob-lilypond/ly-nix-ly-path ()
+  (should (boundp 'ly-nix-ly-path))
+  (should (stringp ly-nix-ly-path)))
+
+(ert-deftest ob-lilypond/ly-nix-pdf-path ()
+  (should (boundp 'ly-nix-pdf-path))
+  (should (stringp ly-nix-pdf-path)))
+
+(ert-deftest ob-lilypond/ly-nix-midi-path ()
+  (should (boundp 'ly-nix-midi-path))
+  (should (stringp ly-nix-midi-path)))
+
+(ert-deftest ob-lilypond/ly-win32-ly-path ()
+  (should (boundp 'ly-win32-ly-path))
+  (should (stringp ly-win32-ly-path)))
+
+(ert-deftest ob-lilypond/ly-win32-pdf-path ()
+  (should (boundp 'ly-win32-pdf-path))
+  (should (stringp ly-win32-pdf-path)))
+
+(ert-deftest ob-lilypond/ly-win32-midi-path ()
+  (should (boundp 'ly-win32-midi-path))
+  (should (stringp ly-win32-midi-path)))
+
+(ert-deftest ob-lilypond/ly-gen-png ()
+  (should (boundp 'ly-gen-png)))
+
+(ert-deftest ob-lilypond/ly-gen-svg ()
+  (should (boundp 'ly-gen-svg)))
+
+(ert-deftest ob-lilypond/ly-gen-html ()
+  (should (boundp 'ly-gen-html)))
+
+(ert-deftest ob-lilypond/use-eps ()
+  (should (boundp 'ly-use-eps)))
+
+(ert-deftest ob-lilypond/org-babel-default-header-args:lilypond ()
+  (should (equal  '((:tangle . "yes")
+                    (:noweb . "yes")
+                    (:results . "silent")
+                    (:comments . "yes"))
+                  org-babel-default-header-args:lilypond)))
+
+;;TODO finish...
+(ert-deftest ob-lilypond/org-babel-expand-body:lilypond ()
+  (should (equal "This is a test"
+                 (org-babel-expand-body:lilypond "This is a test" ()))))
+
+;;TODO (ert-deftest ly-test-org-babel-execute:lilypond ())
+(ert-deftest ob-lilypond/ly-check-for-compile-error ()
+  (set-buffer (get-buffer-create "*lilypond*"))
+  (erase-buffer)
+  (should (not (ly-check-for-compile-error nil t)))
+  (insert-file-contents (concat ly-here
+                                "../examples/ob-lilypond-test.error")
+                        nil nil nil t)
+  (goto-char (point-min))
+  (should (ly-check-for-compile-error nil t))
+  (kill-buffer "*lilypond*"))
+
+(ert-deftest ob-lilypond/ly-process-compile-error ()
+  (find-file-other-window (concat
+                           ly-here
+                           "../examples/ob-lilypond-broken.org"))
+  (set-buffer (get-buffer-create "*lilypond*"))
+  (insert-file-contents (concat
+                         ly-here
+                         "../examples/ob-lilypond-test.error")
+                        nil nil nil t)
+  (goto-char (point-min))
+  (search-forward "error:" nil t)
+  (should-error
+   (ly-process-compile-error (concat
+                              ly-here
+                              "../examples/ob-lilypond-broken.ly"))
+   :type 'error)
+  (set-buffer "ob-lilypond-broken.org")
+  (should (equal 238 (point)))
+  (exchange-point-and-mark)
+  (should (equal (+ 238 (length "line 25")) (point)))
+  (kill-buffer "*lilypond*")
+  (kill-buffer "ob-lilypond-broken.org"))
+   
+(ert-deftest ob-lilypond/ly-mark-error-line ()
+  (let ((file-name (concat
+                    ly-here
+                    "../examples/ob-lilypond-broken.org"))
+        (expected-point-min 198)
+        (expected-point-max 205)
+        (line "line 20"))
+    (find-file-other-window file-name)
+    (ly-mark-error-line file-name line)
+    (should (equal expected-point-min (point)))
+  
+    (exchange-point-and-mark)
+    (should (= expected-point-max (point)))
+    (kill-buffer (file-name-nondirectory file-name))))
+
+(ert-deftest ob-lilypond/ly-parse-line-num ()
+  (with-temp-buffer
+    (insert-file-contents (concat
+                           ly-here
+                           "../examples/ob-lilypond-test.error")
+                          nil nil nil t)
+    (goto-char (point-min))
+    (search-forward "error:")
+    (should (equal 25 (ly-parse-line-num (current-buffer))))))
+  
+(ert-deftest ob-lilypond/ly-parse-error-line ()
+  (let ((ly-file (concat
+                  ly-here
+                  "../examples/ob-lilypond-broken.ly")))
+    (should (equal "line 20"
+                   (ly-parse-error-line ly-file 20)))
+    (should (not (ly-parse-error-line ly-file 0)))))
+    
+(ert-deftest ob-lilypond/ly-attempt-to-open-pdf ()
+  (let ((post-tangle ly-display-pdf-post-tangle)
+        (ly-file (concat
+                  ly-here
+                  "../examples/ob-lilypond-test.ly"))
+        (pdf-file (concat
+                   ly-here
+                   "../examples/ob-lilypond-test.pdf")))
+    (setq ly-open-pdf-post-tangle t)
+    (when (not (file-exists-p pdf-file))
+      (set-buffer (get-buffer-create (file-name-nondirectory pdf-file)))
+      (write-file pdf-file))
+    (should (equal 
+             (concat
+              (ly-determine-pdf-path) " " pdf-file)
+             (ly-attempt-to-open-pdf ly-file t)))
+    (delete-file pdf-file)
+    (kill-buffer (file-name-nondirectory pdf-file))
+    (should (equal
+             "No pdf file generated so can't display!"
+             (ly-attempt-to-open-pdf pdf-file)))
+    (setq ly-display-pdf-post-tangle post-tangle)))
+
+(ert-deftest ob-lilypond/ly-attempt-to-play-midi ()
+  (let ((post-tangle ly-play-midi-post-tangle)
+        (ly-file (concat
+                  ly-here
+                  "../examples/ob-lilypond-test.ly"))
+        (midi-file (concat
+                    ly-here
+                    "../examples/ob-lilypond-test.midi")))
+    (setq ly-play-midi-post-tangle t)
+    (when (not (file-exists-p midi-file))
+      (set-buffer (get-buffer-create (file-name-nondirectory midi-file)))
+      (write-file midi-file))
+    (should (equal
+             (concat
+              (ly-determine-midi-path) " " midi-file)
+             (ly-attempt-to-play-midi ly-file t)))
+    (delete-file midi-file)
+    (kill-buffer (file-name-nondirectory midi-file))
+    (should (equal
+             "No midi file generated so can't play!"
+             (ly-attempt-to-play-midi midi-file)))
+    (setq ly-play-midi-post-tangle post-tangle)))
+
+(ert-deftest ob-lilypond/ly-determine-ly-path ()
+  (should (equal ly-OSX-ly-path
+                 (ly-determine-ly-path "darwin")))
+  (should (equal ly-win32-ly-path
+                 (ly-determine-ly-path "win32")))
+  (should (equal ly-nix-ly-path
+                 (ly-determine-ly-path "nix"))))
+
+(ert-deftest ob-lilypond/ly-determine-pdf-path ()
+  (should (equal ly-OSX-pdf-path
+                 (ly-determine-pdf-path "darwin")))
+  (should (equal ly-win32-pdf-path
+                 (ly-determine-pdf-path "win32")))
+  (should (equal ly-nix-pdf-path
+                 (ly-determine-pdf-path "nix"))))
+
+(ert-deftest ob-lilypond/ly-determine-midi-path ()
+  (should (equal ly-OSX-midi-path
+                 (ly-determine-midi-path "darwin")))
+  (should (equal ly-win32-midi-path
+                 (ly-determine-midi-path "win32")))
+  (should (equal ly-nix-midi-path
+                 (ly-determine-midi-path "nix"))))
+ 
+(ert-deftest ob-lilypond/ly-toggle-midi-play-toggles-flag ()
+  (if ly-play-midi-post-tangle
+      (progn
+        (ly-toggle-midi-play)
+         (should (not ly-play-midi-post-tangle))
+        (ly-toggle-midi-play)
+        (should ly-play-midi-post-tangle))
+    (ly-toggle-midi-play)
+    (should ly-play-midi-post-tangle)
+    (ly-toggle-midi-play)
+    (should (not ly-play-midi-post-tangle))))
+
+(ert-deftest ob-lilypond/ly-toggle-pdf-display-toggles-flag ()
+  (if ly-display-pdf-post-tangle
+      (progn
+        (ly-toggle-pdf-display)
+         (should (not ly-display-pdf-post-tangle))
+        (ly-toggle-pdf-display)
+        (should ly-display-pdf-post-tangle))
+    (ly-toggle-pdf-display)
+    (should ly-display-pdf-post-tangle)
+    (ly-toggle-pdf-display)
+    (should (not ly-display-pdf-post-tangle))))
+
+(ert-deftest ob-lilypond/ly-toggle-png-generation-toggles-flag ()
+  (if ly-gen-png
+      (progn
+        (ly-toggle-png-generation)
+         (should (not ly-gen-png))
+        (ly-toggle-png-generation)
+        (should ly-gen-png))
+    (ly-toggle-png-generation)
+    (should ly-gen-png)
+    (ly-toggle-png-generation)
+    (should (not ly-gen-png))))
+
+(ert-deftest ob-lilypond/ly-toggle-html-generation-toggles-flag ()
+  (if ly-gen-html
+      (progn
+        (ly-toggle-html-generation)
+         (should (not ly-gen-html))
+        (ly-toggle-html-generation)
+        (should ly-gen-html))
+    (ly-toggle-html-generation)
+    (should ly-gen-html)
+    (ly-toggle-html-generation)
+    (should (not ly-gen-html))))
+
+(ert-deftest ob-lilypond/ly-switch-extension-with-extensions ()
+  (should (equal "test-name.xyz"
+                 (ly-switch-extension "test-name" ".xyz")))
+  (should (equal "test-name.xyz"
+                 (ly-switch-extension "test-name.abc" ".xyz")))
+  (should (equal "test-name"
+                 (ly-switch-extension "test-name.abc" ""))))
+
+(ert-deftest ob-lilypond/ly-switch-extension-with-paths ()
+  (should (equal "/some/path/to/test-name.xyz"
+                  (ly-switch-extension "/some/path/to/test-name" ".xyz"))))
+
+(provide 'test-ob-lilypond)
+
+;;; test-ob-lilypond.el ends here

[-- Attachment #3: Type: text/plain, Size: 560 bytes --]



It looks like noweb parsing has very recently become very brittle, 
since it broke the noweb in my lilypond example. 
This does not appear to be restricted to lilypond blocks.

The error is (wrong-type-argument consp nil)

I fixed for my songs by changing...

#+srcname: gen_arpeggio(key,root)

to...

#+srcname: gen_arpeggio (key,root)

and... 

<<gen_arpeggio(key="c",root="c")>>

to...

<<gen_arpeggio (key="c",root="c")>>

I believe #+call: is affected too.

Unfortunately I won't be able to investigate further until next week.

Regards

Martyn









^ permalink raw reply related	[flat|nested] 30+ messages in thread

* Re: ob-lilypond
  2011-07-01 13:43                   ` ob-lilypond Martyn Jago
@ 2011-07-01 19:27                     ` Eric Schulte
  2011-07-02 13:04                       ` ob-lilypond Martyn Jago
  0 siblings, 1 reply; 30+ messages in thread
From: Eric Schulte @ 2011-07-01 19:27 UTC (permalink / raw)
  To: Martyn Jago; +Cc: emacs-orgmode

Martyn Jago <martyn.jago@btinternet.com> writes:

> Hi
>
>> 
>> That's good to hear.  Are you up for trying to merge them into the rest
>> of the Org-mode test suite?  This should be as simple as placing any
>> org-mode example files you have in
>> 
>> org-mode/testing/examples/
>> 
>> placing the .el file defining your tests into
>> 
>> org-mode/testing/lisp/
>> 
>> and renaming all of your tests so that they start with the prefix
>> "ob-lilypond/"
>> 
>> I fully understand if you don't have the time to do this, and I should
>> be able to take a shot at it some time in the not-too-distant future.
>
> Hopefully this patch will work for you...
>

Yes, this patch applied without error, and the test suite passes all
tests.  Thanks for contributing and for greatly increasing the size of
the Org-mode test suite.

>
> It looks like noweb parsing has very recently become very brittle, 
> since it broke the noweb in my lilypond example. 
> This does not appear to be restricted to lilypond blocks.
>
> The error is (wrong-type-argument consp nil)
>
> I fixed for my songs by changing...
>
> #+srcname: gen_arpeggio(key,root)
>
> to...
>
> #+srcname: gen_arpeggio (key,root)
>
> and... 
>
> <<gen_arpeggio(key="c",root="c")>>
>
> to...
>
> <<gen_arpeggio (key="c",root="c")>>
>
> I believe #+call: is affected too.
>
> Unfortunately I won't be able to investigate further until next week.
>

I can't reproduce this problem, for example the following works for me
on the latest version of Org-mode.  I think perhaps you may not be on
the latest git HEAD.

Thanks again for this great contribution -- Eric

** define a block with a name for noweb expansion
   :PROPERTIES:
   :tangle:   yes
   :noweb:    yes
   :END:

#+source: simple(something="something")
#+begin_src emacs-lisp
  something
#+end_src

another block including the first block
#+begin_src emacs-lisp
  <<simple(something="something else")>>
#+end_src

-- 
Eric Schulte
http://cs.unm.edu/~eschulte/

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: ob-lilypond
  2011-07-01 19:27                     ` ob-lilypond Eric Schulte
@ 2011-07-02 13:04                       ` Martyn Jago
  0 siblings, 0 replies; 30+ messages in thread
From: Martyn Jago @ 2011-07-02 13:04 UTC (permalink / raw)
  To: Eric Schulte; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 926 bytes --]

Hi 

On 1 Jul 2011, at 20:27, Eric Schulte wrote:
>>> 
> I can't reproduce this problem, for example the following works for me
> on the latest version of Org-mode.  I think perhaps you may not be on
> the latest git HEAD.
> 
> Thanks again for this great contribution -- Eric
> 
> ** define a block with a name for noweb expansion
>   :PROPERTIES:
>   :tangle:   yes
>   :noweb:    yes
>   :END:
> 
> #+source: simple(something="something")
> #+begin_src emacs-lisp
>  something
> #+end_src
> 
> another block including the first block
> #+begin_src emacs-lisp
>  <<simple(something="something else")>>
> #+end_src
> 
> -- 
> Eric Schulte
> http://cs.unm.edu/~eschulte/

OK - It appears I was getting the differing results since I wasn't
passing in default parameters to my ruby blocks being called by
noweb...

was...

#+srcname:  gen_arpeggio(key,root)

now...

#+srcname:  gen_arpeggio(key="c",root="c")

Regards

Martyn


[-- Attachment #2: Type: text/html, Size: 1708 bytes --]

^ permalink raw reply	[flat|nested] 30+ messages in thread

* ob-lilypond
@ 2015-03-25 12:49 pls
  2015-03-26  9:20 ` ob-lilypond pls
  0 siblings, 1 reply; 30+ messages in thread
From: pls @ 2015-03-25 12:49 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 7158 bytes --]

Hey all,

looks like I’m having quite a few problems with ob-lilypond (Org-mode version 8.2.7b). To ensure that my setup is correct I ran the tests mentioned on http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-lilypond.html#sec-9:

M-x load-file RET ~/path/to/current/org-mode-git-repository/testing/lisp/test-ob-lilypond.el
M-x ert RET RET

And this is what I got (short version):

Selector: t
Passed: 6
Failed: 36 (36 unexpected)
Total:  42/42

Started at:   2015-03-25 13:32:19+0100
Finished.
Finished at:  2015-03-25 13:32:19+0100

...FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF…F

Am I missing something?

Thanks for any help!
patrick

Error message (long version):
Selector: t
Passed: 6
Failed: 36 (36 unexpected)
Total:  42/42

Started at:   2015-03-25 13:32:19+0100
Finished.
Finished at:  2015-03-25 13:32:19+0100

...FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF...F

F ob-lilypond/ly-arrange-mode
    (ert-test-failed
     ((should
       (boundp 'org-babel-lilypond-arrange-mode))
      :form
      (boundp org-babel-lilypond-arrange-mode)
      :value nil))

F ob-lilypond/ly-attempt-to-open-pdf
    (void-variable org-babel-lilypond-display-pdf-post-tangle)

F ob-lilypond/ly-attempt-to-play-midi
    (void-variable org-babel-lilypond-play-midi-post-tangle)

F ob-lilypond/ly-check-for-compile-error
    (void-function org-babel-lilypond-check-for-compile-error)

F ob-lilypond/ly-command-ly/bound
    (ert-test-failed
     ((should
       (boundp 'org-babel-lilypond-ly-command))
      :form
      (boundp org-babel-lilypond-ly-command)
      :value nil))

F ob-lilypond/ly-command-ly/stringp
    (void-variable org-babel-lilypond-ly-command)

F ob-lilypond/ly-command-midi/bound
    (ert-test-failed
     ((should
       (boundp 'org-babel-lilypond-midi-command))
      :form
      (boundp org-babel-lilypond-midi-command)
      :value nil))

F ob-lilypond/ly-command-midi/stringp
    (void-variable org-babel-lilypond-midi-command)

F ob-lilypond/ly-command-pdf/bound
    (ert-test-failed
     ((should
       (boundp 'org-babel-lilypond-pdf-command))
      :form
      (boundp org-babel-lilypond-pdf-command)
      :value nil))

F ob-lilypond/ly-command-pdf/stringp
    (void-variable org-babel-lilypond-pdf-command)

F ob-lilypond/ly-commands/customize
    (ert-test-failed
     ((should
       (equal
	(list org-babel-lilypond-ly-command org-babel-lilypond-pdf-command org-babel-lilypond-midi-command)
	(list "nonsense" "bla" "fasel")))
      :form
      (equal
       (nil nil nil)
       ("nonsense" "bla" "fasel"))
      :value nil :explanation
      (list-elt 0
		(different-types nil "nonsense"))))

F ob-lilypond/ly-commands/darwin
    (ert-test-failed
     ((should
       (equal
	(list org-babel-lilypond-ly-command org-babel-lilypond-pdf-command org-babel-lilypond-midi-command)
	(list "/Applications/lilypond.app/Contents/Resources/bin/lilypond" "open" "open")))
      :form
      (equal
       (nil nil nil)
       ("/Applications/lilypond.app/Contents/Resources/bin/lilypond" "open" "open"))
      :value nil :explanation
      (list-elt 0
		(different-types nil "/Applications/lilypond.app/Contents/Resources/bin/lilypond"))))

F ob-lilypond/ly-commands/other
    (ert-test-failed
     ((should
       (equal
	(list org-babel-lilypond-ly-command org-babel-lilypond-pdf-command org-babel-lilypond-midi-command)
	(list "lilypond" "xdg-open" "xdg-open")))
      :form
      (equal
       (nil nil nil)
       ("lilypond" "xdg-open" "xdg-open"))
      :value nil :explanation
      (list-elt 0
		(different-types nil "lilypond"))))

F ob-lilypond/ly-commands/windows-nt
    (ert-test-failed
     ((should
       (equal
	(list org-babel-lilypond-ly-command org-babel-lilypond-pdf-command org-babel-lilypond-midi-command)
	(list "lilypond" "" "")))
      :form
      (equal
       (nil nil nil)
       ("lilypond" "" ""))
      :value nil :explanation
      (list-elt 0
		(different-types nil "lilypond"))))

F ob-lilypond/ly-compile-lilyfile
    (void-variable org-babel-lilypond-ly-command)

F ob-lilypond/ly-compile-post-tangle
    (ert-test-failed
     ((should
       (boundp 'org-babel-lilypond-compile-post-tangle))
      :form
      (boundp org-babel-lilypond-compile-post-tangle)
      :value nil))

F ob-lilypond/ly-display-pdf-post-tangle
    (ert-test-failed
     ((should
       (boundp 'org-babel-lilypond-display-pdf-post-tangle))
      :form
      (boundp org-babel-lilypond-display-pdf-post-tangle)
      :value nil))

F ob-lilypond/ly-gen-html
    (ert-test-failed
     ((should
       (boundp 'org-babel-lilypond-gen-pdf))
      :form
      (boundp org-babel-lilypond-gen-pdf)
      :value nil))

F ob-lilypond/ly-gen-png
    (ert-test-failed
     ((should
       (boundp 'org-babel-lilypond-gen-png))
      :form
      (boundp org-babel-lilypond-gen-png)
      :value nil))

F ob-lilypond/ly-gen-svg
    (ert-test-failed
     ((should
       (boundp 'org-babel-lilypond-gen-svg))
      :form
      (boundp org-babel-lilypond-gen-svg)
      :value nil))

F ob-lilypond/ly-get-header-args
    (void-function org-babel-lilypond-set-header-args)

F ob-lilypond/ly-mark-error-line
    (void-function org-babel-lilypond-mark-error-line)

F ob-lilypond/ly-parse-error-line
    (void-function org-babel-lilypond-parse-error-line)

F ob-lilypond/ly-parse-line-num
    (void-function org-babel-lilypond-parse-line-num)

F ob-lilypond/ly-play-midi-post-tangle
    (ert-test-failed
     ((should
       (boundp 'org-babel-lilypond-play-midi-post-tangle))
      :form
      (boundp org-babel-lilypond-play-midi-post-tangle)
      :value nil))

F ob-lilypond/ly-process-compile-error
    (ert-test-failed
     ((should
       (equal 238
	      (point)))
      :form
      (equal 238 1)
      :value nil :explanation
      (different-atoms
       (238 "#xee" "?î")
       (1 "#x1" "?\x01"))))

F ob-lilypond/ly-set-header-args
    (void-function org-babel-lilypond-set-header-args)

F ob-lilypond/ly-switch-extension-with-extensions
    (void-function org-babel-lilypond-switch-extension)

F ob-lilypond/ly-switch-extension-with-paths
    (void-function org-babel-lilypond-switch-extension)

F ob-lilypond/ly-toggle-arrange-mode
    (void-variable org-babel-lilypond-arrange-mode)

F ob-lilypond/ly-toggle-html-generation-toggles-flag
    (void-variable org-babel-lilypond-gen-html)

F ob-lilypond/ly-toggle-midi-play-toggles-flag
    (void-variable org-babel-lilypond-play-midi-post-tangle)

F ob-lilypond/ly-toggle-pdf-display-toggles-flag
    (void-variable org-babel-lilypond-display-pdf-post-tangle)

F ob-lilypond/ly-toggle-pdf-generation-toggles-flag
    (void-variable org-babel-lilypond-gen-pdf)

F ob-lilypond/ly-toggle-png-generation-toggles-flag
    (void-variable org-babel-lilypond-gen-png)

F ob-lilypond/use-eps
    (ert-test-failed
     ((should
       (boundp 'org-babel-lilypond-use-eps))
      :form
      (boundp org-babel-lilypond-use-eps)
      :value nil))



[-- Attachment #2: Type: text/html, Size: 15536 bytes --]

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: ob-lilypond
  2015-03-25 12:49 ob-lilypond pls
@ 2015-03-26  9:20 ` pls
  2015-03-29 21:27   ` ob-lilypond Nick Dokos
  0 siblings, 1 reply; 30+ messages in thread
From: pls @ 2015-03-26  9:20 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 7188 bytes --]

Hey all,

looks like I’m having quite a few problems with ob-lilypond (Org-mode version 8.2.7b). To ensure that my setup is correct I ran the tests mentioned on http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-lilypond.html#sec-9:

M-x load-file RET ~/path/to/current/org-mode-git-repository/testing/lisp/test-ob-lilypond.el
M-x ert RET RET

And this is what I got (short version):

Selector: t
Passed: 6
Failed: 36 (36 unexpected)
Total:  42/42

Started at:   2015-03-25 13:32:19+0100
Finished.
Finished at:  2015-03-25 13:32:19+0100

...FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF…F

Am I missing something? How can I get this to work?

Thanks for any help!
patrick

Error message (long version):
Selector: t
Passed: 6
Failed: 36 (36 unexpected)
Total:  42/42

Started at:   2015-03-25 13:32:19+0100
Finished.
Finished at:  2015-03-25 13:32:19+0100

...FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF...F

F ob-lilypond/ly-arrange-mode
    (ert-test-failed
     ((should
       (boundp 'org-babel-lilypond-arrange-mode))
      :form
      (boundp org-babel-lilypond-arrange-mode)
      :value nil))

F ob-lilypond/ly-attempt-to-open-pdf
    (void-variable org-babel-lilypond-display-pdf-post-tangle)

F ob-lilypond/ly-attempt-to-play-midi
    (void-variable org-babel-lilypond-play-midi-post-tangle)

F ob-lilypond/ly-check-for-compile-error
    (void-function org-babel-lilypond-check-for-compile-error)

F ob-lilypond/ly-command-ly/bound
    (ert-test-failed
     ((should
       (boundp 'org-babel-lilypond-ly-command))
      :form
      (boundp org-babel-lilypond-ly-command)
      :value nil))

F ob-lilypond/ly-command-ly/stringp
    (void-variable org-babel-lilypond-ly-command)

F ob-lilypond/ly-command-midi/bound
    (ert-test-failed
     ((should
       (boundp 'org-babel-lilypond-midi-command))
      :form
      (boundp org-babel-lilypond-midi-command)
      :value nil))

F ob-lilypond/ly-command-midi/stringp
    (void-variable org-babel-lilypond-midi-command)

F ob-lilypond/ly-command-pdf/bound
    (ert-test-failed
     ((should
       (boundp 'org-babel-lilypond-pdf-command))
      :form
      (boundp org-babel-lilypond-pdf-command)
      :value nil))

F ob-lilypond/ly-command-pdf/stringp
    (void-variable org-babel-lilypond-pdf-command)

F ob-lilypond/ly-commands/customize
    (ert-test-failed
     ((should
       (equal
	(list org-babel-lilypond-ly-command org-babel-lilypond-pdf-command org-babel-lilypond-midi-command)
	(list "nonsense" "bla" "fasel")))
      :form
      (equal
       (nil nil nil)
       ("nonsense" "bla" "fasel"))
      :value nil :explanation
      (list-elt 0
		(different-types nil "nonsense"))))

F ob-lilypond/ly-commands/darwin
    (ert-test-failed
     ((should
       (equal
	(list org-babel-lilypond-ly-command org-babel-lilypond-pdf-command org-babel-lilypond-midi-command)
	(list "/Applications/lilypond.app/Contents/Resources/bin/lilypond" "open" "open")))
      :form
      (equal
       (nil nil nil)
       ("/Applications/lilypond.app/Contents/Resources/bin/lilypond" "open" "open"))
      :value nil :explanation
      (list-elt 0
		(different-types nil "/Applications/lilypond.app/Contents/Resources/bin/lilypond"))))

F ob-lilypond/ly-commands/other
    (ert-test-failed
     ((should
       (equal
	(list org-babel-lilypond-ly-command org-babel-lilypond-pdf-command org-babel-lilypond-midi-command)
	(list "lilypond" "xdg-open" "xdg-open")))
      :form
      (equal
       (nil nil nil)
       ("lilypond" "xdg-open" "xdg-open"))
      :value nil :explanation
      (list-elt 0
		(different-types nil "lilypond"))))

F ob-lilypond/ly-commands/windows-nt
    (ert-test-failed
     ((should
       (equal
	(list org-babel-lilypond-ly-command org-babel-lilypond-pdf-command org-babel-lilypond-midi-command)
	(list "lilypond" "" "")))
      :form
      (equal
       (nil nil nil)
       ("lilypond" "" ""))
      :value nil :explanation
      (list-elt 0
		(different-types nil "lilypond"))))

F ob-lilypond/ly-compile-lilyfile
    (void-variable org-babel-lilypond-ly-command)

F ob-lilypond/ly-compile-post-tangle
    (ert-test-failed
     ((should
       (boundp 'org-babel-lilypond-compile-post-tangle))
      :form
      (boundp org-babel-lilypond-compile-post-tangle)
      :value nil))

F ob-lilypond/ly-display-pdf-post-tangle
    (ert-test-failed
     ((should
       (boundp 'org-babel-lilypond-display-pdf-post-tangle))
      :form
      (boundp org-babel-lilypond-display-pdf-post-tangle)
      :value nil))

F ob-lilypond/ly-gen-html
    (ert-test-failed
     ((should
       (boundp 'org-babel-lilypond-gen-pdf))
      :form
      (boundp org-babel-lilypond-gen-pdf)
      :value nil))

F ob-lilypond/ly-gen-png
    (ert-test-failed
     ((should
       (boundp 'org-babel-lilypond-gen-png))
      :form
      (boundp org-babel-lilypond-gen-png)
      :value nil))

F ob-lilypond/ly-gen-svg
    (ert-test-failed
     ((should
       (boundp 'org-babel-lilypond-gen-svg))
      :form
      (boundp org-babel-lilypond-gen-svg)
      :value nil))

F ob-lilypond/ly-get-header-args
    (void-function org-babel-lilypond-set-header-args)

F ob-lilypond/ly-mark-error-line
    (void-function org-babel-lilypond-mark-error-line)

F ob-lilypond/ly-parse-error-line
    (void-function org-babel-lilypond-parse-error-line)

F ob-lilypond/ly-parse-line-num
    (void-function org-babel-lilypond-parse-line-num)

F ob-lilypond/ly-play-midi-post-tangle
    (ert-test-failed
     ((should
       (boundp 'org-babel-lilypond-play-midi-post-tangle))
      :form
      (boundp org-babel-lilypond-play-midi-post-tangle)
      :value nil))

F ob-lilypond/ly-process-compile-error
    (ert-test-failed
     ((should
       (equal 238
	      (point)))
      :form
      (equal 238 1)
      :value nil :explanation
      (different-atoms
       (238 "#xee" "?î")
       (1 "#x1" "?\x01"))))

F ob-lilypond/ly-set-header-args
    (void-function org-babel-lilypond-set-header-args)

F ob-lilypond/ly-switch-extension-with-extensions
    (void-function org-babel-lilypond-switch-extension)

F ob-lilypond/ly-switch-extension-with-paths
    (void-function org-babel-lilypond-switch-extension)

F ob-lilypond/ly-toggle-arrange-mode
    (void-variable org-babel-lilypond-arrange-mode)

F ob-lilypond/ly-toggle-html-generation-toggles-flag
    (void-variable org-babel-lilypond-gen-html)

F ob-lilypond/ly-toggle-midi-play-toggles-flag
    (void-variable org-babel-lilypond-play-midi-post-tangle)

F ob-lilypond/ly-toggle-pdf-display-toggles-flag
    (void-variable org-babel-lilypond-display-pdf-post-tangle)

F ob-lilypond/ly-toggle-pdf-generation-toggles-flag
    (void-variable org-babel-lilypond-gen-pdf)

F ob-lilypond/ly-toggle-png-generation-toggles-flag
    (void-variable org-babel-lilypond-gen-png)

F ob-lilypond/use-eps
    (ert-test-failed
     ((should
       (boundp 'org-babel-lilypond-use-eps))
      :form
      (boundp org-babel-lilypond-use-eps)
      :value nil))




[-- Attachment #2: Type: text/html, Size: 13090 bytes --]

^ permalink raw reply	[flat|nested] 30+ messages in thread

* ob-lilypond
@ 2015-03-26  9:26 Patrick L. Schmidt
  0 siblings, 0 replies; 30+ messages in thread
From: Patrick L. Schmidt @ 2015-03-26  9:26 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 7180 bytes --]

Hey all,

looks like I’m having quite a few problems with ob-lilypond (Org-mode version 8.2.7b). To ensure that my setup is correct I ran the tests mentioned on http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-lilypond.html#sec-9:

M-x load-file RET ~/path/to/current/org-mode-git-repository/testing/lisp/test-ob-lilypond.el
M-x ert RET RET

And this is what I got (short version):

Selector: t
Passed: 6
Failed: 36 (36 unexpected)
Total:  42/42

Started at:   2015-03-25 13:32:19+0100
Finished.
Finished at:  2015-03-25 13:32:19+0100

...FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF…F

Am I missing something? How can I get this to work?

Thanks for any help!
patrick

Error message (long version):
Selector: t
Passed: 6
Failed: 36 (36 unexpected)
Total:  42/42

Started at:   2015-03-25 13:32:19+0100
Finished.
Finished at:  2015-03-25 13:32:19+0100

...FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF...F

F ob-lilypond/ly-arrange-mode
    (ert-test-failed
     ((should
       (boundp 'org-babel-lilypond-arrange-mode))
      :form
      (boundp org-babel-lilypond-arrange-mode)
      :value nil))

F ob-lilypond/ly-attempt-to-open-pdf
    (void-variable org-babel-lilypond-display-pdf-post-tangle)

F ob-lilypond/ly-attempt-to-play-midi
    (void-variable org-babel-lilypond-play-midi-post-tangle)

F ob-lilypond/ly-check-for-compile-error
    (void-function org-babel-lilypond-check-for-compile-error)

F ob-lilypond/ly-command-ly/bound
    (ert-test-failed
     ((should
       (boundp 'org-babel-lilypond-ly-command))
      :form
      (boundp org-babel-lilypond-ly-command)
      :value nil))

F ob-lilypond/ly-command-ly/stringp
    (void-variable org-babel-lilypond-ly-command)

F ob-lilypond/ly-command-midi/bound
    (ert-test-failed
     ((should
       (boundp 'org-babel-lilypond-midi-command))
      :form
      (boundp org-babel-lilypond-midi-command)
      :value nil))

F ob-lilypond/ly-command-midi/stringp
    (void-variable org-babel-lilypond-midi-command)

F ob-lilypond/ly-command-pdf/bound
    (ert-test-failed
     ((should
       (boundp 'org-babel-lilypond-pdf-command))
      :form
      (boundp org-babel-lilypond-pdf-command)
      :value nil))

F ob-lilypond/ly-command-pdf/stringp
    (void-variable org-babel-lilypond-pdf-command)

F ob-lilypond/ly-commands/customize
    (ert-test-failed
     ((should
       (equal
	(list org-babel-lilypond-ly-command org-babel-lilypond-pdf-command org-babel-lilypond-midi-command)
	(list "nonsense" "bla" "fasel")))
      :form
      (equal
       (nil nil nil)
       ("nonsense" "bla" "fasel"))
      :value nil :explanation
      (list-elt 0
		(different-types nil "nonsense"))))

F ob-lilypond/ly-commands/darwin
    (ert-test-failed
     ((should
       (equal
	(list org-babel-lilypond-ly-command org-babel-lilypond-pdf-command org-babel-lilypond-midi-command)
	(list "/Applications/lilypond.app/Contents/Resources/bin/lilypond" "open" "open")))
      :form
      (equal
       (nil nil nil)
       ("/Applications/lilypond.app/Contents/Resources/bin/lilypond" "open" "open"))
      :value nil :explanation
      (list-elt 0
		(different-types nil "/Applications/lilypond.app/Contents/Resources/bin/lilypond"))))

F ob-lilypond/ly-commands/other
    (ert-test-failed
     ((should
       (equal
	(list org-babel-lilypond-ly-command org-babel-lilypond-pdf-command org-babel-lilypond-midi-command)
	(list "lilypond" "xdg-open" "xdg-open")))
      :form
      (equal
       (nil nil nil)
       ("lilypond" "xdg-open" "xdg-open"))
      :value nil :explanation
      (list-elt 0
		(different-types nil "lilypond"))))

F ob-lilypond/ly-commands/windows-nt
    (ert-test-failed
     ((should
       (equal
	(list org-babel-lilypond-ly-command org-babel-lilypond-pdf-command org-babel-lilypond-midi-command)
	(list "lilypond" "" "")))
      :form
      (equal
       (nil nil nil)
       ("lilypond" "" ""))
      :value nil :explanation
      (list-elt 0
		(different-types nil "lilypond"))))

F ob-lilypond/ly-compile-lilyfile
    (void-variable org-babel-lilypond-ly-command)

F ob-lilypond/ly-compile-post-tangle
    (ert-test-failed
     ((should
       (boundp 'org-babel-lilypond-compile-post-tangle))
      :form
      (boundp org-babel-lilypond-compile-post-tangle)
      :value nil))

F ob-lilypond/ly-display-pdf-post-tangle
    (ert-test-failed
     ((should
       (boundp 'org-babel-lilypond-display-pdf-post-tangle))
      :form
      (boundp org-babel-lilypond-display-pdf-post-tangle)
      :value nil))

F ob-lilypond/ly-gen-html
    (ert-test-failed
     ((should
       (boundp 'org-babel-lilypond-gen-pdf))
      :form
      (boundp org-babel-lilypond-gen-pdf)
      :value nil))

F ob-lilypond/ly-gen-png
    (ert-test-failed
     ((should
       (boundp 'org-babel-lilypond-gen-png))
      :form
      (boundp org-babel-lilypond-gen-png)
      :value nil))

F ob-lilypond/ly-gen-svg
    (ert-test-failed
     ((should
       (boundp 'org-babel-lilypond-gen-svg))
      :form
      (boundp org-babel-lilypond-gen-svg)
      :value nil))

F ob-lilypond/ly-get-header-args
    (void-function org-babel-lilypond-set-header-args)

F ob-lilypond/ly-mark-error-line
    (void-function org-babel-lilypond-mark-error-line)

F ob-lilypond/ly-parse-error-line
    (void-function org-babel-lilypond-parse-error-line)

F ob-lilypond/ly-parse-line-num
    (void-function org-babel-lilypond-parse-line-num)

F ob-lilypond/ly-play-midi-post-tangle
    (ert-test-failed
     ((should
       (boundp 'org-babel-lilypond-play-midi-post-tangle))
      :form
      (boundp org-babel-lilypond-play-midi-post-tangle)
      :value nil))

F ob-lilypond/ly-process-compile-error
    (ert-test-failed
     ((should
       (equal 238
	      (point)))
      :form
      (equal 238 1)
      :value nil :explanation
      (different-atoms
       (238 "#xee" "?î")
       (1 "#x1" "?\x01"))))

F ob-lilypond/ly-set-header-args
    (void-function org-babel-lilypond-set-header-args)

F ob-lilypond/ly-switch-extension-with-extensions
    (void-function org-babel-lilypond-switch-extension)

F ob-lilypond/ly-switch-extension-with-paths
    (void-function org-babel-lilypond-switch-extension)

F ob-lilypond/ly-toggle-arrange-mode
    (void-variable org-babel-lilypond-arrange-mode)

F ob-lilypond/ly-toggle-html-generation-toggles-flag
    (void-variable org-babel-lilypond-gen-html)

F ob-lilypond/ly-toggle-midi-play-toggles-flag
    (void-variable org-babel-lilypond-play-midi-post-tangle)

F ob-lilypond/ly-toggle-pdf-display-toggles-flag
    (void-variable org-babel-lilypond-display-pdf-post-tangle)

F ob-lilypond/ly-toggle-pdf-generation-toggles-flag
    (void-variable org-babel-lilypond-gen-pdf)

F ob-lilypond/ly-toggle-png-generation-toggles-flag
    (void-variable org-babel-lilypond-gen-png)

F ob-lilypond/use-eps
    (ert-test-failed
     ((should
       (boundp 'org-babel-lilypond-use-eps))
      :form
      (boundp org-babel-lilypond-use-eps)
      :value nil))

[-- Attachment #2: Type: text/html, Size: 13094 bytes --]

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: ob-lilypond
  2015-03-26  9:20 ` ob-lilypond pls
@ 2015-03-29 21:27   ` Nick Dokos
  2015-03-30  9:20     ` ob-lilypond Patrick L. Schmidt
  0 siblings, 1 reply; 30+ messages in thread
From: Nick Dokos @ 2015-03-29 21:27 UTC (permalink / raw)
  To: emacs-orgmode

pls <p.l.schmidt@gmx.de> writes:

> Hey all,
>
> looks like I’m having quite a few problems with ob-lilypond (Org-mode version 8.2.7b).
> To ensure that my setup is correct I ran the tests mentioned on http://orgmode.org/worg
> /org-contrib/babel/languages/ob-doc-lilypond.html#sec-9:
>
>     M-x load-file RET ~/path/to/current/org-mode-git-repository/testing/lisp/
>     test-ob-lilypond.el
>     M-x ert RET RET
>
> And this is what I got (short version):
>
>     Selector: t
>     Passed: 6
>     Failed: 36 (36 unexpected)
>     Total:  42/42
>    
>     Started at:   2015-03-25 13:32:19+0100
>     Finished.
>     Finished at:  2015-03-25 13:32:19+0100
>    
>     ...FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF…F
>
> Am I missing something? How can I get this to work?
>

Probably missing a load-file: in addition to ob-lilypond.el
and test-ob-lilypond.el, you need to load org-test.el (which
is in the testing subdir of the git repo).

With those three loaded (in addition to org-mode itself of course), all
42 tests pass in my setup:

Org-mode version 8.3beta (release_8.3beta-882-gf8731e @
/home/nick/elisp/org-mode/lisp/)

HTH,
Nick

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: ob-lilypond
  2015-03-29 21:27   ` ob-lilypond Nick Dokos
@ 2015-03-30  9:20     ` Patrick L. Schmidt
  0 siblings, 0 replies; 30+ messages in thread
From: Patrick L. Schmidt @ 2015-03-30  9:20 UTC (permalink / raw)
  To: Nick Dokos; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1903 bytes --]

Nick,

thank you very much for your helpful suggestions! After loading ob-lilypond.el, test-ob-lilypond.el and org-test.el from the git repo 38/42 tests passed. After I also loaded ob-org.el (git-repo) only one test failed. So I guess my org-mode version 8.2.7b (installed via elpa) is too old???  I tried to install the latest version from the git repo following the instructions at http://orgmode.org/manual/Installation.html.  But M-x org-version still returns org-mode version 8.2.7b. Do I have to get rid of the elpa-versions of org-mode. If yes, what’s the best way to do so?

Thanks a million!
patrick
On 29.03.2015, at 23:27, Nick Dokos <ndokos@gmail.com> wrote:

> pls <p.l.schmidt@gmx.de> writes:
> 
>> Hey all,
>> 
>> looks like I’m having quite a few problems with ob-lilypond (Org-mode version 8.2.7b).
>> To ensure that my setup is correct I ran the tests mentioned on http://orgmode.org/worg
>> /org-contrib/babel/languages/ob-doc-lilypond.html#sec-9:
>> 
>>    M-x load-file RET ~/path/to/current/org-mode-git-repository/testing/lisp/
>>    test-ob-lilypond.el
>>    M-x ert RET RET
>> 
>> And this is what I got (short version):
>> 
>>    Selector: t
>>    Passed: 6
>>    Failed: 36 (36 unexpected)
>>    Total:  42/42
>> 
>>    Started at:   2015-03-25 13:32:19+0100
>>    Finished.
>>    Finished at:  2015-03-25 13:32:19+0100
>> 
>>    ...FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF…F
>> 
>> Am I missing something? How can I get this to work?
>> 
> 
> Probably missing a load-file: in addition to ob-lilypond.el
> and test-ob-lilypond.el, you need to load org-test.el (which
> is in the testing subdir of the git repo).
> 
> With those three loaded (in addition to org-mode itself of course), all
> 42 tests pass in my setup:
> 
> Org-mode version 8.3beta (release_8.3beta-882-gf8731e @
> /home/nick/elisp/org-mode/lisp/)
> 
> HTH,
> Nick


[-- Attachment #2: Type: text/html, Size: 2959 bytes --]

^ permalink raw reply	[flat|nested] 30+ messages in thread

end of thread, other threads:[~2015-03-30  9:20 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-25 12:49 ob-lilypond pls
2015-03-26  9:20 ` ob-lilypond pls
2015-03-29 21:27   ` ob-lilypond Nick Dokos
2015-03-30  9:20     ` ob-lilypond Patrick L. Schmidt
  -- strict thread matches above, loose matches on Subject: below --
2015-03-26  9:26 ob-lilypond Patrick L. Schmidt
2011-06-27 13:00 ob-lilypond Martyn Jago
2011-06-27 18:53 ` ob-lilypond Eric Schulte
2011-06-28  9:38   ` ob-lilypond Martyn Jago
2011-06-28 10:07     ` ob-lilypond Bastien
2011-06-28 10:21       ` ob-lilypond Bastien
2011-06-28 20:45         ` ob-lilypond Eric Schulte
2011-06-28 23:07           ` ob-lilypond Bastien
2011-06-29  0:41             ` ob-lilypond Eric Schulte
2011-06-29 17:07           ` ob-lilypond Martyn Jago
2011-06-29 21:15             ` ob-lilypond Eric Schulte
2011-06-30  6:38               ` ob-lilypond Martyn Jago
2011-06-30 18:10                 ` ob-lilypond Eric Schulte
2011-07-01 12:01                   ` ob-lilypond Christian Moe
2011-07-01 13:43                   ` ob-lilypond Martyn Jago
2011-07-01 19:27                     ` ob-lilypond Eric Schulte
2011-07-02 13:04                       ` ob-lilypond Martyn Jago
2011-06-28 13:38     ` ob-lilypond Cameron Horsburgh
2011-06-28 16:46       ` ob-lilypond Martyn Jago
2011-06-28 12:11 ` ob-lilypond Christian Moe
2011-06-28 13:18   ` ob-lilypond David O'Toole
2011-06-28 17:06   ` ob-lilypond Martyn Jago
2011-06-28 18:51     ` ob-lilypond Christian Moe
2011-06-28 19:00     ` ob-lilypond Michael Brand
2011-06-28 20:00     ` ob-lilypond Christian Moe
2011-06-28 21:19       ` ob-lilypond Martyn Jago

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).