lilypond-user
[Top][All Lists]
Advanced

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

Re: problem with substitution


From: Carl D. Sorensen
Subject: Re: problem with substitution
Date: Mon, 22 Dec 2008 10:10:14 -0700



On 12/22/08 2:30 AM, "Stefan Thomas" <address@hidden>
wrote:

> Dear Lilypond-users,
> I trie to substitute the variable "zackigschnell' with "APZ', but
> without sucess.
> What is wrong with the following snippet?

> 
> \version "2.11.60"
> \include "rhythmustest.ly"
> \new Staff { \APZ { c' d' e' f' } }

There's nothing wrong with the snippet.

The problem occurred in rhythmustest.ly.

You had the following:
zackigschnell = #(define-music-function (parser location music) (ly:music?)
#{  \makeRhythm $music "16. 32"  #})
APZ =  { \zackigschnell }

The way LilyPond substitution works, \zackigschnell needs to be followed by
a music expression.  And in your definition of APZ, there is no music
expression following \zackigschnell.  If you literally do the substitution,
you'll get

\new Staff { { \zackigschnell } {c' d' e' f' } }

and you can see that there is no music expression for \zackigschnell to
operator on.

If you literally want to just add a new name for a function, the way to do
it is with a scheme trick.

Simply add 

#(define APZ zackigschnell)

and now APZ and zackigschnell are the same thing with two different names.

I've tried it on your code, and this works.

Good luck,

Carl





reply via email to

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