lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Programming question


From: David Nalesnik
Subject: Re: Programming question
Date: Tue, 25 Nov 2014 18:41:39 -0600



On Tue, Nov 25, 2014 at 8:49 AM, Jay Vara <address@hidden> wrote:
Trying to force the lyric in David's program to associate with the Staff/Voice, I added a name "jun" to the voice and see if that worked.
 
 [...]

In this case, the lyrics, that is the pitch numbers, did not show up at all! Wonder why?

I think it's because \music gets interpreted and forces the creation of a new higher-level context, but I'm pretty fuzzy here.

I wonder if there's a way to parse \music without any side effects.  I see various Scheme functions relating to the parser, but I'm pretty unfamiliar with this area.   Would ly:parser-clone get us somewhere?

Anyway, here's an interesting experiment.

First, I created a text file "display.txt" with the Scheme _expression_ for \music.  I did this by running the file "out.ly".

I then added a # in front of the _expression_ in the text file.  Unsure of how to automate that.

Next, I included the contents of the text file in the main file ("another.ly") like so:

\new Staff
<<
  \new Voice = "jun" \music
  \noteNameToLyric \extractPitches \include "display.txt"
>>

And, like magic, it works!

--David


 

Attachment: display.txt
Description: Text document

Attachment: another.ly
Description: Text Data

Attachment: out.ly
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]