[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Defining a markup text using Scheme
From: |
David Kastrup |
Subject: |
Re: Defining a markup text using Scheme |
Date: |
Tue, 21 Jul 2015 02:02:00 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) |
Caio Giovaneti de Barros <address@hidden> writes:
> Hello!
>
> I'm trying to build a function that creates a circled text of my
> choice using \markup and a bit of Scheme. So far what I have is:
>
> circled = #(define-music-function (parser location txt) (string?)
>
> #{ \markup { \circle #txt } #})
>
>
> \relative c' { c \circled #"1" }
>
>
>
> But when I run it with Lilypond 2.19.23 I get:
>
>
> In expression (value->lily-string m):
>
> /home/caio/lilypond/usr/share/lilypond/current/scm/ly-syntax-constructors.scm:33:14
> <1>: Unbound variable: value->lily-string
That is a bug. LilyPond hits an internal error while trying to report
gogr.ly:6:18: error: music function cannot return \markup \line { \circle "1"}
\relative c' { c
\circled #"1" }
> Version 2.18.2 gives me:
>
> music function cannot return (#<procedure line-markup (layout props
> args)> ((#<procedure circle-markup (layout props arg)> 1)))
>
> \relative c' { c
> \circled #"1" }
Same error, just not formatted as nice.
> What am I doing wrong?
A music function has to return music. You return a markup. You
probably want an event function here, and return #{ -\markup ... #}
(with the leading -, the markup turns into a text script). You could
also just use the markup command and write
\relative c' { c-\markup \circle #"1" }
but apparently that's not what you want.
--
David Kastrup