|
From: | Michael Ellis |
Subject: | Re: Mixing notation and lyric entry |
Date: | Wed, 15 Dec 2010 17:09:29 -0500 |
from mixlyrics import *## --------------------------------------## Enter lyrics and notation here. Begin## lyric lines with @@soply = """@@ Twink- le, twink- le lit- le star.do4 do sol' sol |la la sol2 |@@ How I won- der what you are.fa4 fa mi mi |re re do2 \\bar "|.""""## ---------------------------------------sml = MixLyrics()sml.parse(soply)soplyrics = sml.emitlyrics()sopmelody = sml.emitmelody()## Finally, process the Lilypond coderunlily(template()%locals())
import sysfrom os.path import basename, splitext, join as pjoinfrom subprocess import Popenclass MixLyrics (object):""" Class for interleaving lyrics and notation """def __init__(self, delim="@@"):self.lyrics = []self.melody = []self.delim = delimdef parse(self,s):for line in s.split('\n'):line=line.strip()if line.startswith(self.delim):self.lyrics.append(line[len(self.delim):])else:self.melody.append(line)def emitlyrics(self):return " ".join(self.lyrics)def emitmelody(self):return " ".join(self.melody)def template():return """\include "english-solfa.ly" %% english.ly modified to include solfa syllables\score {<<\\new Voice = "Sop" {\\autoBeamOn\\relative do' { %(sopmelody)s }}\\new Lyrics \lyricsto "Sop" { %(soplyrics)s }>>}"""def runlily(lymusic, lilyscript="lily"):"""Write and process an .ly file with the samename as this script.Args:'lymusic' is the lilypond code to process'lilyscript' is the name of your scriptthat processes .ly files."""pyname = basename(sys.argv[0])lyname = pjoin(splitext(pyname)[0] + '.ly')print >>file(lyname,'w'), lymusiccmd = "%(lilyscript)s %(lyname)s"%locals()p = Popen(cmd, shell=True)p.wait()
python template_example.py
imo it is a question of synchronising & visualising the input of 2 ore more
Michael Ellis wrote:
>
> Is there a clean way to enter a phrase followed by the corresponding notes
> in a \relative block? The example given in the docs,
>
> {
> \time 3/4
> \relative c' { c2 e4 g2. }
> \addlyrics { play the game }
> }
>
> is fine for a small example, but it gets messy for longer music. I
> do a lot of transcribing choral parts out of printed scores and would
> like to be able to keep the lyrics together with the music in chunks
> of a few bars, e.g. something like
>
> themusic = \relative do {
>
> <snip>
>
> \withlyrics { Stir- ring be- yond your watch- ful eye. } {
> do2 do4 do |
> do4 re do la |
> \time 3/4 re2. |
> }
>
>
> \withlyrics { Though they may not flow- er, flow- er, } {
> \time 2/4 sol,4 do |
> \time 2/2 fa,2 mi2 |
> re4( mi) fa( la) |
> \time 3/4 te2 la4 |
>
> }
>
> <snip>
>
> }
>
> I'm finding that I make fewer errors and can fix the ones I do make
> faster if the lyrics are close to the notation. As it is now, I have
> to re-enter (cut, paste & edit) the lyrics in a separate \lyricmode
> block. Any suggestions for how to write the \withLyrics function? Or
> is there an existing clean solution I haven't found yet?
>
> Thanks,
> Mike
>
>
"voices" (in a general way)
one way is to put both in a table, the first row being the melody, the
second row the lyrics. then you can c&p each to the corresponding ly-file.
if you are not happy with spreadsheet tools you can do the same with an
editor allowing to edit two synchronized files (in vertical scrolling); that
way you could have the melody in the left and the lyric text in the right
window (which are both included somewhere in your main score).
(of course you can also use one line per measure)
hope these ideas are helpful!
Eluze
--
View this message in context: http://old.nabble.com/Mixing-notation-and-lyric-entry-tp30458087p30467715.html
Sent from the Gnu - Lilypond - User mailing list archive at Nabble.com.
_______________________________________________
lilypond-user mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/lilypond-user
twinkle.png
Description: PNG image
mixlyrics.py
Description: Binary data
mixlyrics.py
Description: Binary data
[Prev in Thread] | Current Thread | [Next in Thread] |