On Sat, Sep 24, 2011 at 4:28 PM, Graham Percival <gra...@percival-music.ca> wrote: > On Sat, Sep 24, 2011 at 01:30:55PM -0400, Michael Ellis wrote: >> Note: what I'm actually trying to do with the preprocessing, as >> opposed to the trivial example above, is something that cannot be >> done easily with a music function. I know about the --evaluate >> command line option but that's also not practical for what I'm trying >> to do. > > Does the preprocessing require scheme? If you're just using sed > or m4 or python, I'd do this: > # mylily.sh > cp $1 /tmp > sed '...' /tmp/$1 > /tmp/$1-processed.ly > lilypond /tmp/$1-processed.ly > mv /tmp/$1-processed.ly . > Thanks Graham, I did consider wrapping the pre-processing and LilyPond in shell script as you've described. Here's the long explanation of what I'm trying to do and why I've hesitated to use a wrapper script.
I frequently use a program called Transcribe! when I want to transcribe jazz solos or songs with no sheet music available. Transcribe! has a very nice interface that takes a lot of the pain out of the job. It's really easy to lay down measure markers for the audio and then use keyboard to short cuts to move measure by measure through piece with the ability to loop and slow down. You can also type arbitrary text into entry areas associated with each measure and have Transcribe spit the all the texts out to a single file. So I thought, aha! LilyPond, and now I have a template that \include's the output from Transcribe! Works well for purely instrumental transcription, less so if I have to include lyrics. I've described my "accumulator" music functions that let me enter lyrics and notation on alternating lines in other posts so I won't go into that here except to say that the invocation is a bit lengthy -- as is this explanation, I'm afraid. I normally do my LilyPond work with LilyPondTool and have grown quite accustomed to its conveniences. Using a wrapper script would mean having to alter my LilyPondTool options to specify the wrapper script instead of invoking LilyPond directly -- but I often use LilyPond for tasks other than audio transcriptions and don't want to have to keep changing my LilyPondTool options. I was hoping to set things up so I can enter some short hand for the lengthier items in Transcribe!, send its output to an include file, and use LilyPondTool to check my progress from time to time. That means invoking some preprocessing on the included file to expand my shorthand into valid ly expressions. These include invoking \lyricmode which doesn't seem to be practical in a music function unless I crawl out on the bleeding edge of the most recent 2.15.x builds. So anyway, what I'd really like to see is a way to do simple text substitution in LilyPond input before parsing begins. It's more than a little frustrating to know that scheme with all its awesome text munging capabilities is there but not usable for such very simple tasks. In the meantime, I'd settle for the ability to run shell commands on a file and be able to include the output during parsing. As I said in the first post, what I've got so far actually works. I can live with it as is but it would be nice not to have to remember to run it twice each time I want to see my progress. Failing that, it would be nice to hear an expert explanation of why that's not possible. Cheers, Mike _______________________________________________ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user