lilypond-user
[Top][All Lists]
Advanced

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

Re: Scheme function to return pitchnames as markup/text


From: David Kastrup
Subject: Re: Scheme function to return pitchnames as markup/text
Date: Wed, 20 Nov 2019 00:43:59 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

Stephen Cummings <address@hidden> writes:

> Am I missing a basic LilyPond command/directive--something built-in
> that takes music as input and returns note names as text? Such a 
> functionality would seem to be useful in all kinds of
> annotations/quotations. I know about \displayMusic but its output only 
> goes to the console/output stream and can't be routed to markup, correct?

Hm?

musmark
= ^\tweak self-alignment-X #CENTER
  -$(define-scheme-function (music) (ly:music?)
     (with-output-to-string (lambda () (displayLilyMusic music)))) \etc

{
  c'\musmark { c' }
}

Though it's probably a bit cheeky to $\etc the scheme function
in anonymously.  But you could give a name to the define-scheme-function
call as usual.



-- 
David Kastrup



reply via email to

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