Beispiel #1
0
Datei: osc.py Projekt: msg/g2ools
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
Beispiel #2
0
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
Beispiel #3
0
def handleslv(conv, ratemodin, ratemodparam):
    nmm, g2m = conv.nmmodule, conv.g2module
    nmmp, g2mp = nmm.params, g2m.params

    slv, kbt = None, g2m.inputs.Rate

    if len(nmm.outputs.Slv.cables):
        oscmaster = conv.add_module('OscMaster')
        setv(g2mp.Rate, 64)
        setv(oscmaster.params.Kbt, 0)  # Off
        setv(oscmaster.params.FreqCoarse, getv(nmmp.Rate))
        #setv(oscmaster.params.PitchMod, modtable[getv(nmmp.RateMod)][0])
        conv.connect(oscmaster.outputs.Out, g2m.inputs.Rate)
        ratemodin = oscmaster.inputs.PitchVar
        ratemodparam = oscmaster.params.PitchMod
        slv = g2m.inputs.Rate
        kbt = oscmaster.inputs.Pitch
        conv.kbt = oscmaster.params.Kbt

        if getv(nmmp.Range) == 1:  # Lo
            slv = handleoscmasterslv(conv, oscmaster, 64, 40, 50, 103, 41,
                                     True)
        else:
            slv = handleoscmasterslv(conv, oscmaster, 76, 64, 52, 104, 35,
                                     False)

    # add fine tuning
    if len(nmm.inputs.Rate.cables):
        mod = getv(nmmp.RateMod)
        if mod == 0 or mod == 127:
            setv(ratemodparam, mod)
        else:
            setv(ratemodparam, modtable[mod][0])
            adj = conv.add_module('Mix2-1B', name='PitchAdj')
            conv.connect(adj.outputs.Out, ratemodin)
            conv.connect(adj.inputs.Chain, adj.inputs.In1)
            conv.connect(adj.inputs.In1, adj.inputs.In2)
            setv(adj.params.Inv1, 1)
            setv(adj.params.Lev1, modtable[mod][1])
            setv(adj.params.Lev2, modtable[mod][2])
            ratemodin = adj.inputs.Chain

    return ratemodin, ratemodparam, slv, kbt
Beispiel #4
0
Datei: osc.py Projekt: msg/g2ools
  def domodule(self):
    nmm, g2m = self.nmmodule, self.g2module
    nmmp, g2mp = nmm.params, g2m.params

    setv(g2mp.FreqMode, [1, 0][nmm.modes[0].value])

    # handle special inputs
    p1, p2 = handledualpitchmod(self, g2m.inputs.PitchVar, g2m.params.PitchMod,
        3, 4)
    self.inputs[:2] = [p1, p2]
    self.outputs[0] = handleoscmasterslv(self, g2m, 44, 64, 69, 103, 42)
Beispiel #5
0
    def domodule(self):
        nmm, g2m = self.nmmodule, self.g2module
        nmmp, g2mp = nmm.params, g2m.params

        setv(g2mp.FreqMode, [1, 0][nmm.modes[0].value])

        # handle special inputs
        p1, p2 = handledualpitchmod(self, g2m.inputs.PitchVar,
                                    g2m.params.PitchMod, 3, 4)
        self.inputs[:2] = [p1, p2]
        self.outputs[0] = handleoscmasterslv(self, g2m, 44, 64, 69, 103, 42)
Beispiel #6
0
Datei: lfo.py Projekt: msg/g2ools
def handleslv(conv, ratemodin, ratemodparam):
  nmm, g2m = conv.nmmodule, conv.g2module
  nmmp, g2mp = nmm.params, g2m.params

  slv, kbt = None, g2m.inputs.Rate

  if len(nmm.outputs.Slv.cables):
    oscmaster = conv.add_module('OscMaster')
    setv(g2mp.Rate, 64)
    setv(oscmaster.params.Kbt, 0) # Off
    setv(oscmaster.params.FreqCoarse, getv(nmmp.Rate))
    #setv(oscmaster.params.PitchMod, modtable[getv(nmmp.RateMod)][0])
    conv.connect(oscmaster.outputs.Out, g2m.inputs.Rate)
    ratemodin = oscmaster.inputs.PitchVar
    ratemodparam = oscmaster.params.PitchMod
    slv = g2m.inputs.Rate
    kbt = oscmaster.inputs.Pitch
    conv.kbt = oscmaster.params.Kbt

    if getv(nmmp.Range) == 1: # Lo
      slv = handleoscmasterslv(conv, oscmaster, 64, 40, 50, 103, 41, True)
    else:
      slv = handleoscmasterslv(conv, oscmaster, 76, 64, 52, 104, 35, False)

  # add fine tuning 
  if len(nmm.inputs.Rate.cables):
    mod = getv(nmmp.RateMod)
    if mod == 0 or mod == 127:
      setv(ratemodparam, mod)
    else:
      setv(ratemodparam, modtable[mod][0])
      adj = conv.add_module('Mix2-1B', name='PitchAdj')
      conv.connect(adj.outputs.Out, ratemodin)
      conv.connect(adj.inputs.Chain, adj.inputs.In1)
      conv.connect(adj.inputs.In1, adj.inputs.In2)
      setv(adj.params.Inv1, 1)
      setv(adj.params.Lev1, modtable[mod][1])
      setv(adj.params.Lev2, modtable[mod][2])
      ratemodin = adj.inputs.Chain

  return ratemodin, ratemodparam, slv, kbt