lilypond-user
[Top][All Lists]
Advanced

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

Re: Scheme Problem


From: Mats Bengtsson
Subject: Re: Scheme Problem
Date: Mon, 01 Jan 2007 17:03:32 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20060926 Debian/1.7.8-1sarge7.3.1

The reason that
#{
...
\repeat unfold $beats { r4 }
...
#}

doesn't work is the same that the following doesn't work in an
ordinary .ly file:

numberOfRepeats = 3

...
\repeat unfold \numberOfRepeats {...}
...


In other words, the argument of \repeat cannot be specified
using a variable in the current implementation of LilyPond.


  /Mats



ian_hulin wrote:

Hi Brett,
Just a thought - the normal syntax for \repeat is
\repeat unfold 9 { <music statements> }

in your declaration you've put the keyword in quotes.  Does it help if you
remove them? E.g.
--------------------------------------------
compFor = #(define-music-function (parser location beats) (number?)
       #{
\override Rest #'stencil = #ly:percent-repeat-item-interface::beat-slash
           \override Rest #'thickness = #'0.48
           \override Rest #'slope = #'1.7
\repeat unfold $beats { r4 } \revert Rest #'stencil
       #})
--------------------------------------------
I don't know any of the Lilypond or Scheme internals but there's a chance
that this could be confusing a parser or lexical analyzer somewhere along
the line.  Software diagnostic messages are sometimes just an opener for
negotiation...

Cheers,
Ian


Brett Duncan-2 wrote:
The following function is an attempt on my part to learn how to create such functions, based on what appears in the User Manual. The function itself is not really important, just a problem I set for myself. It's supposed to take a number as its argument and produce the equivalent number of slashes, the idea being to use the slash as a comping symbol, and substituting the slash for the normal appearance of a quarter rest.

--------------------------------------------
compFor = #(define-music-function (parser location beats) (number?)
       #{
\override Rest #'stencil = #ly:percent-repeat-item-interface::beat-slash
           \override Rest #'thickness = #'0.48
           \override Rest #'slope = #'1.7
\repeat "unfold" $beats { r4 } \revert Rest #'stencil
       #})
--------------------------------------------

But when I put

   \compFor #16

into my .ly file, the following error occurs:

syntax error, unexpected NUMBER_IDENTIFIER, expecting DIGIT or UNSIGNED
           \repeat "unfold"
                                        \lilyvartmpb { r4 }


Can someone point out to me where I'm going wrong?

Thanks,

Brett

--
Brett Duncan
address@hidden

"Always do right - this will gratify some and astonish the rest."

Mark Twain


_______________________________________________
lilypond-user mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/lilypond-user





--
=============================================
        Mats Bengtsson
        Signal Processing
        Signals, Sensors and Systems
        Royal Institute of Technology
        SE-100 44  STOCKHOLM
        Sweden
        Phone: (+46) 8 790 8463                         
       Fax:   (+46) 8 790 7260
        Email: address@hidden
        WWW: http://www.s3.kth.se/~mabe
=============================================





reply via email to

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