• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python utils.getv函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中nord.utils.getv函数的典型用法代码示例。如果您正苦于以下问题:Python getv函数的具体用法?Python getv怎么用?Python getv使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了getv函数的16个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: handlelength

def handlelength(conv):
  nmm, g2m = conv.nmmodule, conv.g2module
  nmmp, g2mp = nmm.params, g2m.params
  length = getv(nmmp.Length)
  if getv(nmmp.Loop) == 0 and length > 15:
    link = g2m.outputs.Link
    setv(g2mp.Length, 16)
    for l in xrange(16, length, 16):
      seq = conv.add_module(g2m.type.shortnm)
      if l + 16 > length:
        setv(seq.params.Length, length - l)
      else:
        setv(seq.params.Length, 16)
      setv(seq.params.Loop, 0) # Once
      conv.connect(g2m.inputs.Rst, seq.inputs.Park)
      conv.connect(link, seq.inputs.Rst)
      conv.connect(g2m.inputs.Clk, seq.inputs.Clk)
      link = seq.outputs.Link
    return link
  if length > 16:
    clkdiv = conv.add_module('ClkDiv')
    clkdiv.modes.DivMode.value = 0
    setv(clkdiv.params.Divider, length)
    conv.connect(clkdiv.outputs.Out, g2m.inputs.Rst)
    conv.connect(clkdiv.inputs.Clk, g2m.inputs.Clk)
    conv.inputs[1] = clkdiv.inputs.Rst
    setv(g2mp.Loop, 0) # Once
  return g2m.outputs.Link
开发者ID:msg,项目名称:g2ools,代码行数:28,代码来源:seq.py


示例2: domodule

 def domodule(self):
   nmm, g2m = self.nmmodule, self.g2module
   nmmp, g2mp = nmm.params, g2m.params
   
   setv(g2mp.Bandwidth, 0)
   setv(g2mp.Active, 1-getv(nmmp.Bypass))
   setv(g2mp.Level, modtable[getv(nmmp.Level)][0])
开发者ID:msg,项目名称:g2ools,代码行数:7,代码来源:filter.py


示例3: handleslv

def handleslv(conv):
  global modindex
  conv.nonslaves = []
  conv.slaves = []
  nmm, g2m = conv.nmmodule, conv.g2module
  if len(nmm.outputs.Slv.cables):
    # add a masterosc
    master = conv.add_module('OscMaster', name='SlvOut%d' % modindex.slvout)
    setv(g2m.params.Kbt, 0)
    conv.kbt = master.params.Kbt
    conv.connect(master.outputs.Out, g2m.inputs.Pitch)
    setv(master.params.FreqCoarse, getv(g2m.params.FreqCoarse))
    setv(master.params.FreqFine, getv(g2m.params.FreqFine))
    setv(master.params.FreqMode, getv(g2m.params.FreqMode))
    setv(master.params.PitchMod, getv(g2m.params.PitchMod))
    setv(g2m.params.FreqCoarse, 64)
    setv(g2m.params.FreqFine, 64)
    out = handleoscmasterslv(conv, master, 44, 64, 69, 103, 42)
    if out:
      return out, master
    else:
      return g2m.inputs.Pitch, master
  else:
    conv.kbt = g2m.params.Kbt
    return None, g2m
开发者ID:msg,项目名称:g2ools,代码行数:25,代码来源:osc.py


示例4: domodule

  def domodule(self):
    nmm, g2m = self.nmmodule, self.g2module
    nmmp, g2mp = nmm.params, g2m.params

    setv(g2mp.Kbt, 0)
    setv(g2mp.Active, 1-getv(nmmp.Mute))
    setv(g2mp.FreqMode, [2, 3, 1][nmm.modes[0].value])
    g2m.modes.Waveform.value = self.waveform

    # must happen after handle mst to get Range
    if getv(getattr(nmmp, '-3Oct')):
      freqmode = getv(g2mp.FreqMode)
      nm1freqcoarse = getv(nmmp.DetuneCoarse)
      g2freqcoarse = getv(g2mp.FreqCoarse)
      if freqmode == 3: # Part
        offset = 8
      else:
        offset = 36
      if g2freqcoarse - offset < 0:
        constswt = self.add_module('ConstSwT', name='Offset')
        setv(constswt.params.On, 1)
        constswt.params.On.labels = ['Offset']
        setv(constswt.params.Lev, g2freqcoarse-offset)
        setv(g2mp.PitchVar, 127)
        self.connect(constswt.outputs.Out, g2m.inputs.PitchVar)
      else:
        setv(g2mp.FreqCoarse, g2freqcoarse-offset)
      
    self.inputs[1] = handlefm(self, g2m.inputs.PhaseMod, g2mp.PhaseMod, fmbmod)

    sinepostmst(self, 0)
