lilypond-user
[Top][All Lists]
Advanced

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

Re: string_identifier into string? Was: Creating arbitrary lines (or oth


From: Neil Puttock
Subject: Re: string_identifier into string? Was: Creating arbitrary lines (or other postscript things)
Date: Tue, 16 Nov 2010 21:28:16 +0000

On 16 November 2010 04:34, Andrew C. Smith
<address@hidden> wrote:

> As far as I can see, this is just a normal text-replacement function. I 
> googled around though, and can't find much related to string_identifier aside 
> from a printout of the entire bison grammar specification for Lilypond, which 
> wasn't too helpful. How do I turn a string_identifier into a string?

This is a string identifier:

foo = #"bar"

The \change command expects bare strings for arguments, so the following,

\change Staff = \foo

isn't allowed.

You'll have to use the internal scheme representation of \change to
pass arbitrary strings as the context id:

\displayMusic \change Staff = sTwo

->

 (make-music
  'ContextChange
  'change-to-id
  "sTwo"
  'change-to-type
  'Staff)

follower =
#(define-music-function (parser location switch) (string?)
  (make-sequential-music
   (list
    #{
       \once \override VoiceFollower #'style = #'dashed-line
    #}
    (make-music
     'ContextChange
     'change-to-id switch
     'change-to-type 'Staff))))

Cheers,
Neil



reply via email to

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