lilypond - 如何创建一个函数来自动创建标题?
问题描述
我有一些转录要做,使用 lilypond。它由几首歌曲组成,都是同一位作曲家/诗人,但可能还会有更多。我已经在每个分数中包含了一些辅助函数,但我想要一个函数来自动创建标题,我可以这样调用:
\mkheader "my song"
或类似的东西。
这将避免需要写
\header {
composer = "the composer of all the songs"
title = "my song"
}
在每一首歌里。
从两天前开始,我一直在(重新)阅读 lilypond 文档,但我无法让它工作。有任何想法吗?
解决方案
您可能需要包含文件。
目录结构:
.
├── my_include.ly
├── my_main.ly
my_include.ly
\header {
composer = "the composer of all the songs"
title = "my song"
}
my_main.ly
\version "2.20.0"
\include "my_include.ly"
melody = \relative c {
\key c \major
\time 4/4
c c c c |
}
\score {
<<
\new Staff { \melody }
>>
}
您可能希望稍后在主 lilypond 文件中添加额外信息,在这种情况下,您只需添加另一个头块 my_main.ly
\version "2.20.0"
\include "./my_include.ly"
\header {
subtitle = "my_subtitle"
subsubtitle = "my_subsubtitle"
}
melody = \relative c'' {
\key c \major
\time 4/4
c c c c |
}
\score {
<<
\new Staff { \melody }
>>
}
推荐阅读
- ios - 在没有构建应用程序的情况下运行 UITests
- java - 如何在没有子报表的情况下使用多个 ResultSet 填充报表?
- android - 无法检索用户个人资料
- angularjs - Camera Plugin 的前置摄像头在 Ionic 3 中无法正常工作
- angularjs - 在部分视图上使用 MVC 的日期范围选择器 AngularJS 问题
- python - Django CMS:在版本 3.5.2 中迁移 djangocms_table 时出现 BadMigrationError
- node.js - Webpack - NodeJS - 找不到模块:错误:无法解析“fs”
- jquery - Jquery在Office选择输入中追加
- typo3 - TYPO3 TCA 用户函数
- javascript - 在 expressjs mongoose 中发送带有页面渲染的 obj