开发者ID:msg,项目名称:g2ools,代码行数:31,代码来源:osc.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: 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


示例7: domodule

  def domodule(self):
    nmm, g2m = self.nmmodule, self.g2module
    nmmp, g2mp = nmm.params, g2m.params

    pattern = (getv(nmmp.Pattern) + 64) % 128
    setv(g2mp.PatternA, pattern)
    bank = (getv(nmmp.Bank) + 64) % 128
    setv(g2mp.PatternB, bank)

    # PatternA and PatternB receive same input
    if len(getattr(nmm.inputs, 'Pattern&Bank').cables):
      self.connect(g2m.inputs.A, g2m.inputs.B) 
    lowdelta = getv(nmmp.LowDelta)
    if lowdelta:
      notequant = self.add_module('NoteQuant')
      self.connect(g2m.outputs.Out, notequant.inputs.In)
      setv(notequant.params.Range, 77)
      setv(notequant.params.Notes, 1)
      self.outputs[0] = notequant.outputs.Out
      stepprob, add = 55, 75
      setv(g2mp.StepProb, 55)
    else:
      stepprob, add = 127, 74
    setv(g2mp.StepProb, stepprob)
    levadd = self.add_module('LevAdd')
    self.connect(self.outputs[0], levadd.inputs.In)
    setv(levadd.params.Level, add)
    self.outputs[0] = levadd.outputs.Out
开发者ID:msg,项目名称:g2ools,代码行数:28,代码来源:lfo.py


示例8: domodule

  def domodule(self):
    nmm, g2m = self.nmmodule, self.g2module
    nmmp, g2mp = nmm.params, g2m.params

    if self.maing2module == 'Sw4-1':
      # add a LevAmp and reorient inputs
      for i in xrange(1, 5):
        level = getv(getattr(nmmp, 'Level%d' % i))
        if level == 0 or level == 127:
          continue
        if len(nmm.inputs[i-1].cables):
          mix11a = self.add_module('Mix1-1A')
          self.connect(mix11a.outputs.Out, getattr(g2m.inputs, 'In%d' % i))
          setv(mix11a.params.On, 1)
          setv(mix11a.params.Lev, modtable[level][0])
          self.params[i] = mix11a.params.Lev
          self.inputs[i-1] = mix11a.inputs.In
    else:
      sel = getv(nmmp.Sel)
      for i in xrange(1, 5):
        level = getv(getattr(nmmp, 'Level%d' % i))
        lev = getattr(g2mp, 'Lev%d' % i)
        setv(lev, modtable[level][0])
        setv(getattr(g2mp, 'On%d' % i), sel == i-1)
        self.params[i] = lev
开发者ID:msg,项目名称:g2ools,代码行数:25,代码来源:mixer.py


示例9: domodule

  def domodule(self):
    nmm, g2m = self.nmmodule, self.g2module
    nmmp, g2mp = nmm.params, g2m.params
    handlegate(self)

    setv(g2mp.SustainMode, [3, 0, 1, 2, 3][getv(nmmp.Sustain)])
    setv(g2mp.Shape, [3, 2, 1][getv(nmmp.Curve)])
    # handle special parameters
    updatevals(g2mp, ['Time%d' % i for i in xrange(1, 5)]+['NR'], adsrtime_map)
    # if L4 is sustain, deal with it.
    sustain = getv(nmmp.Sustain)
    if sustain == 4:
      adsr = self.add_module('EnvADSR')
      setv(adsr.params.Shape, [3, 2, 1][getv(nmmp.Curve)])
      setv(adsr.params.KB, getv(g2mp.KB))
      setv(adsr.params.Attack, 0)
      setv(adsr.params.Decay, 0)
      setv(adsr.params.Sustain, 127)
      setv(adsr.params.Release, getv(nmmp.Time5))
      updatevals(adsr.params, ['Release'], adsrtime_map)
      self.connect(g2m.inputs.Gate, adsr.inputs.Gate)
      self.connect(adsr.outputs.Env, g2m.inputs.AM)
      self.inputs[2] = adsr.inputs.AM
      return
    elif sustain == 3 and getv(nmmp.Time5) <= 16: # 16=5.3ms
      pass
    time = nm1adsrtime[getv(nmmp.Time4)]+nm1adsrtime[getv(nmmp.Time5)]
    setv(g2mp.Time4, self.closesttime(time))
    setv(g2mp.Level4, 0)
