【发布时间】:2021-04-09 17:01:50
【问题描述】:
我有一种情况,我有一首反复出现的音乐,只有轻微的变化。我想放下一个基础件作为变量。然后多次重复使用它,每次都通过替换一些音符或小节来改变它。这是一个简化的例子
base = { c4 c c c }
% pseudo function \replace MUSIC FROM TO ORIG
% FROM and To are pairs of numbers COUNT DURATION
from = #'(1 2)
to = #'(3 4)
var1 = \replace { d4 } \from \to \base
% this means replace
% from "after 1 half note into the music"
% to "after 3 quarter notes into the music"
% that is replace the third beat with { d4 }
% this will be equivalent to
var1 = { c4 c d c }
我该怎么做?
【问题讨论】:
-
您可能必须进入 Scheme(或其他一些编程语言)才能获得这个。