Logo

Zim Wiki 中文文档

ZimWiki中文使用和操作说明

乐谱编辑器

乐谱编辑器是一个简单的对话框,允许您使用GNU Lilypond将乐谱插入到页面中。

为了能够使用此插件,您必须安装GNU Lilypond,并且以下命令必须在您的系统上可用:"lilypond"和"convert-ly"(为什么?)。您可以使用特殊模板"_Score.ly"控制乐谱的外观。

依赖项: 此插件需要安装GNU Lilypond。具体来说,系统路径中应该有"lilypond"和"convert-ly"命令。

语法

有关GNU Lilypond语法的信息,请参阅参考部分。

以下是由插件生成的几个示例:

示例1:帕赫贝尔的卡农

score.png

\relative c {
        \clef bass
        \key d \major
        \time 4/4

        d4 a b fis
        g4 d g a
}

示例2:带和弦、谱表和歌词

score001.png

<<
    \chords {
        c1:m7 f2:7 c2
    }
    \relative c'' {
        g2 es8( c4) es8
        f8 es d c~ c2
    }
    \addlyrics {
        You are
        the sky and my rain,
    }
>>

示例3:带多个谱表

score002.png

hornNotes =
  \relative c {
    \time 2/4
    R2*3
    r4 f8 a cis4 f e d
  }

bassoonNotes =
  \relative c {
    \clef bass
    r4 d,8 f gis4 g b bes
    a8 e f4 g d gis f
  }


<<
  \new Staff \hornNotes
  \new Staff \bassoonNotes
>>

示例4:带扫弦节奏和指板

score003.png

<<
  \new ChordNames {
    \chordmode {
      c1 | f | g | c
    }
  }
  \new FretBoards {
    \chordmode {
      c1 | f | g | c
    }
  }
  \new Voice \with {
    \consists "Pitch_squash_engraver"
  } {
    \relative c'' {
      \improvisationOn
      c4 c8 c c4 c8 c
      f4 f8 f f4 f8 f
      g4 g8 g g4 g8 g
      c4 c8 c c4 c8 c
    }
  }
  \new Voice = "melody" {
    \relative c'' {
      c2 e4 e4
      f2. r4
      g2. a4
      e4 c2.
    }
  }
  \new Lyrics {
    \lyricsto "melody" {
      This is my song.
      I like to sing.
    }
  }
>>

模板

乐谱插件的模板有以下三个变量,用于自定义您的GNU Lilypond文档,用于生成乐谱图像:

  • include_header: 通用包含头部部分,用于包含GNU Lilypond预定义文件或添加通用定义。
  • include_footer: 通用包含页脚部分,用于定义要包含在GNU Lilypond文档中的标准页脚部分。
  • score: 插入/编辑对话框中的实际用户输入。

请随意根据您的需要调整模板文件。

GNU Lilypond版本

GNU Lilypond的语法可能随新版本而改变,这些改变不一定向后兼容。因此,创建乐谱时的GNU Lilypond版本由插件插入到乐谱文本中。

当安装了不同版本的GNU Lilypond时,插件将使用convert-ly(与GNU Lilypond一起打包)在渲染乐谱之前将乐谱文件转换为与安装版本兼容。

参考资料