本文整理汇总了Python中nord.utils.setv函数的典型用法代码示例。如果您正苦于以下问题:Python setv函数的具体用法?Python setv怎么用?Python setv使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setv函数的16个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: domodule
def domodule(self):
nmm, g2m = self.nmmodule, self.g2module
nmmp, g2mp = nmm.params, g2m.params
# handle special special parameters
setv(g2mp.Active, 1-getv(nmmp.Mute))
setv(g2mp.FreqMode, [1, 0][nmm.modes[0].value])
setv(g2mp.Shape, 0)
if getv(g2mp.Waveform) == 3:
pwmod = handlepw(self, 64, 0, -1, 7)
if pwmod:
notequant = self.add_module('NoteQuant', name='BlueRate')
self.connect(notequant.outputs.Out, pwmod)
setv(notequant.params.Range, 127)
setv(notequant.params.Notes, 0)
self.inputs[3] = notequant.inputs.In
# handle special inputs
self.outputs[1], inputmod = handleslv(self)
self.inputmod = inputmod
inp = inputmod.params
self.params[:3] = inp.FreqCoarse, inp.FreqFine, inp.Kbt
p1, p2 = handledualpitchmod(self, inputmod.inputs.PitchVar,
inputmod.params.PitchMod, 4, 5)
self.inputs[1:3] = p1, p2
self.inputs[0] = handlefm(self, g2m.inputs.FmMod, g2mp.FmAmount, fmamod)
handlekbt(self, self.inputmod.inputs.Pitch, 1) # 0=off, 1=on
开发者ID:msg,项目名称:g2ools,代码行数:28,代码来源:osc.py
示例2: domodule
def domodule(self):
nmm, g2m = self.nmmodule, self.g2module
nmmp, g2mp = nmm.params, g2m.params
oclks = [[5, '16', 0], [7, 'T8', 1], [11, '8', 2]]
clks = oclks[:]
while len(clks):
clk = clks.pop(0)
if len(getattr(nmm.outputs, clk[1]).cables) != 0:
break
if len(clks) == 0:
clk = oclks[0]
g2m.modes.DivMode.value = 1
setv(g2mp.Divider, clk[0])
g2m.name = clk[1]
self.outputs[clk[2]] = g2m.outputs.Out
rst, midiclk = g2m.inputs.Rst, g2m.inputs.Clk
for div, nm, out in clks:
if len(getattr(nmm.outputs, nm).cables) == 0:
continue
clk = self.add_module('ClkDiv', name=nm)
clk.modes.DivMode.value = 1
setv(clk.params.Divider, div)
self.connect(rst, clk.inputs.Rst)
self.connect(midiclk, clk.inputs.Clk)
rst, midiclk = clk.inputs.Rst, clk.inputs.Clk
self.outputs[out] = clk.outputs.Out
开发者ID:msg,项目名称:g2ools,代码行数:29,代码来源:logic.py
示例3: domodule
def domodule(self):
nmm, g2m = self.nmmodule, self.g2module
nmmp, g2mp = nmm.params, g2m.params
if self.maing2module == 'Mix1-1A':
setv(g2mp.On, 1)
setv(g2mp.ExpLin, 2)
setv(g2mp.Lev, modtable[getv(nmmp.Level)][0])
out2 = self.add_module('2-Out')
lev = g2m.params.Lev
else:
out2 = g2m
lev = None
dest = getv(nmmp.Destination)
setv(out2.params.Destination, dest/2)
setv(out2.params.Active, 1-getv(nmmp.Mute))
inp = [out2.inputs.InL, out2.inputs.InR][dest % 2]
if self.maing2module == 'Mix1-1A':
self.connect(g2m.outputs.Out, inp)
else:
self.inputs = [inp]
self.params = [lev, out2.params.Destination, out2.params.Active]
开发者ID:msg,项目名称:g2ools,代码行数:25,代码来源:inout.py
示例4: updatevals
def updatevals(g2mp, params, nm1g2_map):
"""updatevals(g2mp, params, nm1g2_map) -> None
change the time values of g2 module based on tables in ./units.py.
"""
for param in params:
midival = getv(getattr(g2mp, param))
setv(getattr(g2mp, param), nm1g2_map[midival])
开发者ID:msg,项目名称:g2ools,代码行数:7,代码来源:convert.py
示例5: domodule
def domodule(self):
nmm, g2m = self.nmmodule, self.g2module
nmmp, g2mp = nmm.params, g2m.params
g2mp.Sel.labels = ['In', 'SideAct']
setv(g2mp.Sel, getv(nmmp.Act))
self.params[6] = g2mp.Sel
envfollow = self.add_module('EnvFollow')
setv(envfollow.params.Attack, getv(nmmp.Attack))
setv(envfollow.params.Release, getv(nmmp.Release))
self.params[:2] = envfollow.params.Attack, envfollow.params.Release
ratio = self.add_module('ShpExp', name='Ratio/Thresh')
setv(ratio.params.Curve, 2) # x4
setv(ratio.params.Amount, getv(nmmp.Ratio))
self.params[3] = ratio.params.Amount
left = self.add_module('LevMult', name='Left')
right = self.add_module('LevMult', name='Right')
# MISSING Gate, Hold, Mon, and Bypass parameters
self.connect(g2m.inputs.In1, left.inputs.In)
self.connect(g2m.outputs.Out, envfollow.inputs.In)
self.connect(envfollow.outputs.Out, ratio.inputs.In)
self.connect(ratio.outputs.Out, left.inputs.Mod)
self.connect(left.inputs.Mod, right.inputs.Mod)
self.inputs[:] = left.inputs.In, right.inputs.In, g2m.inputs.In2
self.outputs = left.outputs.Out, right.outputs.Out
开发者ID:msg,项目名称:g2ools,代码行数:27,代码来源:audio.py
示例6: handlegate
def handlegate(conv, name='Gate'):
gate = getattr(conv.nmmodule.inputs, name)
# if gate source Keyboard, disconnect and set KB
if not gate or not gate.net or not gate.net.output:
return
if gate.net.output.module.type.shortnm == 'Keyboard':
conv.nmmodule.area.removeconnector(gate)
setv(conv.g2module.params.KB, 1)
开发者ID:msg,项目名称:g2ools,代码行数:8,代码来源:env.py
示例7: domodule
def domodule(self):
nmm, g2m = self.nmmodule, self.g2module
nmmp, g2mp = nmm.params, g2m.params
if getv(nmmp.Color) == 1:
setv(g2mp.StepProb, 43)
else:
setv(g2mp.StepProb, 127)
开发者ID:msg,项目名称:g2ools,代码行数:8,代码来源:lfo.py
示例8: domodule
def domodule(self):
nmm, g2m = self.nmmodule, self.g2module
nmmp, g2mp = nmm.params, g2m.params
handlegate(self)
# handle special parameters
updatevals(g2mp, ['Attack', 'Decay', 'Release'], adsrtime_map)
setv(g2mp.OutputType, [0, 3][getv(nmmp.Invert)])
self.inputs[1:3] = handleretrig(self)
开发者ID:msg,项目名称:g2ools,代码行数:9,代码来源:env.py
示例9: domodule
def domodule(self):
nmm, g2m = self.nmmodule, self.g2module
nmmp, g2mp = nmm.params, g2m.params
porttime = [ .5*val for val in g2adsrtime]
nm1midival = getv(nmmp.Time)
g2midival = nm2g2val(nm1midival, nm1adsrtime, porttime)
setv(g2mp.Time, g2midival)
setv(g2mp.Glide, 0)
开发者ID:msg,项目名称:g2ools,代码行数:9,代码来源:ctrl.py
示例10: handledualpitchmod
def handledualpitchmod(conv, modinput, modinputparam, mod1param, mod2param):
global modindex
nmm, g2m = conv.nmmodule, conv.g2module
p1 = p2 = None
mix21b = None
pmod1 = getv(nmm.params.PitchMod1)
pmod2 = getv(nmm.params.PitchMod2)
if len(nmm.inputs.PitchMod1.cables) and len(nmm.inputs.PitchMod2.cables):
setv(modinputparam, 127)
mix21b = conv.add_module('Mix2-1B', name='PitchMod%d' % modindex.pitchmod)
conv.connect(mix21b.outputs.Out, modinput)
if pmod1 == 0 or pmod1 == 127:
setv(mix21b.params.Lev1, pmod1)
p1 = mix21b.inputs.In1
elif pmod1:
p1 = pitchadj(conv, mix21b.params.Lev1, mix21b.inputs.In1,
modtable[pmod1])
else:
p1 = mix21b.inputs.In1
if pmod2 == 0 or pmod2 == 127:
setv(mix21b.params.Lev2, pmod2)
p2 = mix21b.inputs.In2
elif pmod2:
p2 = pitchadj(conv, mix21b.params.Lev2, mix21b.inputs.In2,
modtable[pmod2])
conv.params[mod1param] = mix21b.params.Lev1
conv.params[mod2param] = mix21b.params.Lev2
elif len(nmm.inputs.PitchMod1.cables):
if pmod1 == 0 or pmod1 == 127:
setv(modinputparam, pmod1)
p1 = modinput
else:
p1 = pitchadj(conv, modinputparam, modinput, modtable[pmod1])
conv.params[mod1param] = modinputparam
elif len(nmm.inputs.PitchMod2.cables):
if pmod2 == 0 or pmod2 == 127:
setv(modinputparam, pmod2)
p2 = modinput
else:
p2 = pitchadj(conv, modinputparam, modinput, modtable[pmod2])
conv.params[mod2param] = modinputparam
return p1, p2
开发者ID:msg,项目名称:g2ools,代码行数:54,代码来源:osc.py
示例11: domodule
def domodule(self):
nmm, g2m = self.nmmodule, self.g2module
nmmp, g2mp = nmm.params, g2m.params
shift = getv(nmmp.Shift)
if shift:
conv = self.add_module('LevConv')
self.connect(conv.outputs.Out, g2m.inputs.Mod)
setv(conv.params.OutputType, 0) # Pos
self.params[0] = conv.params.OutputType
self.inputs[0] = conv.inputs.In
开发者ID:msg,项目名称:g2ools,代码行数:11,代码来源:mixer.py
示例12: domodule
def domodule(self):
ConvFilter.domodule(self)
nmm, g2m = self.nmmodule, self.g2module
nmmp, g2mp = nmm.params, g2m.params
setv(g2mp.Active, 1-getv(nmmp.Bypass))
# handle special inputs
p1, p2 = fltdualpitchmod(nmm, g2m, self, 3, 4)
self.inputs[0:2] = p1, p2
self.kbt = g2mp.Kbt
handlekbt(self, g2m.inputs.Pitch, 4) # 4=Kbt 100%
开发者ID:msg,项目名称:g2ools,代码行数:12,代码来源:filter.py
示例13: domodule
def domodule(self):
nmm, g2m = self.nmmodule, self.g2module
nmmp, g2mp = nmm.params, g2m.params
for j in xrange(2):
for i in xrange(16):
s = 'Seq%dStep%d' % (j+1, i+1)
step = getattr(g2mp, s)
setv(step, getv(getattr(nmmp, s)))
self.params[4+j*16+i] = step
self.outputs[3] = handlelength(self)
开发者ID:msg,项目名称:g2ools,代码行数:12,代码来源:seq.py
示例14: __init__
def __init__(self, nmarea, g2area, nmmodule, options):
"""Convert(nmarea, g2area, nmmodule, options) -> Convert
create a convert object from a nm1 module in nmarea to g2area.
"""
self.nmarea = nmarea
self.g2area = g2area
nmm = self.nmmodule = nmmodule
nmm.conv = self # to get back here when needed (cables)
self.options = options
# use for cabling
for output in nmmodule.outputs:
output.conv = self
for input in nmmodule.inputs:
input.conv = self
self.g2modules = []
self.params = []
self.outputs = []
self.inputs = []
# create main module and setup size requirements
g2m = self.g2module = g2area.add_module(self.maing2module)
g2m.name = toascii(nmm.name)
self.horiz = g2m.horiz = nmm.horiz
self.height = g2m.type.height
# setup parameters from parammap static member of convert module class
self.params = [None] * len(self.parammap)
for i, param in enumerate(self.parammap):
if type(param) == type(""):
setv(getattr(g2m.params, param), getv(getattr(nmm.params, param)))
self.params[i] = getattr(g2m.params, param)
elif type(param) == type([]):
setv(getattr(g2m.params, param[0]), getv(getattr(nmm.params, param[1])))
self.params[i] = getattr(g2m.params, param[0])
else:
self.params[i] = param # None: placeholder for other parameters
# setup inputs from inputmap static member of convert module class
self.inputs = [getattr(g2m.inputs, i, None) for i in self.inputmap]
# setup outputs from outputmap static member of convert module class
self.outputs = [getattr(g2m.outputs, o, None) for o in self.outputmap]
开发者ID:msg,项目名称:g2ools,代码行数:42,代码来源:convert.py
示例15: pitchadj
def pitchadj(conv, pitchparam, pitchinput, tableentry):
global modindex
setv(pitchparam, tableentry[0])
if tableentry[1] == 0 and tableentry[2] == 0:
return pitchinput
adj1 = conv.add_module('Mix2-1B', name='PitchAdj%d' % modindex.pitchadj)
conv.connect(adj1.inputs.Chain, adj1.inputs.In1)
conv.connect(adj1.inputs.In1, adj1.inputs.In2)
conv.connect(adj1.outputs.Out, pitchinput)
setv(adj1.params.Inv2, 1)
setv(adj1.params.Lev1, tableentry[1])
setv(adj1.params.Lev2, tableentry[2])
return adj1.inputs.Chain
开发者ID:msg,项目名称:g2ools,代码行数:13,代码来源:osc.py
示例16: convert
def convert(self):
# loop through each module
# determine and store separation from module above >= 0
# if mod in convertion table
# call convertion table module function
# loop through each cable
# if source and dest in convertion table
# create new connection
# update midi controller assignments
# update knob assignments (on pags A1:1, A1:2 and A1:3)
# update morph assignments
# reorder modules top to bottom, left to right
# relocate modules top to bottom, left to right based on separation
# add name bar with my name and convertion info
# add name bar with errors/comments etc.
# save g2 file
# other ideas:
# create patch equal function
# create patch merge function that updates variations
# of one patch from another.
g2patch, nmpatch = self.g2patch, self.nmpatch
setv(g2patch.settings.patchvol, 127)
for color in ['red', 'blue', 'yellow', 'green', 'purple']:
setattr(g2patch.description, color, getattr(nmpatch.header, color))
if nmpatch.header.voices > 1:
g2patch.description.monopoly = 0
g2patch.description.voices = nmpatch.header.voices - 1
setv(g2patch.settings.glide, nmpatch.header.porta)
setv(g2patch.settings.glidetime, nmpatch.header.portatime)
setv(g2patch.settings.octaveshift, nmpatch.header.octshift)
self.log.info('--- area voice: ---')
self.voiceconverters = self.doarea(nmpatch.voice, g2patch.voice)
self.log.info('--- area fx: ---')
self.fxconverters = self.doarea(nmpatch.fx, g2patch.fx)
self.domorphs()
self.doknobs()
self.domidiccs()
self.docurrentnotes()
self.dofinalize()
# handle text pad
self.pch2.patch.textpad = self.pch.patch.textpad
self.dotitleblock()
self.log.info('Writing patch "%s2"' % (self.pch.filename))
self.pch2.write(self.pch.filename+'2')
开发者ID:msg,项目名称:g2ools,代码行数:51,代码来源:nm2g2.py
注:本文中的nord.utils.setv函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论