Re: Invisible notes, Scheme contexts

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: Invisible notes, Scheme contexts

Don Blaheta
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 LYRICS_STRING or STRING
  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
STRING.

--
-=-Don Blaheta-=-=-[hidden email]-=-=-=-<http://www.blahedo.org/>-=-
IRS: We've got what it takes to take what you've got.


_______________________________________________
lilypond-devel mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: Invisible notes, Scheme contexts

Don Blaheta
Quoth Don Blaheta:
> 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
> STRING.

And relatedly: how to convert from a Schemish NUMBER_IDENTIFIER to a
Lilypond DIGIT or UNSIGNED or FRACTION.

--
-=-Don Blaheta-=-=-[hidden email]-=-=-=-<http://www.blahedo.org/>-=-
The man who sets out to carry a cat by its tail learns something that
will always be useful and which never will grow dim or doubtful.
                                                        --Mark Twain


_______________________________________________
lilypond-devel mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-devel