找不到声音

时间:2018-02-28 23:34:07

标签: lilypond

我的代码编译,但有错误;它说:

warning: cannot find Voice `chorus'
chorusLyrics = \new Lyrics 
                           \lyricsto "chorus" {

所以我将整个代码最小化到这个:

\version "2.19.44"
\language "english"

\header {
    title = "debug"
}

signature = {
    \time 4/4  
    \key c \minor
    \autoBeamOff
}

chorus = \new Voice = "chorus" \relative c'' {
    \signature
    << { g f e f } \\ {e b e c } >> 
}

chorusLyrics = \new Lyrics \lyricsto "chorus" {
  This is de- bug
}

\score {
        <<
      \new Staff {  \chorus }
      \chorusLyrics
        >>
}

lilypond版本是正确的。

输出不显示歌词;我花了好几个小时试图解决这个问题。文档说你可以用这种方式使用多种语音。我做错了什么?

以下是Learning.pdf文档的引用:

Here’s how we split the chords above into two voices and add both the
passing note and a slur: \key g \major % Voice "1" Voice "2" << { g4
fis8( g) a4 g } \\ { d4 d d d } >>

但是,如果我从大括号中删除\\,那么所有内容都会编译而没有任何问题 - 根本没有错误。

1 个答案:

答案 0 :(得分:0)

您的示例中存在两个问题。 首先,您试图将歌词与复音段落相关联,据我所知,这是不可能的。 其次,结构不正确,请参阅下面的编译精确的示例。

\version "2.19.44"
\language "english"

\header {
  title = "debug"
}

signature = {
  \time 4/4
  \key c \minor
  \autoBeamOff
}

upper = \relative c'' {
  \signature
  g4 f e f
}

lower = \relative c' {
  \signature
  e4 b e c
}


chorusLyrics = \lyricmode {
  This is de- bug
}

\score {
  <<
    \new Staff <<
    \new Voice = "chorus" { \voiceOne \upper }
    \new Voice { \voiceTwo \lower }
    >>
  \new Lyrics \lyricsto "chorus" { \chorusLyrics }
  >>
}