Yay! That works. Not sure why the other way did not work.

I tried various ways of getting it to output to a string instead of to a
file, something like:

#(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 Wed, Nov 26, 2014 at 12:41 AM, David Nalesnik <david.nales...@gmail.com>
wrote:

>
>
> On Tue, Nov 25, 2014 at 8:49 AM, Jay Vara <j...@diljun.com> 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
>
>
>
>
>
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to