Ejemplo n.º 1
0
    def __init__(self, init_type, init_args, patch, scope, name):
        Processor.__init__(self, 4, 1, init_type, init_args, patch, scope,
                           name)
        initargs, kwargs = self.parse_args(init_args)
        freq = 0
        ampl = 1.0
        pw = 0.5
        loval = -1.0
        hival = 1.0
        mode = 0

        if init_type == 'gate~':
            loval = 0.0

        if len(initargs) > 0:
            freq = initargs[0]
        if len(initargs) > 1:
            ampl = initargs[1]
        if len(initargs) > 2:
            pw = initargs[2]
        if len(initargs) > 3:
            if initargs[3] == 'ms':
                mode = 1
            elif initargs[3] == 'frac':
                mode = 0

        self.dsp_inlets = [1, 2, 3]
        self.dsp_outlets = [0]
        self.dsp_init("pulse~",
                      _sig_1=float(freq),
                      _sig_2=float(ampl),
                      _sig_3=float(pw),
                      hival=hival,
                      loval=loval,
                      pw_mode=mode)
Ejemplo n.º 2
0
    def __init__(self, init_type, init_args, patch, scope, name):
        Processor.__init__(self, 1, 2, init_type, init_args, patch, scope, name)
        initargs, kwargs = self.parse_args(init_args)

        self.dsp_inlets = [0]
        self.dsp_outlets = [0, 1]
        self.dsp_init("ampl~")
Ejemplo n.º 3
0
    def __init__(self, init_type, init_args, patch, scope, name):
        Processor.__init__(self, 1, 2, init_type, init_args, patch, scope, name)
        initargs, kwargs = self.parse_args(init_args)

        self.dsp_inlets = [0]
        self.dsp_outlets = [0, 1]
        self.dsp_init("ampl~")
Ejemplo n.º 4
0
    def __init__(self, init_type, init_args, patch, scope, name):
        self.dbref = 1.0 
        Processor.__init__(self, 2, 1, init_type, init_args, patch, scope, name)

        initargs, kwargs = self.parse_args(init_args)
        if len(initargs):
            self.dbref = initargs[0]
Ejemplo n.º 5
0
Archivo: loop.py Proyecto: bgribble/mfp
    def __init__(self, init_type, init_args, patch, scope, name):
        self.iterating = False
        self.startval = False
        Processor.__init__(self, 2, 1, init_type, init_args, patch, scope, name)

        initargs, kwargs = self.parse_args(init_args)
        if len(initargs):
            self.inlets[1] = initargs[0]
            self.startval = initargs[0]
Ejemplo n.º 6
0
Archivo: line.py Proyecto: wrl/mfp
    def __init__(self, init_type, init_args, patch, scope, name):
        Processor.__init__(self, 1, 1, init_type, init_args, patch, scope, name)
        initargs, kwargs = self.parse_args(init_args)

        segments = []
        if len(initargs):
            segments = self.convert_segments(initargs[0])

        self.dsp_outlets = [0]
        self.dsp_init("line~", segments=segments)
Ejemplo n.º 7
0
    def __init__(self, init_type, init_args, patch, scope, name):
        self.iterating = False
        self.startval = False
        Processor.__init__(self, 2, 1, init_type, init_args, patch, scope,
                           name)

        initargs, kwargs = self.parse_args(init_args)
        if len(initargs):
            self.inlets[1] = initargs[0]
            self.startval = initargs[0]
Ejemplo n.º 8
0
Archivo: phasor.py Proyecto: wrl/mfp
    def __init__(self, init_type, init_args, patch, scope, name):
        Processor.__init__(self, 3, 1, init_type, init_args, patch, scope, name)
        initargs, kwargs = self.parse_args(init_args)
        if len(initargs):
            freq = initargs[0]
        else:
            freq = 0

        self.dsp_inlets = [1, 2]
        self.dsp_outlets = [0]
        self.dsp_init("phasor~", _sig_1=float(freq))
