本文整理汇总了Python中CeciliaLib.convertWindowsPath方法的典型用法代码示例。如果您正苦于以下问题:Python CeciliaLib.convertWindowsPath方法的具体用法?Python CeciliaLib.convertWindowsPath怎么用?Python CeciliaLib.convertWindowsPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CeciliaLib
的用法示例。
在下文中一共展示了CeciliaLib.convertWindowsPath方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: getParamsText
# 需要导入模块: import CeciliaLib [as 别名]
# 或者: from CeciliaLib import convertWindowsPath [as 别名]
def getParamsText(self):
knobs = [self.knob1, self.knob2, self.knob3]
orchtext = ''
scotext = ''
for knob in knobs:
if knob.getRate() == 'k':
orchtext += 'instr Cecilia_%s\n' % knob.getName()
orchtext += 'ksliderValue init %f\n' % knob.GetValue()
orchtext += 'kgetValue init %f\n' % knob.GetValue()
if knob.getWithMidi() and not knob.getPlay():
orchtext += 'kmidiValue init %f\n' % knob.GetValue()
if not knob.getLog():
init = (knob.GetValue() - knob.getMinValue()) / (knob.getMaxValue() - knob.getMinValue()) - (1./254)
if init <= 0:
orchtext += 'initc7 %d, %d, 0\n' % (knob.getMidiChannel(), knob.getMidiCtl())
else:
orchtext += 'initc7 %d, %d, %f\n' % (knob.getMidiChannel(), knob.getMidiCtl(), init)
orchtext += 'kmidiValue ctrl7 %d, %d, %f, %f\n' % (knob.getMidiChannel(), knob.getMidiCtl(), knob.getMinValue(), knob.getMaxValue())
else:
init = math.log10(knob.GetValue() / knob.getMinValue()) / math.log10(knob.getMaxValue() / knob.getMinValue()) - (1./254)
if init <= 0:
orchtext += 'initc7 %d, %d, 0\n' % (knob.getMidiChannel(), knob.getMidiCtl())
else:
orchtext += 'initc7 %d, %d, %f\n' % (knob.getMidiChannel(), knob.getMidiCtl(), init)
orchtext += 'kmiditemp ctrl7 %d, %d, 0, 1\n' % (knob.getMidiChannel(), knob.getMidiCtl())
orchtext += 'kmidiValue pow 10, kmiditemp * %f + %f\n' % ((math.log10(knob.getMaxValue()) - math.log10(knob.getMinValue())), math.log10(knob.getMinValue()))
orchtext += 'kgetValue chnget "%s_value"\n' % knob.getName()
if knob.getWithMidi() and not knob.getPlay():
orchtext += 'ksliderDown init 0\n'
orchtext += 'ksliderDown chnget "%s_down"\n' % knob.getName()
orchtext += 'if ksliderDown == 1 then\n'
orchtext += 'ksliderValue = kgetValue\n'
orchtext += 'else\n'
orchtext += 'ksliderValue = kmidiValue\n'
orchtext += 'endif\n\n'
orchtext += 'gk%s port ksliderValue, %f, %f\n' % (knob.getName(), knob.gliss, knob.GetValue())
orchtext += 'chnset gk%s, "%s"\n' % (knob.getName(), knob.getName())
elif knob.getPlay():
orchtext += 'kreadValue init %f\n' % knob.GetValue()
orchtext += 'ksliderDown init 0\n'
orchtext += 'ksliderDown chnget "%s_down"\n' % knob.getName()
orchtext += 'kphase phasor 1/p3\n'
orchtext += 'kreadValue tablei kphase, %d, 1\n' % knob.getTable()
orchtext += 'if ksliderDown == 1 then\n'
orchtext += 'gk%s port kgetValue, %f, %f\n' % (knob.getName(), knob.gliss, knob.GetValue())
orchtext += 'else\n'
orchtext += 'gk%s = kreadValue\n' % knob.getName()
orchtext += 'endif\n\n'
orchtext += 'chnset gk%s, "%s"\n' % (knob.getName(), knob.getName())
else:
orchtext += 'gk%s port kgetValue, %f, %f\n' % (knob.getName(), knob.gliss, knob.GetValue())
if knob.getRec():
knob.path = os.path.join(AUTOMATION_SAVE_PATH, '%s.auto' % knob.getName())
knob.path = CeciliaLib.convertWindowsPath(knob.getPath())
orchtext += 'dumpk gk%s, "%s", 8, 4/kr\n\n' % (knob.getName(), knob.getPath())
orchtext += 'endin\n\n'
scotext += 'i "Cecilia_%s" 0 %f\n' % (knob.getName(), CeciliaLib.getTotalTime())
return orchtext, scotext