I have a monstrous music-function that constructs a markup in Scheme and
then decides whether to put it at system-level or staff-level, along the
following lines (much-redacted):
foo = #(define-music-function (args...) (types...)
(let* ((markupContents #{
\markup {
\concat {
#markupOne
#markupTwo
}}
#})
(case whereMarkup
((system) #{ \mark #markupContents #})
((staff) #{ <>^ #markupContents #})
(else #{ \mark \markup \color #red #markupContents #})
))
)
The problem is: how best to deal with the case where #markone and
#markuptwo are both empty, i.e. #{ \markup "" #}, and no markup at all
should be attempted?
I've tried variations on:
( if ( string=? ( markup->string markupContents )
( markup->string empty-markup ))
(#{ <> #})
(case whereMarkup ...
but my grasp of Scheme, never very firm, is slipping away.
Grateful for any suggestions, pointers to documentation/tutorials, etc.
-- Graham
_______________________________________________
lilypond-user mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/lilypond-user