[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: function with markup
From: |
David Kastrup |
Subject: |
Re: function with markup |
Date: |
Fri, 24 May 2013 17:51:38 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) |
luis jure <address@hidden> writes:
> in my score i have a series of markups all with the same format, for
> example something like:
>
> \markup { \hspace #-1.6 \lower #3 \sans "1" }
> \markup { \hspace #-1.6 \lower #3 \sans "2" }
> \markup { \hspace #-1.6 \lower #3 \sans "3" }
> etc.
At top level?
> so i decided to create a function to save typing and to be consistent.
> i wrote the following expecting that it would work, but it didn't:
>
>
> \version "2.17.18"
>
> tiempo = #(define-music-function (parser location secs) (string?)
> #{ \markup { \hspace #-1.6 \lower #3 \sans #secs } #})
>
> { c''4\tiempo "1" }
A music-function is supposed to return music. You are returning a
markup instead. Try using a scheme-function instead (quite likely that
it will work with 2.17.18).
Or use define-markup-command instead.
> reading the documentation i found something that i could adapt, and i came
> up with this:
>
> \version "2.17.18"
>
> tiempo = #(define-music-function (parser location secs) (string?)
> #{ <>_\markup { \hspace #-1.6 \lower #3 \sans #secs } #})
>
> { \tiempo "1" c''4 }
> now, that *does* work, but i don't understand why it does
Because an empty chord with a markup subscript is music.
--
David Kastrup