From mboxrd@z Thu Jan 1 00:00:00 1970 From: James Harkins Subject: Fwd: ob-lilypond: pre- and post-processing of source blocks Date: Mon, 4 Nov 2013 20:39:42 +0800 Message-ID: References: <0dabc937-df1c-4b65-971b-f83812526af4@dewdrop-world.net> Reply-To: jamshark70@dewdrop-world.net Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=089e01536b14d1931904ea593525 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:51632) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VdJRZ-00060A-0T for Emacs-orgmode@gnu.org; Mon, 04 Nov 2013 07:39:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VdJRX-0005GV-I5 for Emacs-orgmode@gnu.org; Mon, 04 Nov 2013 07:39:44 -0500 Received: from mail-ob0-x230.google.com ([2607:f8b0:4003:c01::230]:53479) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VdJRX-0005FM-Co for Emacs-orgmode@gnu.org; Mon, 04 Nov 2013 07:39:43 -0500 Received: by mail-ob0-f176.google.com with SMTP id uy5so6923013obc.7 for ; Mon, 04 Nov 2013 04:39:42 -0800 (PST) In-Reply-To: <0dabc937-df1c-4b65-971b-f83812526af4@dewdrop-world.net> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Emacs-orgmode@gnu.org --089e01536b14d1931904ea593525 Content-Type: text/plain; charset=ISO-8859-1 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" Date: Nov 4, 2013 1:44 PM Subject: ob-lilypond: pre- and post-processing of source blocks To: "orgmode" 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 --089e01536b14d1931904ea593525 Content-Type: text/html; charset=ISO-8859-1

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

