|
From: | Jay Vara |
Subject: | Re: Programming question |
Date: | Wed, 26 Nov 2014 10:10:37 +0000 |
#(set! (jv (with-output-to-string
(lambda () #{ \displayMusic \music #}))))
so that we could add the # to the string jv. No luck here as I could not get past the syntax / non-music _expression_ issues.
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
[Prev in Thread] | Current Thread | [Next in Thread] |