开发者ID:msg,项目名称:g2ools,代码行数:29,代码来源:env.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

    setv(g2mp.Kbt, 0)
    l = getv(nmmp.LeftGain)
    r = getv(nmmp.RightGain)
    velsens = getv(nmmp.VelocitySensitivity)
    external = 0
    for paramnm in ['VelocitySensitivity', 'LeftGain', 'RightGain']:
      param = getattr(nmmp, paramnm)
      for checknm in ['knob', 'ctrl', 'morph']:
        if getattr(param, checknm) != None:
          external = 1
    less8db = (abs(l-24) <= 8 and abs(r-24) <= 8)
    velinp = len(nmm.inputs.Velocity.cables) != 0
    setv(g2mp.L, notescale[l][1])
    setv(g2mp.R, notescale[r][1])
    if not external and less8db and not velinp and velsens == 0 :
      return

    if not less8db:
      setv(g2mp.Kbt, 0) 
      setv(g2mp.L, notescale[l][0])
      setv(g2mp.R, notescale[r][0])
      levmult1 = self.add_module('LevMult', name='24db')
      self.connect(g2m.outputs.Level, g2m.inputs.In)
      self.connect(g2m.outputs.Level, levmult1.inputs.Mod)
      self.connect(g2m.outputs.Out, levmult1.inputs.In)
      out = levmult1.outputs.Out
      if not velinp and velsens == 0:
        self.outputs[0] = levmult1.outputs.Out
        return
    else:
      out = g2m.outputs.Level

    mix21b = self.add_module('Mix2-1B', name='Vel')
    setv(mix21b.params.Inv2, 1)
    setv(mix21b.params.Lev1, 88)
    setv(mix21b.params.Lev2, 16)
    self.connect(mix21b.inputs.Chain, mix21b.inputs.In1)
    self.connect(mix21b.inputs.In1, mix21b.inputs.In2)
    levmult2 = self.add_module('LevMult', name='')
    xfade = self.add_module('X-Fade', name='VelSens')
    setv(xfade.params.LogLin, 1) # Lin
    self.connect(mix21b.outputs.Out, levmult2.inputs.Mod)
    self.connect(out, levmult2.inputs.In)
    self.connect(levmult2.inputs.In, xfade.inputs.In1)
    self.connect(levmult2.outputs.Out, xfade.inputs.In2)
    setv(xfade.params.Mix, velsens)
    self.params[0] = xfade.params.Mix
    self.inputs[0] = mix21b.inputs.Chain
    self.outputs[0] = xfade.outputs.Out
开发者ID:msg,项目名称:g2ools,代码行数:53,代码来源:ctrl.py


示例12: handlepw

