- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
目前我写lilypond代码如下:
\version "2.14.2"
P = #parenthesize
\relative c, {
\clef bass
<c \P c'> <e \P e'> <g \P g'>2 <c, \P c'>4 <d \P d'> <e \P e'>2
}
其中我反复表示“这个音符,以及高一个 Octave 的同一音符,带括号”。
我想要一种缩写的方法,这样我就可以写出这样的东西:
\version "2.14.2"
poct = ...
\relative c, {
\clef bass
\poct c \poct e \poct g2 \poct c,4 \poct d \poct e2
}
按照 a helpful answer to an earlier question of mine 中的建议,我尝试使用a music function ,但我无法让它发挥作用。我能得到的最接近的是
poct = #(define-music-function
(parser location note)
(ly:music?)
#{
<< $note \transpose c c \parenthesize $note >>
#})
但这使用 <<
..>>
而不是<
..>
,它没有按照我想要的方式呈现(并带有警告),我不知道为什么 \transpose c c
实际上转置任何东西。
最后,切线相关的是,在尝试音乐功能时,我发现仅仅创建一个模仿 \repeat unfold 2
的音乐功能甚至是不可能的。 ;下面的内容在第三个和第四个之间跳下一个 Octave c
:
\version "2.14.2"
double = #(define-music-function
(parser location note)
(ly:music?)
#{
$note $note
#})
\relative c, {
\clef bass
\double c \double e \double g2 \double c,4 \double d \double e2
}
最佳答案
好的,这是我为您创建的一个功能,它可以让您重复单个音调。唯一的问题是它不会使用 \relative
表示法。这是因为,在相对记谱法中,后面的音符序列 c' c' c'
显然会比前一个音符高一个 Octave 。不幸的是,我仍然找不到一种方法来使用诸如 \function #3 c'
之类的函数来输出 c' c c
。也就是说,这是我的函数和一些示例:
\version "2.17.28"
times = #(define-music-function
(parser location N note)
(integer? ly:music?)
(cond
((>= N 2)
#{ \repeat unfold $N { \absolute $note } #}
)
((= N 1)
#{ \absolute $note #}
)
)
)
{
a4 \times #3 b4
R1
\times #4 { c'8 d' }
R1
\times #1 { c''1 }
}
所以语法很简单 \times #"number ofrepetition"{ ...music... }
。如果只重复一个音符,可以省略{
和}
:\times #"重复次数""单音符"
。
您可以在 \relative
段落的中间使用此函数,但随后您应该将函数的音高输入为绝对音高。看看:
\version "2.17.28"
times = #(define-music-function
(parser location N note)
(integer? ly:music?)
(cond
((>= N 2)
#{ \repeat unfold $N { \absolute $note } #}
)
((= N 1)
#{ \absolute $note #}
)
)
)
\relative c'' {
c4 d \times #4 e'' f g
}
请注意,以上所有音符都在同一 Octave 内。音符 f
的 Octave 位置也不受此函数的影响,它受到该函数之前的音符(即 d
)的影响。
当然有一种方法可以为此编写更好的代码,但我无法使用任何 \relative
或 \transpose
命令来实现这一点.
这里有一些尝试可以帮助您处理带括号的 Octave 音程(与上面的功能相同,但有一些小改动):
\version "2.17.28"
timesP = #(define-music-function
(parser location N note)
(integer? ly:music?)
(cond
((>= N 2)
#{
<<
\repeat unfold $N { \absolute $note }
\transpose c c' \repeat unfold $N { \absolute \parenthesize $note }
>>
#}
)
((= N 1)
#{
<<
\absolute $note
{ \transpose c c' \parenthesize $note }
>>
#}
)
)
)
{
a4 \timesP #3 b4
\timesP #8 c'16
\timesP #2 g4
\timesP #4 { c'8 d' } % no parenthesis here because there are two notes as arguments...
\timesP #1 { c''1 } % no parenthesis here because of the { }
}
\relative c'' {
c4 d \timesP #4 e'' f g
}
这里仍然有一些问题:只有当参数是没有 { }
的单个注释时,此函数才会加上括号。上面的代码对此进行了很好的注释。
我希望这会对您有所帮助。如果我在这里遇到 Octave 音阶换位问题的解决方案,我会更新这个答案。
关于scheme - 如何在 Lilypond 中缩写 'note with the same note an octave higher, parenthesized'?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19464086/
在 bash 中,() 和 $() 都创建了一个子 shell。 它们之间有什么区别?它们的典型用法是什么? 最佳答案 () 只是创建一个复合命令,运行括号内的命令。 $() 做同样的事情,但也替换了
我有一个关于如何正确解析如下字符串的问题, "(test.function, arr(3,12), "combine,into one")" 进入以下列表, ['test.function', 'ar
假设我有一个非常大的文件,我想检查括号是否平衡。我不能使用堆栈,对吧?因为它会导致堆栈溢出。我可以使用什么方法? 最佳答案 一个简单的计数器。由于您所做的只是计算括号: balance = 0 for
我希望这个线程成为覆盖和调用 toString 的优点/缺点的某种总结。有或没有空括号,因为这件事有时仍然让我感到困惑,即使我已经进入 Scala 很长一段时间了。 那么哪一个比另一个更可取呢?来自
本文关键词:有效,括号,括号匹配,栈,题解,leetcode, 力扣,Python, C++, Java 题目地址:https://leetcode.com/problems/valid-paren
本文关键词:括号, 括号生成,题解,leetcode, 力扣,Python, C++, Java 题目地址:https://leetcode.com/problems/generate-parent
我遇到了几天的问题。 我在编译我的程序时收到此警告。 In member function 'void CClientManager::RESULT_SAFEBOX_LOAD(CPeer*, SQLM
题目地址:https://leetcode.com/problems/best-sightseeing-pair/ 题目描述 Given an array A of positive intege
我想匹配以 ')' 结尾的字符串。我使用模式: "[)]\b" or ".*[)]\b" 它应该匹配字符串: x=main2.addMenu('Edit') 但它不起作用。怎么了? 最佳答案 \b
我正在尝试使用 paredit 在 Light Table 上编辑 Clojure/ClojureScript 文件,但该插件似乎不起作用。当我打开一个括号时,它没有关闭。 但是,插件已安装,如插件列
我在 R 中使用正则表达式。我试图找出字符向量中某些字符串末尾带括号的内容。我能够在括号内的内容存在时找到它,但我无法在没有括号的输入中排除非括号内的内容。 例子: > x gsub("(.*?)(
我需要一个正则表达式,其中允许以任何顺序使用空格、括号和连字符的任何数字。但是有必须最后是“+”(加号)。 最佳答案 您可以使用正则表达式: ^[\d() -]+\+$ 解释: ^ : Start
这个问题在这里已经有了答案: 关闭 10 年前。 Possible Duplicate: What is the purpose of a self executing function in ja
在 Common Lisp 中,特殊运算符 quote 使得后面跟着未计算的任何内容,例如 (quote a) -> a (quote {}) -> {} 但为什么表单 (quote ()) 给我 n
我有一个程序需要在用户输入括号时进行处理。我尝试过: root.bind("") 但是没用,和一样 root.bind("") 如何将括号事件绑定(bind)到 Tkinter 中?请帮助我 最佳答案
当我看到名称中带有括号的函数时,我正在阅读源代码: extern int LIB_(strcmp) ( const char* s1, const char* s2 ); extern char LI
是否可以改变 Hello, this is Mike (example) 到 Hello, this is Mike 将 JavaScript 与正则表达式一起使用? 最佳答案 "Hello, thi
题目地址:https://leetcode.com/problems/different-ways-to-add-parentheses/description/ 题目描述 Given a str
我在 react 原生项目的 VSCode 中使用 prettier,它删除了混合运算符中的括号或使用括号声明 var 时。如何防止 prettier 这样做 示例 1: const foo = (
我有一个包含一些引文的 R Markdown 文档。我正在使用默认的引文样式,这通常对我很有效。但是我有一些句子位于括号内,在这些句子中,我想在不添加第二组括号的情况下引用作品。也就是说,我想取消引用
我是一名优秀的程序员,十分优秀!