Hi Michael,Took me a day longer than I thought to get around to this. Here are the main scripts I'm currently using. They are heavily tailored toward the ways I use LilyPond, namely transcribing songs and choral parts in movable do solfege and constructing violin exercises in 12 keys.
The files included are:
mixlyrics.py -- defines the MixLyrics class that knows how to parse out lines beginning with '@@' as lyrics lines beginning with '@H' as chord names.
songtemplate.py -- The all-purpose template I use for anything that has one voice with (optionally) lyrics and/or chord symbols. When I want to transcribe something, I open an empty .py file in vim and read this template in. There are two variables that take triple-quoted strings containing LilyPond notation. One is named 'header' and contains title, composer, etc. The other is named 'songly'. This is where you enter the music, e.g.
\tempo "Moderato" 4 = 105
\set midiInstrument = #"violin"
\key do \major %% Needed, don't change
@@ A -- las, my love you do me wrong to
address@hidden r4 la2.:min do2. sol2. mi2.:min
@@ cast me out dis -- cour -- teous -- ly.
address@hidden la2.:min fa2. mi2. mi2
There are also two list variables, 'keys' and 'octaves' than control how many which keys and octaves are output.
lily -- the shell script that ultimately gets called to process the lilypond file created by song template.py. You may need to alter this to match your lilypond installation.
songtemplate.pdf -- what you should get from running "python songtemplate.py" if everything is installed correctly.
Even if these aren't useful as is, they may give you some ideas for using python to automate your own tasks.
Cheers,
Mike
On Sat, Dec 18, 2010 at 10:25 PM, Michael Ellis
<address@hidden> wrote:
Sure. I'll send them out tomorrow afternoon. Need to clean them up a bit.
Cheers,
Mike