--089e01536b14d1931904ea593525-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Schulte Subject: Re: Fwd: ob-lilypond: pre- and post-processing of source blocks Date: Mon, 04 Nov 2013 07:00:14 -0700 Message-ID: <87r4aws1w1.fsf@gmail.com> References: <0dabc937-df1c-4b65-971b-f83812526af4@dewdrop-world.net> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:40656) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VdKiA-0005dt-HS for Emacs-orgmode@gnu.org; Mon, 04 Nov 2013 09:01:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VdKi6-0002bE-05 for Emacs-orgmode@gnu.org; Mon, 04 Nov 2013 09:00:58 -0500 Received: from mail-pd0-x22a.google.com ([2607:f8b0:400e:c02::22a]:35617) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VdKi5-0002az-O3 for Emacs-orgmode@gnu.org; Mon, 04 Nov 2013 09:00:53 -0500 Received: by mail-pd0-f170.google.com with SMTP id v10so6809878pde.1 for ; Mon, 04 Nov 2013 06:00:52 -0800 (PST) In-Reply-To: (James Harkins's message of "Mon, 4 Nov 2013 20:39:42 +0800") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: jamshark70@dewdrop-world.net Cc: Emacs-orgmode@gnu.org >> 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 From mboxrd@z Thu Jan 1 00:00:00 1970 From: James Harkins Subject: Re: Fwd: ob-lilypond: pre- and post-processing of source blocks Date: Tue, 5 Nov 2013 12:24:44 +0800 Message-ID: References: <0dabc937-df1c-4b65-971b-f83812526af4@dewdrop-world.net> <87r4aws1w1.fsf@gmail.com> Reply-To: jamshark70@dewdrop-world.net Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=e89a8fb1fde68925d204ea666928 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:54737) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VdYC6-0005KX-Nz for Emacs-orgmode@gnu.org; Mon, 04 Nov 2013 23:24:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VdYC5-0004dy-Q5 for Emacs-orgmode@gnu.org; Mon, 04 Nov 2013 23:24:46 -0500 Received: from mail-oa0-x22d.google.com ([2607:f8b0:4003:c02::22d]:55822) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VdYC5-0004cl-L8 for Emacs-orgmode@gnu.org; Mon, 04 Nov 2013 23:24:45 -0500 Received: by mail-oa0-f45.google.com with SMTP id i4so8090120oah.4 for ; Mon, 04 Nov 2013 20:24:45 -0800 (PST) In-Reply-To: <87r4aws1w1.fsf@gmail.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Eric Schulte Cc: jamshark70@dewdrop-world.net, Emacs-orgmode@gnu.org --e89a8fb1fde68925d204ea666928 Content-Type: text/plain; charset=ISO-8859-1 On Nov 4, 2013 10:08 PM, "Eric Schulte" 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 --e89a8fb1fde68925d204ea666928 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

On Nov 4, 2013 10:08 PM, "Eric Schulte" <schulte.eric@gmail.com> wrote:
> Look in lisp/ob-lilypond.el. =A0Specifically (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 swi= tch "-dpreview" that should eliminate the need to run "conve= rt -trim." I'll try that first.

hjh

--e89a8fb1fde68925d204ea666928-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: James Harkins Subject: Re: Fwd: ob-lilypond: pre- and post-processing of source blocks Date: Tue, 05 Nov 2013 13:35:53 +0800 Message-ID: <4ac0f0a7-7947-4d64-837e-53898ee47f32@dewdrop-world.net> References: <0dabc937-df1c-4b65-971b-f83812526af4@dewdrop-world.net> <87r4aws1w1.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:49949) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VdZJA-0004sE-Tp for Emacs-orgmode@gnu.org; Tue, 05 Nov 2013 00:36:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VdZJ5-0007as-3I for Emacs-orgmode@gnu.org; Tue, 05 Nov 2013 00:36:08 -0500 Received: from mail-pa0-x22d.google.com ([2607:f8b0:400e:c03::22d]:60028) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VdZJ4-0007Zp-Rp for Emacs-orgmode@gnu.org; Tue, 05 Nov 2013 00:36:03 -0500 Received: by mail-pa0-f45.google.com with SMTP id kp14so8030290pab.32 for ; Mon, 04 Nov 2013 21:36:01 -0800 (PST) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Emacs-orgmode@gnu.org 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" 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=20 around > to that. > > In the meantime, I was just advised that lilypond has a command-line=20 switch > "-dpreview" that should eliminate the need to run "convert -trim." I'll=20 try > that first. I have managed to get this working, by adding this to .emacs=20 (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=20 for commandline switches. If there is one, it was not obvious at [1] which=20= one it should be. Then, this actually compiles and displays well enough: #+name: pitches #+begin_src lilypond -i :exports both :file pitches.png :prologue=20 \header{tagline=3D##f} \include "english.ly" { c' e' g' fs' a' c'' ef'' d' } #+end_src Next up: I would like ":prologue \header{tagline=3D##f}" to be buffer wide. I= =20 tried this: #+PROPERTY: header-args:lilypond :prologue \header{tagline=3D##f} .. but it didn't work at first. [5 minutes] OK, I had to refresh the buffer setup. That wasn't obvious in the=20 documentation. So it all seems to be working now. hjh [1]=20 http://orgmode.org/manual/Specific-header-arguments.html#Specific-header-argu= ments From mboxrd@z Thu Jan 1 00:00:00 1970 From: tsd@tsdye.com (Thomas S. Dye) Subject: Re: Fwd: ob-lilypond: pre- and post-processing of source blocks Date: Mon, 04 Nov 2013 20:17:17 -1000 Message-ID: References: <0dabc937-df1c-4b65-971b-f83812526af4@dewdrop-world.net> <87r4aws1w1.fsf@gmail.com> <4ac0f0a7-7947-4d64-837e-53898ee47f32@dewdrop-world.net> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:35150) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VdZxW-0002MS-Dv for Emacs-orgmode@gnu.org; Tue, 05 Nov 2013 01:17:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VdZxP-0001pt-CP for Emacs-orgmode@gnu.org; Tue, 05 Nov 2013 01:17:50 -0500 Received: from oproxy6-pub.mail.unifiedlayer.com ([67.222.54.6]:39671) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1VdZxP-0001pA-3n for Emacs-orgmode@gnu.org; Tue, 05 Nov 2013 01:17:43 -0500 In-Reply-To: <4ac0f0a7-7947-4d64-837e-53898ee47f32@dewdrop-world.net> (James Harkins's message of "Tue, 05 Nov 2013 13:35:53 +0800") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: James Harkins Cc: Emacs-orgmode@gnu.org, Eric Schulte James Harkins 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