【发布时间】:2014-01-18 10:20:22
【问题描述】:
我编写了一本大歌集,为此我希望有许多函数的本地定义,最终将在\include d 文件中,但这在这里没有区别。为此,我需要在\score{ ... } 范围内定义函数。但是,LilyPond 不断抛出错误。
无效的例子:
\version "2.17.26"
\book {
\header {
title = "This is a book"
}
\score {
xyz = { a' b' c'' }
abc = #(define-music-function
( parser location musicnotes )
( ly:music? )
#{
c' $musicnotes e'
#}
)
{ \abc { d' } f' \xyz }
\header {
piece = "First piece"
opus = "op. 1024"
}
}
\score {
xyz = { a' a' a' }
abc = #(define-music-function
( parser location musicnotes )
( ly:music? )
#{
e' $musicnotes c'
#}
)
{ \abc { d' } f' \xyz }
\header {
piece = "Second piece"
opus = "op. 1025"
}
}
}
抛出错误:
test.ly:10:17: error: unrecognized string, not in text script or \lyricmode xyz = { a' b' c'' }
以下的作品,然而,我必须给函数唯一的名字,这是不赞成的。
\version "2.17.26"
xyz = { a' b' c'' }
abc = #(define-music-function
( parser location musicnotes )
( ly:music? )
#{
c' $musicnotes e'
#}
)
xxyz = { a' a' a' }
aabc = #(define-music-function
( parser location musicnotes )
( ly:music? )
#{
e' $musicnotes c'
#}
)
\book {
\header {
title = "This is a book"
}
\score {
{ \abc { d' } f' \xyz }
\header {
piece = "First piece"
opus = "op. 1024"
}
}
\score {
{ \aabc { d' } f' \xxyz }
\header {
piece = "Second piece"
opus = "op. 1025"
}
}
}
【问题讨论】:
标签: scope lisp user-defined-functions lilypond