我正试着用两个函数表做一个音高包络。一个表保存音调值,另一个表保存相应的持续时间。这两个表的长度相等,但长度可以是任何值。有没有人知道用任意数量的点创建直线的好方法?或者一种将两个信封一个接一个地连接在一起的方法?谢谢!
发布于 2019-03-16 23:11:15
这是一种可能性:
instr test
kPitches[] fillarray 60, 62, 61, 63
kDurations[] fillarray 1, 2, 3, 1
kTime init 0
kIndx init 0
if kTime <= 0 then
kPitchLine = kPitches[kIndx]
kTime = kDurations[kIndx]
kIndx += 1
endif
kTime -= 1/kr
aTest poscil .2, mtof(kPitchLine)
out aTest, aTest
endin
schedule("test",0,7)如果你愿意,你可以使用函数表代替数组。您可以将其封装到一个UDO中(有关更多信息,请参阅http://write.flossmanuals.net/csound/g-user-defined-opcodes/ )。
也许你会考虑加入csound邮件列表。你会在那里得到更多的建议:https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
https://stackoverflow.com/questions/55186730
复制相似问题