Пример #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)
Пример #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~")
Пример #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~")
Пример #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]
Пример #5
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]
Пример #6
0
Файл: line.py Проект: 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)
Пример #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]
Пример #8
0
Файл: phasor.py Проект: 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))
Пример #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)
Пример #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)
Пример #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)
Пример #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))
Пример #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)
Пример #14
0
Файл: arith.py Проект: 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)
Пример #15
0
Файл: osc.py Проект: 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))
Пример #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))
Пример #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)
Пример #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)
Пример #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
        )
Пример #20
0
Файл: biquad.py Проект: 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)
Пример #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)
Пример #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)
Пример #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)
Пример #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
        )
Пример #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)
Пример #26
0
Файл: latency.py Проект: 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]
Пример #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~")
Пример #28
0
Файл: latency.py Проект: wrl/mfp
 def delete(self):
     if self.callback is not None:
         MFPApp().remove_callback(self.callback)
     Processor.delete(self)
Пример #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~")
Пример #30
0
 def __init__(self, patch, limit=0):
     self.limit = limit
     self.lastval = None
     Processor.__init__(self, 1, 1, 'limitedincr', '', patch, None, None)
Пример #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]
Пример #32
0
 def delete(self):
     if self.callback is not None:
         MFPApp().remove_callback(self.callback)
     Processor.delete(self)