[Top][All Lists]

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

Re: Invisible notes, Scheme contexts

From: Don Blaheta
Subject: Re: Invisible notes, Scheme contexts
Date: Tue, 13 Dec 2005 22:49:51 -0600
User-agent: Mutt/

Quoth I:
> I've also been having trouble typing in such an id literally; if I
> define a music function like 
>   foo = #(def-music-function (parser location str) (string?)
>           #{ \context Voice = $str { \override NoteHead #'font-size = #3 } 
>           #})
> and then include in my code
>   \foo "blah"
> I get an error [...]

And I got two responses:

Quoth Han-Wen Nienhuys:
> \foo #"bla"

Quoth Erik Sandberg:
> Try 
> \foo #"blah"

But these don't work, they just change the error message, which is now:
  <string>:1:40: error: syntax error, unexpected STRING_IDENTIFIER, expecting 
  parseStringResult = {  \context Voice = 
                                          \lilyvartmpc { \override NoteHead 
#(quote font-size) = #3 } 
  error: errors found, ignoring music expression

What I really want is just to be able to include inside a #{ #}
something that looks like
  \context Voice = ______
and have the ____ be something that's not just a literal like "foo".  I
think that means it has to be a variable like $str, but I'm having
problems getting a value for str that will satisfy the compiler.

Erik also said:
> If you are a guru, you may want to look at \applycontext. Normally, scheme 
> functions are called before the music is interpreted, but with \applycontext, 
> functions can be called during iteration. Remember that contexts only exist 
> during iteration.

I'll look at this, but it sounds like it's not going to address my
underlying misunderstanding, which may just be that I don't know how to
convert from a Schemish STRING_IDENTIFIER to a Lilypond LYRIC_STRING or

-=-Don address@hidden<>-=-
IRS: We've got what it takes to take what you've got.

reply via email to

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