Ejemplo n.º 9
0
    def __init__(self, init_type, init_args, patch, scope, name):
        Processor.__init__(self, 2, 2, init_type, init_args, patch, scope, name)
        initargs, kwargs = self.parse_args(init_args)

        steps = []
        if len(initargs):
            steps = self.convert_steps(initargs[0])

        self.dsp_inlets = [1]
        self.dsp_outlets = [0, 1]
        self.dsp_init("stepseq~", steps=steps, trig_ms=10, threshold=0.5)
Ejemplo n.º 10
0
    def __init__(self, init_type, init_args, patch, scope, name):
        Processor.__init__(self, 2, 2, init_type, init_args, patch, scope,
                           name)
        initargs, kwargs = self.parse_args(init_args)

        steps = []
        if len(initargs):
            steps = self.convert_steps(initargs[0])

        self.dsp_inlets = [1]
        self.dsp_outlets = [0, 1]
        self.dsp_init("stepseq~", steps=steps, trig_ms=10, threshold=0.5)
Ejemplo n.º 11
0
    def __init__(self, init_type, init_args, patch, scope, name):
        Processor.__init__(self, 2, 1, init_type, init_args, patch, scope, name)
        initargs, kwargs = self.parse_args(init_args)

        if len(initargs):
            size = initargs[0]
        else:
            size = 0

        self.dsp_inlets = [0]
        self.dsp_outlets = [0]
        self.dsp_init(self.dsp_type)
Ejemplo n.º 12
0
    def __init__(self, init_type, init_args, patch, scope, name):
        Processor.__init__(self, 3, 1, init_type, init_args, patch, scope,
                           name)
        initargs, kwargs = self.parse_args(init_args)
        if len(initargs):
            freq = initargs[0]
        else:
            freq = 0

        self.dsp_inlets = [1, 2]
        self.dsp_outlets = [0]
        self.dsp_init("phasor~", _sig_1=float(freq))
Ejemplo n.º 13
0
    def __init__(self, init_type, init_args, patch, scope, name):
        Processor.__init__(self, 2, 1, init_type, init_args, patch, scope,
                           name)
        initargs, kwargs = self.parse_args(init_args)

        if len(initargs):
            size = initargs[0]
        else:
            size = 0

        self.dsp_inlets = [0, 1]
        self.dsp_outlets = [0]
        self.dsp_init(self.dsp_type, bufsize=size, _sig_1=size)
Ejemplo n.º 14
0
Archivo: arith.py Proyecto: wrl/mfp
    def __init__(self, init_type, init_args, patch, scope, name):
        self.arith_op = init_type

        Processor.__init__(self, 2, 1, init_type, init_args, patch, scope, name)
    
        const = 0.0
        initargs, kwargs = self.parse_args(init_args)
        if len(initargs):
            const = initargs[0] 

        self.dsp_inlets = [0, 1]
        self.dsp_outlets = [0]
        self.dsp_init(self.arith_op, _sig_1=const)
Ejemplo n.º 15
0
Archivo: osc.py Proyecto: wrl/mfp
    def __init__(self, init_type, init_args, patch, scope, name):
        Processor.__init__(self, 3, 1, init_type, init_args, patch, scope, name)
        initargs, kwargs = self.parse_args(init_args)
        freq = 0
        ampl = 1.0 

        if len(initargs) > 0:
            freq = initargs[0]
        if len(initargs) > 1:
            ampl = initargs[1]

        self.dsp_inlets = [1, 2]
        self.dsp_outlets = [0]
        self.dsp_init("osc~", _sig_1=float(freq), _sig_2=float(ampl))
Ejemplo n.º 16
0
    def __init__(self, init_type, init_args, patch, scope, name):
        Processor.__init__(self, 3, 1, init_type, init_args, patch, scope,
                           name)
        initargs, kwargs = self.parse_args(init_args)
        freq = 0
        ampl = 1.0

        if len(initargs) > 0:
            freq = initargs[0]
        if len(initargs) > 1:
            ampl = initargs[1]

        self.dsp_inlets = [1, 2]
        self.dsp_outlets = [0]
        self.dsp_init("osc~", _sig_1=float(freq), _sig_2=float(ampl))
Ejemplo n.º 17
0
    def __init__(self, init_type, init_args, patch, scope, name):
        Processor.__init__(self, 2, 1, init_type, init_args, patch, scope, name)
        initargs, kwargs = self.parse_args(init_args)

        if len(initargs):
            size = initargs[0] 
        else: 
            size = 0

        if len(initargs) > 1:
            bufsize = initargs[1]
        else:
            bufsize = max(size, self.DEFAULT_BUFSIZE)

        self.dsp_inlets = [0, 1]
        self.dsp_outlets = [0]
        self.dsp_init(self.dsp_type, bufsize=bufsize, _sig_1=size)
Ejemplo n.º 18
0
    def __init__(self, init_type, init_args, patch, scope, name):
        Processor.__init__(self, 2, 1, init_type, init_args, patch, scope,
                           name)
        initargs, kwargs = self.parse_args(init_args)

        if len(initargs):
            size = initargs[0]
        else:
            size = 0

        if len(initargs) > 1:
            bufsize = initargs[1]
        else:
            bufsize = max(size, self.DEFAULT_BUFSIZE)

        self.dsp_inlets = [0, 1]
        self.dsp_outlets = [0]
        self.dsp_init(self.dsp_type, bufsize=bufsize, _sig_1=size)
Ejemplo n.º 19
0
    def __init__(self, init_type, init_args, patch, scope, name):
        Processor.__init__(self, 4, 1, init_type, init_args, patch, scope, name)
        initargs, kwargs = self.parse_args(init_args)
        period = 2
        bitmask = 1
        thresh = 0.25

        if len(initargs) > 0:
            period = initargs[0]
        if len(initargs) > 1:
            bitmask = initargs[1]
        if len(initargs) > 2:
           thresh = initargs[2]

        self.dsp_inlets = [0]
        self.dsp_outlets = [0]
        self.dsp_init(
            "pulsesel~",
            bitmask=bitmask, period=period, threshold=thresh
        )
Ejemplo n.º 20
0
Archivo: biquad.py Proyecto: wrl/mfp
    def __init__(self, bq_func, init_type, init_args, patch, scope, name): 
        Processor.__init__(self, 3, 1, init_type, init_args, patch, scope, name)
        initargs, kwargs = self.parse_args(init_args)

        if len(initargs) > 0:
            self.freq = initargs[0]
        else:
            self.freq = 0

        if len(initargs) > 1:
            self.q = initargs[1]
        else:
            self.q = 0.707 

        self.biquad_thunk = bq_func 
        self.biquad_params = self.biquad_thunk(self.freq, self.q) 

        self.hot_inlets = [0, 1, 2]
        self.dsp_inlets = [0]
        self.dsp_outlets = [0]
        self.dsp_init("biquad~", **self.biquad_params)
Ejemplo n.º 21
0
    def __init__(self, bq_func, init_type, init_args, patch, scope, name):
        Processor.__init__(self, 3, 1, init_type, init_args, patch, scope,
                           name)
        initargs, kwargs = self.parse_args(init_args)

        if len(initargs) > 0:
            self.freq = initargs[0]
        else:
            self.freq = 0

        if len(initargs) > 1:
            self.q = initargs[1]
        else:
            self.q = 0.707

        self.biquad_thunk = bq_func
        self.biquad_params = self.biquad_thunk(self.freq, self.q)

        self.hot_inlets = [0, 1, 2]
        self.dsp_inlets = [0]
        self.dsp_outlets = [0]
        self.dsp_init("biquad~", **self.biquad_params)
Ejemplo n.º 22
0
    def __init__(self, init_type, init_args, patch, scope, name):
        initargs, kwargs = patch.parse_args(init_args)

        if len(initargs):
            size = initargs[0] * MFPApp().samplerate / 1000.0
        if len(initargs) > 1:
            channels = initargs[1]
        else:
            channels = 1

        Processor.__init__(self, channels, channels + 2, init_type, init_args,
                           patch, scope, name)

        self.buf_id = None
        self.channels = 0
        self.size = 0
        self.rate = None
        self.buf_offset = 0

        self.shm_obj = None

        self.dsp_inlets = list(range(channels))
        self.dsp_outlets = list(range(channels))
        self.dsp_init("buffer~", size=size, channels=channels)
Ejemplo n.º 23
0
    def __init__(self, init_type, init_args, patch, scope, name):
        initargs, kwargs = patch.parse_args(init_args)

        if len(initargs):
            size = initargs[0]*MFPApp().samplerate/1000.0
        if len(initargs) > 1:
            channels = initargs[1]
        else:
            channels = 1

        Processor.__init__(self, channels, channels+2, init_type, init_args, 
                           patch, scope, name)

        self.buf_id = None
        self.channels = 0
        self.size = 0
        self.rate = None
        self.buf_offset = 0

        self.shm_obj = None

        self.dsp_inlets = list(range(channels))
        self.dsp_outlets = list(range(channels))
        self.dsp_init("buffer~", size=size, channels=channels)
Ejemplo n.º 24
0
    def __init__(self, init_type, init_args, patch, scope, name):
        Processor.__init__(self, 4, 1, init_type, init_args, patch, scope, name)
        initargs, kwargs = self.parse_args(init_args)
        freq = 0
        ampl = 1.0
        pw = 0.5
        loval = -1.0
        hival = 1.0
        mode = 0

        if init_type == 'gate~':
            loval = 0.0

        if len(initargs) > 0:
            freq = initargs[0]
        if len(initargs) > 1:
            ampl = initargs[1]
        if len(initargs) > 2:
            pw = initargs[2]
        if len(initargs) > 3:
            if initargs[3] == 'ms':
                mode = 1
            elif initargs[3] == 'frac':
                mode = 0

        self.dsp_inlets = [1, 2, 3]
        self.dsp_outlets = [0]
        self.dsp_init(
            "pulse~",
            _sig_1=float(freq),
            _sig_2=float(ampl),
            _sig_3=float(pw),
            hival=hival,
            loval=loval,
            pw_mode=mode
        )
Ejemplo n.º 25
0
 def __init__(self, patch, tag):
     self.patch = Patch('default', '', None, None, 'default')
     self.tag = tag
     Processor.__init__(self, 1, 4, "fanout", '', patch, None, None)
Ejemplo n.º 26
0
Archivo: latency.py Proyecto: wrl/mfp
    def __init__(self, init_type, init_args, patch, scope, name):
        Processor.__init__(self, 1, 2, init_type, init_args, patch, scope, name)

        self.callback = MFPApp().add_callback("latency", self._latency_cb)
        self.outlet_order = [1, 0]
Ejemplo n.º 27
0
 def __init__(self, init_type, init_args, patch, scope, name):
     Processor.__init__(self, 1, 0, init_type, init_args, patch, scope,
                        name)
     self.dsp_inlets = [0]
     self.dsp_outlets = [0]
     self.dsp_init("ext1~")
Ejemplo n.º 28
0
Archivo: latency.py Proyecto: wrl/mfp
 def delete(self):
     if self.callback is not None:
         MFPApp().remove_callback(self.callback)
     Processor.delete(self)
Ejemplo n.º 29
0
 def __init__(self, init_type, init_args, patch, scope, name):
     Processor.__init__(self, 1, 0, init_type, init_args, patch, scope, name)
     self.dsp_inlets = [0]
     self.dsp_outlets = [0] 
     self.dsp_init("ext1~")
Ejemplo n.º 30
0
 def __init__(self, patch, limit=0):
     self.limit = limit
     self.lastval = None
     Processor.__init__(self, 1, 1, 'limitedincr', '', patch, None, None)
Ejemplo n.º 31
0
    def __init__(self, init_type, init_args, patch, scope, name):
        Processor.__init__(self, 1, 2, init_type, init_args, patch, scope, name)

        self.callback = MFPApp().add_callback("latency", self._latency_cb)
        self.outlet_order = [1, 0]
Ejemplo n.º 32
0
 def delete(self):
     if self.callback is not None:
         MFPApp().remove_callback(self.callback)
     Processor.delete(self)