def handlepw(conv, pw, haspw, shape, shapemod):
  nmm, g2m = conv.nmmodule, conv.g2module
  nmmp, g2mp = nmm.params, g2m.params
  # add mix2-1b so input can be doubled/inverted
  pwmod = None
  if haspw:
    pw = getv(nmmp.PulseWidth)
  else:
    pw = 0
  if len(nmm.inputs.PwMod.cables):
    clip = conv.add_module('Clip', name='PWLimit')
    setv(clip.params.Shape, 1) # Sym
    mix11a = conv.add_module('Mix1-1A', name='ShapeMod')
    setv(mix11a.params.ExpLin, 1) # Lin
    setv(mix11a.params.On, 1)
    mix11a.params.On.labels = ['Mod']
    if haspw and pw != 64:
      constswt = conv.add_module('ConstSwT', name='Shape')
      setv(constswt.params.On, 1)
      constswt.params.On.labels = ['Shape']
    mix21b = conv.add_module('Mix2-1B', name='ModIn')
    conv.connect(clip.outputs.Out, g2m.inputs.ShapeMod)
    conv.connect(mix11a.outputs.Out, clip.inputs.In)
    if haspw and pw != 64:
      conv.connect(constswt.outputs.Out, mix11a.inputs.Chain)
      conv.connect(mix21b.outputs.Out, mix11a.inputs.In)
      setv(constswt.params.Lev, pw)
    else:
      conv.connect(mix21b.outputs.Out, mix11a.inputs.In)
    conv.connect(mix21b.inputs.In1, mix21b.inputs.In2)
    setv(clip.params.ClipLev, 2)
    setv(mix21b.params.Lev1, 126)
    setv(mix21b.params.Lev2, 127)
    setv(g2mp.Shape, 0)
    setv(g2mp.ShapeMod, 127)
    setv(mix11a.params.Lev, getv(nmmp.PwMod))
    conv.params[shapemod] = mix11a.params.Lev
    if shape > -1 and pw != 64:
      conv.params[shape] = constswt.params.Lev
    return mix21b.inputs.In1
  elif haspw and pw != 64:
    constswt = conv.add_module('ConstSwT', name='Shape')
    setv(constswt.params.On, 1)
    constswt.params.On.labels = ['Shape']
    setv(constswt.params.Lev, pw)
    setv(g2mp.Shape, 0)
    setv(g2mp.ShapeMod, 126)
    conv.connect(constswt.outputs.Out, g2m.inputs.ShapeMod)
  return pwmod
开发者ID:msg,项目名称:g2ools,代码行数:49,代码来源:osc.py


示例13: __init__

 def __init__(self, nmarea, g2area, nmmodule, options):
   # use mixer if knobs, morphs, or midi cc's assigned and connected
   usemixer = False
   for i in xrange(1, 5):
     level = getattr(nmmodule.params, 'Level%d' % i)
     innet = getattr(nmmodule.inputs, 'In%d' % i).net
     if not innet:
       continue
     if level.knob or level.morph or level.ctrl:
       usemixer = True
     if getv(level) != 127 and getv(level) != 0:
       usemixer = True
   if usemixer:
     self.maing2module = 'Mix4-1C'
     self.parammap[0] = None
   super(Conv4_1Switch, self).__init__(nmarea, g2area, nmmodule, options)
开发者ID:msg,项目名称:g2ools,代码行数:16,代码来源:mixer.py


示例14: __init__

 def __init__(self, nmarea, g2area, nmmodule, options):
   lev = nmmodule.params.Level
   if getv(lev) == 127 and not lev.knob and not lev.morph and not lev.ctrl:
     self.maing2module = '2-Out'
   if len(filter(isxoutput, nmarea.modules)) < 2:
     self.maing2module = '2-Out'
   Convert.__init__(self, nmarea, g2area, nmmodule, options)
开发者ID:msg,项目名称:g2ools,代码行数:7,代码来源:inout.py


示例15: handlekbt

def handlekbt(conv, input, kbt100, addalways=False):
    """handlekbt(conv, input, kbt100, addalways=False) -> input
  """
    nmm, g2m = conv.nmmodule, conv.g2module
    nmmp, g2mp = nmm.params, g2m.params

    kbt = getv(nmmp.Kbt)
    if addalways:
        pass
    elif kbt == 0:
        setv(conv.kbt, kbt)
        return None
    elif kbt == 64:
        setv(conv.kbt, kbt100)
        return None

    if not g2m.area.keyboard:
        g2m.area.keyboard = conv.add_module("Keyboard")
    keyboard = g2m.area.keyboard

    setv(conv.kbt, 0)
    mix21b = conv.add_module("Mix2-1B", name="Kbt")
    conv.connect(keyboard.outputs.Note, mix21b.inputs.In1)
    conv.connect(mix21b.inputs.In1, mix21b.inputs.In2)
    conv.connect(mix21b.outputs.Out, input)
    setv(mix21b.params.ExpLin, 1)  # Lin
    setv(mix21b.params.Lev1, kbttable[kbt][0])
    setv(mix21b.params.Lev2, kbttable[kbt][1])
    return input
开发者ID:msg,项目名称:g2ools,代码行数:29,代码来源:convert.py


示例16: 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



注:本文中的nord.utils.getv函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python utils.setv函数代码示例发布时间:2022-05-27
下一篇:
Python nodes.ref函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap