Exemple #1
0
    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)
Exemple #2
0
  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)
Exemple #3
0
  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)
    if len(nmm.inputs.AttackMod.cables):
      levconv = self.add_module('LevConv', name='Attack')
      setv(levconv.params.InputType, 0)  # Bip
      setv(levconv.params.OutputType, 5) # BipInv
      self.connect(levconv.outputs.Out, g2m.inputs.AttackMod)
      self.inputs[2] = levconv.inputs.In
    if len(nmm.inputs.DecayMod.cables):
      levconv = self.add_module('LevConv', name='Decay')
      setv(levconv.params.InputType, 0)  # Bip
      setv(levconv.params.OutputType, 5) # BipInv
      self.connect(levconv.outputs.Out, g2m.inputs.DecayMod)
      self.inputs[3] = levconv.inputs.In
    if len(nmm.inputs.ReleaseMod.cables):
      levconv = self.add_module('LevConv', name='Release')
      setv(levconv.params.InputType, 0)  # Bip
      setv(levconv.params.OutputType, 5) # BipInv
      self.connect(levconv.outputs.Out, g2m.inputs.ReleaseMod)
      self.inputs[5] = levconv.inputs.In
    setv(g2mp.OutputType, [0, 3][getv(nmmp.Invert)])
    self.inputs[:2] = handleretrig(self)
Exemple #4
0
    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)
        if len(nmm.inputs.AttackMod.cables):
            levconv = self.add_module('LevConv', name='Attack')
            setv(levconv.params.InputType, 0)  # Bip
            setv(levconv.params.OutputType, 5)  # BipInv
            self.connect(levconv.outputs.Out, g2m.inputs.AttackMod)
            self.inputs[2] = levconv.inputs.In
        if len(nmm.inputs.DecayMod.cables):
            levconv = self.add_module('LevConv', name='Decay')
            setv(levconv.params.InputType, 0)  # Bip
            setv(levconv.params.OutputType, 5)  # BipInv
            self.connect(levconv.outputs.Out, g2m.inputs.DecayMod)
            self.inputs[3] = levconv.inputs.In
        if len(nmm.inputs.ReleaseMod.cables):
            levconv = self.add_module('LevConv', name='Release')
            setv(levconv.params.InputType, 0)  # Bip
            setv(levconv.params.OutputType, 5)  # BipInv
            self.connect(levconv.outputs.Out, g2m.inputs.ReleaseMod)
            self.inputs[5] = levconv.inputs.In
        setv(g2mp.OutputType, [0, 3][getv(nmmp.Invert)])
        self.inputs[:2] = handleretrig(self)
Exemple #5
0
  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)
Exemple #6
0
    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)
Exemple #7
0
  def domodule(self):
    nmm, g2m = self.nmmodule, self.g2module
    nmmp, g2mp = nmm.params, g2m.params
    handlegate(self, 'Trigger')

    # handle special parameters
    updatevals(g2mp, ['Attack', 'Release'], adsrtime_map)
    if self.options.adsrforad:
      printf('%s\n', g2m.type.shortnm)
      setv(g2mp.Sustain, 0)
      setv(g2mp.Decay, getv(g2mp.Release))
Exemple #8
0
    def domodule(self):
        nmm, g2m = self.nmmodule, self.g2module
        nmmp, g2mp = nmm.params, g2m.params
        handlegate(self, 'Trigger')

        # handle special parameters
        updatevals(g2mp, ['Attack', 'Release'], adsrtime_map)
        if self.options.adsrforad:
            printf('%s\n', g2m.type.shortnm)
            setv(g2mp.Sustain, 0)
            setv(g2mp.Decay, getv(g2mp.Release))
Exemple #9
0
  def domodule(self):
    nmm, g2m = self.nmmodule, self.g2module
    nmmp, g2mp = nmm.params, g2m.params
    handlegate(self, 'Trig')

    # handle special parameters
    updatevals(g2mp, ['Attack', 'Hold', 'Decay'], adsrtime_map)
    if len(nmm.inputs.AttackMod.cables):
      levconv = self.add_module('LevConv', name='Attack')
      setv(levconv.params.InputType, 0)  # Bip
      setv(levconv.params.OutputType, 5) # BipInv
      self.connect(levconv.outputs.Out, g2m.inputs.AttackMod)
      self.inputs[1] = levconv.inputs.In
    if len(nmm.inputs.DecayMod.cables):
      levconv = self.add_module('LevConv', name='Decay')
      setv(levconv.params.InputType, 0)  # Bip
      setv(levconv.params.OutputType, 5) # BipInv
      self.connect(levconv.outputs.Out, g2m.inputs.DecayMod)
      self.inputs[3] = levconv.inputs.In
Exemple #10
0
    def domodule(self):
        nmm, g2m = self.nmmodule, self.g2module
        nmmp, g2mp = nmm.params, g2m.params
        handlegate(self, 'Trig')

        # handle special parameters
        updatevals(g2mp, ['Attack', 'Hold', 'Decay'], adsrtime_map)
        if len(nmm.inputs.AttackMod.cables):
            levconv = self.add_module('LevConv', name='Attack')
            setv(levconv.params.InputType, 0)  # Bip
            setv(levconv.params.OutputType, 5)  # BipInv
            self.connect(levconv.outputs.Out, g2m.inputs.AttackMod)
            self.inputs[1] = levconv.inputs.In
        if len(nmm.inputs.DecayMod.cables):
            levconv = self.add_module('LevConv', name='Decay')
            setv(levconv.params.InputType, 0)  # Bip
            setv(levconv.params.OutputType, 5)  # BipInv
            self.connect(levconv.outputs.Out, g2m.inputs.DecayMod)
            self.inputs[3] = levconv.inputs.In
Exemple #11
0
  def domodule(self):
    nmm, g2m = self.nmmodule, self.g2module
    nmmp, g2mp = nmm.params, g2m.params

    # parameters are exactly the same
    for i in xrange(len(nmm.params)):
      setv(g2mp[i], getv(nmmp[i]))
      self.params[i] = g2mp[i]

    updatevals(g2mp,
        ['MasterDecay', 'SlaveDecay', 'NoiseFltDecay', 'BendDecay'],
        adsrtime_map)

    setv(g2mp.MasterLevel, modtable[getv(g2mp.MasterLevel)][0])
    setv(g2mp.SlaveLevel, modtable[getv(g2mp.SlaveLevel)][0])
    setv(g2mp.BendAmount, modtable[getv(g2mp.BendAmount)][0])
    setv(g2mp.Click, modtable[getv(g2mp.Click)][0])
    setv(g2mp.Noise, modtable[getv(g2mp.Noise)][0])

    # handle special parameters
    setv(g2mp.Active, 1-getv(nmmp.Mute))
Exemple #12
0
    def domodule(self):
        nmm, g2m = self.nmmodule, self.g2module
        nmmp, g2mp = nmm.params, g2m.params

        # parameters are exactly the same
        for i in xrange(len(nmm.params)):
            setv(g2mp[i], getv(nmmp[i]))
            self.params[i] = g2mp[i]

        updatevals(g2mp,
                   ['MasterDecay', 'SlaveDecay', 'NoiseFltDecay', 'BendDecay'],
                   adsrtime_map)

        setv(g2mp.MasterLevel, modtable[getv(g2mp.MasterLevel)][0])
        setv(g2mp.SlaveLevel, modtable[getv(g2mp.SlaveLevel)][0])
        setv(g2mp.BendAmount, modtable[getv(g2mp.BendAmount)][0])
        setv(g2mp.Click, modtable[getv(g2mp.Click)][0])
        setv(g2mp.Noise, modtable[getv(g2mp.Noise)][0])

        # handle special parameters
        setv(g2mp.Active, 1 - getv(nmmp.Mute))
Exemple #13
0
  def domodule(self):
    nmm, g2m = self.nmmodule, self.g2module
    nmmp, g2mp = nmm.params, g2m.params

    updatevals(g2mp, ['Gain'], levamp_map)
Exemple #14
0
 def domodule(self):
   updatevals(self.g2module.params, ['Freq'], fltfreq_map)
Exemple #15
0
 def domodule(self):
     updatevals(self.g2module.params, ['Freq'], fltfreq_map)
Exemple #16
0
    def domodule(self):
        nmm, g2m = self.nmmodule, self.g2module
        nmmp, g2mp = nmm.params, g2m.params

        updatevals(g2mp, ['Gain'], levamp_map)