Caio,
You almost have it. Just add a hyphen - immediately before \markup inside
the function and when you call the function in the music with \circled (or
using an underscore _ or carat ^ if a specific direction is needed) and it
should work in both versions (2.18.2 and 2.19.23):
circled = #(define-music-function (parser location txt) (string?)
#{ -\markup { \circle #txt } #})
\relative c' { c-\circled #"1" c_\circled #"dn" c^\circled #"up"}
- Abraham
On Mon, Jul 20, 2015 at 3:12 PM, Caio Barros [via Lilypond] <
ml-node+s1069038n178878...@n5.nabble.com> wrote:
> 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
> <http://1>: Unbound variable: value->lily-string
>
>
> 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" }
>
>
> What am I doing wrong?
> Caio G. de Barros
>
>
> _______________________________________________
> lilypond-user mailing list
> [hidden email] <http:///user/SendEmail.jtp?type=node&node=178878&i=0>
> https://lists.gnu.org/mailman/listinfo/lilypond-user
>
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://lilypond.1069038.n5.nabble.com/Defining-a-markup-text-using-Scheme-tp178878.html
> To start a new topic under User, email ml-node+s1069038n...@n5.nabble.com
> To unsubscribe from Lilypond, click here
> <http://lilypond.1069038.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=2&code=dGlzaW1zdC5saWx5cG9uZEBnbWFpbC5jb218Mnw4MzU3Njg3MDU=>
> .
> NAML
> <http://lilypond.1069038.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>
--
View this message in context:
http://lilypond.1069038.n5.nabble.com/Defining-a-markup-text-using-Scheme-tp178878p178879.html
Sent from the User mailing list archive at Nabble.com.
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user