bug-lilypond
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Drawing systems...ERROR: In procedure min: ERROR: Wrong type: lilyva


From: Nick Payne
Subject: Re: Drawing systems...ERROR: In procedure min: ERROR: Wrong type: lilyvartmpbh
Date: Wed, 27 Apr 2011 22:12:11 +1000
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.14) Gecko/20110223 Lightning/1.0b2 Thunderbird/3.1.8

On 26/04/11 22:26, address@hidden wrote:
On Apr 26, 2011, at 8:02 AM, Nick Payne wrote:

This code used to work for me about a year ago, but when I try to build it 
using 2.13.60, I get the weird error shown in the console log output at the 
bottom. Is this a bug or not? I'm running 2.13.60 on Ubuntu 10.04 amd64.

%===================================
\version "2.13.60"

% e.g. \spanbox #-8 #'(-1 . -1)
spanbox = #(define-music-function (parser location yval shorten) (number? 
pair?) #{
    \once \override TextSpanner #'style = #'line
    \once \override TextSpanner #'bound-details #'left #'text = \markup { 
\draw-line #'(0 . $yval) }
    \once \override TextSpanner #'bound-details #'right #'text = \markup { 
\draw-line #'(0 . $yval) }
    \once \override TextSpanner #'bound-details #'left #'padding = #(car 
$shorten)
    \once \override TextSpanner #'bound-details #'right #'padding = #(cdr 
$shorten)
#})

\relative c' {
    \spanbox #-8 #'(-1 . -1) c4\startTextSpan c c c\stopTextSpan
}
%===================================

Processing `/home/nick/lilypond/examples/box.ly'
Parsing...
Interpreting music...
Preprocessing graphical objects...
Finding the ideal number of pages...
Fitting music on 1 page...
Drawing systems...ERROR: In procedure min:
ERROR: Wrong type: lilyvartmpbh

This should do the trick - the problem is that you need to quasiquote the list 
and then unquote the temp variable that lilypond uses to store yval.

spanbox = #(define-music-function (parser location yval shorten) (number? 
pair?) #{
    \once \override TextSpanner #'style = #'line
    \once \override TextSpanner #'bound-details #'left #'text = \markup { 
\draw-line #`(0 . ,$yval) }
    \once \override TextSpanner #'bound-details #'right #'text = \markup { 
\draw-line #`(0 . ,$yval) }
    \once \override TextSpanner #'bound-details #'left #'padding = #(car 
$shorten)
    \once \override TextSpanner #'bound-details #'right #'padding = #(cdr 
$shorten)
#})

\relative c' {
    \spanbox #-8 #'(-1 . -1) c4\startTextSpan c c c\stopTextSpan
}

Thanks. That fixes it. After experimenting a bit more with the two different single quotes (` and ') in different set and override expressions, it seems that in some situations, only ` is acceptable, in some only ' is acceptable, and in some situations either ` or ' are both valid. this seems a bad situation to have so far as making it easy to write valid lilypond source code.

Nick



reply via email to

[Prev in Thread] Current Thread [Next in Thread]