From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/80361 Path: news.gmane.org!not-for-mail From: Aditya Mahajan Newsgroups: gmane.comp.tex.context Subject: Re: t-filter for LilyPond enhancements Date: Sun, 20 Jan 2013 15:19:24 -0500 (EST) Message-ID: References: <4707DFCF-783C-439F-B3F0-F80D74943C3F@fiee.net> <48E85065-3C8A-4E01-8E02-E946A24321D9@fiee.net> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="8323328-1868326306-1358713165=:13787" X-Trace: ger.gmane.org 1358713176 2714 80.91.229.3 (20 Jan 2013 20:19:36 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 20 Jan 2013 20:19:36 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Sun Jan 20 21:19:55 2013 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Tx1Mt-00005n-Me for gctc-ntg-context-518@m.gmane.org; Sun, 20 Jan 2013 21:19:51 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 8B3D0101E2; Sun, 20 Jan 2013 21:19:34 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id xKzfkrs3ieDu; Sun, 20 Jan 2013 21:19:32 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id 23D2F101E5; Sun, 20 Jan 2013 21:19:32 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 721A4101E5 for ; Sun, 20 Jan 2013 21:19:30 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id DFV9x8gZ6Zx7 for ; Sun, 20 Jan 2013 21:19:29 +0100 (CET) Original-Received: from filter1-ams.mf.surf.net (filter1-ams.mf.surf.net [192.87.102.69]) by balder.ntg.nl (Postfix) with ESMTP id 19A68101E2 for ; Sun, 20 Jan 2013 21:19:28 +0100 (CET) Original-Received: from hackers.mr.itd.umich.edu (smtp.mail.umich.edu [141.211.14.81]) by filter1-ams.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id r0KKJQSZ018939 for ; Sun, 20 Jan 2013 21:19:27 +0100 Original-Received: FROM Decentralized.ECE.McGill.CA (Decentralized.ECE.McGill.CA [132.206.69.142]) By hackers.mr.itd.umich.edu ID 50FC514D.A59F5.17861 ; Authuser adityam; 20 Jan 2013 15:19:25 EST In-Reply-To: <48E85065-3C8A-4E01-8E02-E946A24321D9@fiee.net> User-Agent: Alpine 2.02 (LNX 1266 2009-07-14) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=141.211.14.81; country=US; region=MI; city=Ann Arbor; postalcode=48109; latitude=42.2923; longitude=-83.7145; metrocode=505; areacode=734; http://maps.google.com/maps?q=42.2923,-83.7145&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0NIOkjrlc - 3bd7b557fde3 - 20130120 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) on 192.87.102.69 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.14 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:80361 Archived-At: This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323328-1868326306-1358713165=:13787 Content-Type: TEXT/PLAIN; charset=windows-1252; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE On Sun, 20 Jan 2013, Henning Hraban Ramm wrote: > Am 2013-01-20 um 17:57 schrieb Aditya Mahajan: > >>> Now, I'd like my lilypond sections/buffers to have different names than= just numbers; I'd prefer some unique IDs or even manually set names to be = able to re-order them without the need of re-compiling. >>> I.e. if I change the order of songs in my songbook, all LilyPond snippe= ts must get recalculated, even if they didn=92t change. >> >> Does >> >> \startlilypond[name=3Done] >> .... >> \stoplilypond >> >> what you are looking for? (see the docs for how this behaves behind the = scenes) > > Oh, so simple? Great, that=92s exactly what I meant. Since I would normal= ly set [name=3D\currentcomponent], can I make that default? Unfortunately no. The name key is reset at every `\startexternalfilter`;=20 otherwise it will be difficult to mix `name=3D....` with normal usage. >>> There are some more enhancements that I=92d like to implement, e.g. che= cking the resulting files if there are several pages or using single noteli= nes to let ConTeXt do the page breaking (like lilypond-book does with LaTeX= ). I guess that would be as simple as replacing my \readPDFfile with some L= ua code - can you give me a hint how to do that? >> >> See grph-inc.*. I'll post an example later on how to handle single page = and multipage pdfs differently. > > Thanks, handling of multipage PDFs might help, but I=92d try a different= =20 > approach: LilyPond can generate EPS/PDF for single note systems and=20 > writes the number of them into a simple text file. I=92d parse that with= =20 > Lua and place all those small PDFs. I just need a clue how I must define= =20 > t-filter=92s "readcommand" as a Lua function. Something like this: \def\ParseLilypondFile#1% % #1 is the name of the output file {\ctxlua{thirddata.parselilypondfile("#1")} \startluacode thirddata =3D thirddata or {} function thirddata.parselilypondfile(name) --- parse "name" file as you wish and --- generate approapriate context(...) commands --- to write back to ConTeXt end \stopluacode \defineexternalfilter[lilypond] [ ..... readcommand=3D\ParseLilypondFile, .... ] Aditya --8323328-1868326306-1358713165=:13787 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________ --8323328-1868326306-1358713165=:13787--