[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Help, simple music function not compiling
From: |
Xavier Scheuer |
Subject: |
Re: Help, simple music function not compiling |
Date: |
Sun, 30 Jan 2011 00:11:32 +0100 |
On 29 January 2011 23:23, Eric Dedieu <address@hidden> wrote:
>
> Hi lilypond helpers,
>
> Here is a small program that does not compile:
>
> -----------------------------------
> \version "2.12.3"
>
> %% the function that will fail
> tempoMarkEqual =
> #(define-music-function (parser location before after)
> (string? string?)
> #{
> \mark \markup \tiny { \note $before #1 = \note $after #1 }
> #} )
>
> %% example begins here
> {
> \time 2/4
> re'2
> |
> %% this works well
> \mark \markup \tiny {\note #"8" #1 = \note #"8" #1 }
> re'2
> |
> %% this is an attempt to get the same result with a function
> \tempoMarkEqual #"8" #"8"
> re'2
> }
> ------------------------------
>
> The first \mark command works well, but the function fails with:
>
> <string>:2:30: Error : syntax error, unexpected STRING_IDENTIFIER,
> expecting SCM_IDENTIFIER or SCM_TOKEN
> \mark \markup \tiny { \note
> \lilyvartmpb #1 = \note \lilyvartmpc #1 }
>
> What did I miss ?
Use
tempoMarkEqual =
#(define-music-function (parser location before after)
(string? string?)
#{
\mark \markup \tiny { \note #$before #1 = \note #$after #1 }
#} )
with a '#' before "$before" and "$after", it works.
Par contre pour les explications je passe la main...
Cordialement,
Xavier
--
Xavier Scheuer <address@hidden>