On 12/29/12 at 10:15pm, Felix Janda wrote: > On 12/16/12 at 12:04pm, Glen Larsen wrote: > snip > > like the header are regular enough that they can be parsed easily. If only > > lilypond had, in addition to the --header switch, a switch that would exit > > after the parse phase; as you mentioned, it simply takes too long to get a > > single header value. Except in pathological cases, the parsing can be > > scripted in python easily enough. > > I just played a bit more around and found a way to get lilypond to output > header fields just after parsing by inserting some scheme code at the end of > the file. Attached is a proof-of-concept script for retrieving the composer > name (use it like "sh composer.sh file.ly").
The shell script errors if header fields are not defined or markups. Attached is an extended version which reads all headers mentioned in [1], tries to validate them and print as much useful info as possible. It's called like "sh mutopia-check.sh file.ly". Before using it you should setup the environment variable MUTOPIA_BASE (see UsefulScripts/readme.html) so that it can find the datafiles. (and you should have read the script. I could have put some evil stuff into it...) This is my first exprience with scheme. I have no idea what lilypond versions the script works with. Felix [1]: http://www.mutopiaproject.org/contribute.html
mutopia-check.sh
Description: Bourne shell script
_______________________________________________ Mutopia-discuss mailing list Mutopia-discuss@mutopiaproject.org http://lists.bcn.mythic-beasts.com/mailman/listinfo/mutopia-discuss