all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Fwd: ob-lilypond: pre- and post-processing of source blocks
       [not found] <0dabc937-df1c-4b65-971b-f83812526af4@dewdrop-world.net>
@ 2013-11-04 12:39 ` James Harkins
  2013-11-04 14:00   ` Eric Schulte
  0 siblings, 1 reply; 5+ messages in thread
From: James Harkins @ 2013-11-04 12:39 UTC (permalink / raw)
  To: Emacs-orgmode

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

Apologies for resending -- I sent this a few hours ago but I don't see it
on gmane, or in the gnu.org archive either.

Actually the manual answers question #1 -- I should be able to use the
prologue header argument for that. And I can already do #2 (included just
to outline the desired behavior completely).

I haven't found anything in the manual explaining how to run a shell
command on the output file from LilyPond execution. That's really the
crucial one -- it makes no sense to embed an A4 sized image into a beamer
frame...

hjh

---------- Forwarded message ----------
From: "James Harkins" <jamshark70@dewdrop-world.net>
Date: Nov 4, 2013 1:44 PM
Subject: ob-lilypond: pre- and post-processing of source blocks
To: "orgmode" <emacs-orgmode@gnu.org>
Cc:

> I would like to be able to do the following with ob-lilypond (basic mode):
>
> 1. Wrap the source block in pre- and/or post-strings (specifically to add
"\header { tagline = ##f }" before the music expressions).
>
> 2. Have lilypond compile the block.
>
> 3. Run "convert -trim" on the resulting png. (Haven't figured out how to
use eps output with xelatex.)
>
> Is this at all feasible? If not, where would I stick this stuff into the
orgmode source?
>
> hjh

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

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

* Re: Fwd: ob-lilypond: pre- and post-processing of source blocks
  2013-11-04 12:39 ` Fwd: ob-lilypond: pre- and post-processing of source blocks James Harkins
@ 2013-11-04 14:00   ` Eric Schulte
  2013-11-05  4:24     ` James Harkins
  0 siblings, 1 reply; 5+ messages in thread
From: Eric Schulte @ 2013-11-04 14:00 UTC (permalink / raw)
  To: jamshark70; +Cc: Emacs-orgmode

>> I would like to be able to do the following with ob-lilypond (basic mode):
>>
>> 1. Wrap the source block in pre- and/or post-strings (specifically to add
> "\header { tagline = ##f }" before the music expressions).
>>
>> 2. Have lilypond compile the block.
>>
>> 3. Run "convert -trim" on the resulting png. (Haven't figured out how to
> use eps output with xelatex.)
>>
>> Is this at all feasible? If not, where would I stick this stuff into the
> orgmode source?
>>

Look in lisp/ob-lilypond.el.  Specifically (1) would be done in
`org-babel-expand-body:lilypond', and both (2) and (3) in
`org-babel-execute:lilypond'.

See http://orgmode.org/worg/org-contribute.html if you want to
contribute any enhancements back to Org-mode.

Best,

-- 
Eric Schulte
https://cs.unm.edu/~eschulte
PGP: 0x614CA05D

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

* Re: Fwd: ob-lilypond: pre- and post-processing of source blocks
  2013-11-04 14:00   ` Eric Schulte
@ 2013-11-05  4:24     ` James Harkins
  2013-11-05  5:35       ` James Harkins
  0 siblings, 1 reply; 5+ messages in thread
From: James Harkins @ 2013-11-05  4:24 UTC (permalink / raw)
  To: Eric Schulte; +Cc: jamshark70, Emacs-orgmode

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

On Nov 4, 2013 10:08 PM, "Eric Schulte" <schulte.eric@gmail.com> wrote:
> Look in lisp/ob-lilypond.el.  Specifically (1) would be done in
> `org-babel-expand-body:lilypond', and both (2) and (3) in
> `org-babel-execute:lilypond'.

Thanks. I'm not much of a LISPer so I have no idea when I might get around
to that.

In the meantime, I was just advised that lilypond has a command-line switch
"-dpreview" that should eliminate the need to run "convert -trim." I'll try
that first.

hjh

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

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

* Re: Fwd: ob-lilypond: pre- and post-processing of source blocks
  2013-11-05  4:24     ` James Harkins
@ 2013-11-05  5:35       ` James Harkins
  2013-11-05  6:17         ` Thomas S. Dye
  0 siblings, 1 reply; 5+ messages in thread
From: James Harkins @ 2013-11-05  5:35 UTC (permalink / raw)
  To: Emacs-orgmode; +Cc: Eric Schulte

On Tuesday, November 5, 2013 12:24:44 PM HKT, James Harkins wrote:
> On Nov 4, 2013 10:08 PM, "Eric Schulte" <schulte.eric@gmail.com> wrote:
>> Look in lisp/ob-lilypond.el.  Specifically (1) would be done in
>> `org-babel-expand-body:lilypond', and both (2) and (3) in
>> `org-babel-execute:lilypond'.
>
> Thanks. I'm not much of a LISPer so I have no idea when I might get 
around
> to that.
>
> In the meantime, I was just advised that lilypond has a command-line 
switch
> "-dpreview" that should eliminate the need to run "convert -trim." I'll 
try
> that first.

I have managed to get this working, by adding this to .emacs 
(unfortunately, this is not exposed as a defcustom).

(setq ly-nix-ly-path "/usr/bin/lilypond -dpreview")

Incidentally, it would be very useful if babel offered a header argument 
for commandline switches. If there is one, it was not obvious at [1] which 
one it should be.

Then, this actually compiles and displays well enough:

#+name: pitches
#+begin_src lilypond -i :exports both :file pitches.png :prologue 
\header{tagline=##f}
\include "english.ly"
{ c' e' g' fs' a' c'' ef'' d' }
#+end_src

Next up: I would like ":prologue \header{tagline=##f}" to be buffer wide. I 
tried this:

#+PROPERTY: header-args:lilypond :prologue \header{tagline=##f}

.. but it didn't work at first.

[5 minutes]

OK, I had to refresh the buffer setup. That wasn't obvious in the 
documentation.

So it all seems to be working now.

hjh

[1] 
http://orgmode.org/manual/Specific-header-arguments.html#Specific-header-arguments

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

* Re: Fwd: ob-lilypond: pre- and post-processing of source blocks
  2013-11-05  5:35       ` James Harkins
@ 2013-11-05  6:17         ` Thomas S. Dye
  0 siblings, 0 replies; 5+ messages in thread
From: Thomas S. Dye @ 2013-11-05  6:17 UTC (permalink / raw)
  To: James Harkins; +Cc: Emacs-orgmode, Eric Schulte

James Harkins <jamshark70@gmail.com> writes:

> Incidentally, it would be very useful if babel offered a header argument 
> for commandline switches. If there is one, it was not obvious at [1] which 
> one it should be.

A header argument for command line switches is implemented for some
babel languages. See lines 68-79 of ob-dot.el, for instance, which
implements a :cmdline header argument. It might be easy to implement
something similar for ob-lilypond.el, as well.

All the best,
Tom

-- 
Thomas S. Dye
http://www.tsdye.com

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

end of thread, other threads:[~2013-11-05  6:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <0dabc937-df1c-4b65-971b-f83812526af4@dewdrop-world.net>
2013-11-04 12:39 ` Fwd: ob-lilypond: pre- and post-processing of source blocks James Harkins
2013-11-04 14:00   ` Eric Schulte
2013-11-05  4:24     ` James Harkins
2013-11-05  5:35       ` James Harkins
2013-11-05  6:17         ` Thomas S. Dye

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.