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; 32+ 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] 32+ messages in thread
* ob-lilypond
@ 2015-03-25 12:49 pls
  2015-03-26  9:20 ` ob-lilypond pls
  0 siblings, 1 reply; 32+ 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] 32+ messages in thread
* ob-lilypond
@ 2015-03-26  9:26 Patrick L. Schmidt
  0 siblings, 0 replies; 32+ 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] 32+ messages in thread

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

Thread overview: 32+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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-06  8:13                     ` [BABEL][PATCH] ob-lilypond basic mode - was ob-lilypond Martyn Jago
2011-07-06 13:20                       ` Eric Schulte
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
  -- strict thread matches above, loose matches on Subject: below --
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
2015-03-26  9:26 ob-lilypond Patrick L. Schmidt

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).