Beispiel #1
0
    def __init__(self, address, ordinal):
        agent.Agent.__init__(self,
                             signature=version,
                             names='control voltage calibration',
                             ordinal=ordinal)

        self.domain = piw.clockdomain_ctl()

        self[1] = atom.Atom(names='outputs')
        self[1][1] = bundles.Output(1, False, names='voltage output')
        self[1][2] = bundles.Output(2, False, names='calibration output')
        self.output = bundles.Splitter(self.domain, self[1][1], self[1][2])

        self.cv_calibration = cv_calibration_native.cv_calibration(
            self.output.cookie(), self.domain)

        self.input = bundles.VectorInput(self.cv_calibration.cookie(),
                                         self.domain,
                                         signals=(1, ))

        self[2] = atom.Atom(names='inputs')
        self[2][1] = atom.Atom(domain=domain.BoundedFloat(0, 96000, rest=0),
                               names="frequency input",
                               policy=self.input.vector_policy(1, False))

        self.add_verb2(1, 'calibrate([],None)', callback=self.__calibrate)
Beispiel #2
0
 def __init__(self,
              atom,
              data_domain,
              init,
              transient,
              handler,
              stream_policy=None,
              clock=True):
     self.__stream_policy = stream_policy or ThrottleStreamPolicy(500)
     self.__handler = handler
     self.__slow_handler = utils.fastchange(self.__handler)
     self.__ctl_handler = piw.change2(
         self.__slow_handler,
         piw.slowchange(utils.changify(self.__control)))
     self.__clock_domain = piw.clockdomain_ctl()
     self.__clock_domain.set_source(piw.makestring('*', 0L))
     self.__clock = piw.clocksink()
     self.__clock_domain.sink(self.__clock, 'FastPolicy')
     self.__upstream = None
     self.__backend = None
     self.__correlator = None
     self.__ctrl = None
     ConnectablePolicyImpl.__init__(self, atom, data_domain, init, clock,
                                    node.Server(transient=transient), False)
     self.data_node().set_change_handler(self.__slow_handler)
     self.data_node().set_data(self.get_domain().value2data(init))
Beispiel #3
0
    def __init__(self, address, ordinal):
        agent.Agent.__init__(self,
                             names='midi output',
                             signature=version,
                             container=3)
        self.set_property_long('cordinal', ordinal)

        self.domain = piw.clockdomain_ctl()
        self.domain.set_source(piw.makestring('*', 0))
        self[1] = OutputMidiPort(self.domain)

        # midi input vector, merge down multiple MIDI input streams
        self.input = bundles.VectorInput(self[1].cookie(),
                                         self.domain,
                                         signals=(1, ))
        self[2] = atom.Atom(domain=domain.Aniso(),
                            names="midi input",
                            policy=self.input.vector_policy(1, False))

        # self[3] is verb container

        # choose verb for choosing an output MIDI port
        self.add_verb2(
            1,
            'choose([],None,role(None,[ideal([~server,midiport]),singular]))',
            self.__chooseport)

        self.set_ordinal(ordinal)
    def __init__(self, address, ordinal):
        agent.Agent.__init__(self,
                             signature=version,
                             names='sawtooth oscillator',
                             ordinal=ordinal)
        self.domain = piw.clockdomain_ctl()

        self[1] = bundles.Output(1, True, names='audio output')

        self.output = bundles.Splitter(self.domain, self[1])
        self.osc = synth_native.sawtooth(self.output.cookie(), self.domain)
        self.input = bundles.VectorInput(self.osc.cookie(),
                                         self.domain,
                                         signals=(1, 2, 4))

        self[2] = atom.Atom(domain=domain.BoundedFloat(0, 1),
                            init=0,
                            names='volume input',
                            policy=self.input.local_policy(
                                1, policy.IsoStreamPolicy(1, 0, 0)))
        self[3] = atom.Atom(domain=domain.BoundedFloat(0, 96000, rest=440),
                            names='frequency input',
                            policy=self.input.merge_policy(2, False))
        self[4] = atom.Atom(init=0.0,
                            domain=domain.BoundedFloat(-1200, 1200),
                            names='detune input',
                            policy=self.input.merge_policy(4, False))
Beispiel #5
0
    def __init__(self, address, ordinal):
        agent.Agent.__init__(self,
                             signature=version,
                             names='labeler',
                             ordinal=ordinal)

        self.domain = piw.clockdomain_ctl()

        self[1] = atom.Atom(
            domain=domain.Aniso(hints=(logic.make_term('continuous'), )),
            names='controller output',
            policy=atom.readonly_policy())

        self[2] = atom.Atom(domain=domain.String(),
                            init='Label',
                            names='label category',
                            policy=atom.default_policy(self.__set_category))
        self[3] = atom.Atom(domain=domain.String(),
                            init='',
                            names='label',
                            policy=atom.default_policy(self.__set_label))

        self.ctl_functor = piw.functor_backend(1, True)
        self.ctl_input = bundles.VectorInput(self.ctl_functor.cookie(),
                                             self.domain,
                                             signals=(1, ))
        self[4] = atom.Atom(domain=domain.Aniso(),
                            policy=self.ctl_input.vector_policy(1, False),
                            names='controller input')
        self.ctl_functor.set_functor(
            piw.pathnull(0),
            utils.make_change_nb(
                piw.slowchange(utils.changify(self.__controller_input))))

        self.__ctl = []
Beispiel #6
0
    def __init__(self, address, ordinal):
        agent.Agent.__init__(self,
                             signature=version,
                             names='rectangle oscillator',
                             ordinal=ordinal)
        self.domain = piw.clockdomain_ctl()

        self[1] = bundles.Output(1, True, names="audio output")

        self.output = bundles.Splitter(self.domain, self[1])
        self.osc = synth_native.rect(self.output.cookie(), self.domain)
        self.input = bundles.VectorInput(self.osc.cookie(),
                                         self.domain,
                                         signals=(1, 2, 3, 4))

        self[2] = atom.Atom(domain=domain.BoundedFloat(0, 1),
                            names="volume input",
                            policy=self.input.local_policy(
                                1, policy.IsoStreamPolicy(1, 0, 0)))
        self[3] = atom.Atom(domain=domain.BoundedFloat(0, 96000),
                            names="frequency input",
                            policy=self.input.merge_policy(2, False))
        self[4] = atom.Atom(domain=domain.BoundedFloat(0.1, 0.9, rest=0.5),
                            names="pulse width input",
                            policy=self.input.merge_policy(3, False))
        self[5] = atom.Atom(domain=domain.BoundedFloat(-1200, 1200),
                            names='detune input',
                            policy=self.input.merge_policy(4, False))
    def __init__(self, address, ordinal):
        agent.Agent.__init__(self,
                             signature=version,
                             names='frequency detector',
                             ordinal=ordinal)

        self.domain = piw.clockdomain_ctl()

        self[1] = atom.Atom(names='outputs')
        self[1][1] = bundles.Output(1, False, names='frequency output')
        self.output = bundles.Splitter(self.domain, self[1][1])

        self.frequency_detector = frequency_detector_native.frequency_detector(
            self.output.cookie(), self.domain)

        self.input = bundles.VectorInput(self.frequency_detector.cookie(),
                                         self.domain,
                                         signals=(1, ))

        self[2] = atom.Atom(names='inputs')
        self[2][1] = atom.Atom(domain=domain.BoundedFloat(0, 1),
                               names="audio input",
                               policy=self.input.vector_policy(1, True))

        self[3] = atom.Atom(domain=domain.BoundedFloat(0, 1),
                            init=0.01,
                            policy=atom.default_policy(self.__threshold),
                            names='threshold')
        self[4] = atom.Atom(domain=domain.BoundedInt(5, 20),
                            init=10,
                            policy=atom.default_policy(self.__buffer_count),
                            names='buffer count')
    def __init__(self,address,ordinal):
        agent.Agent.__init__(self, signature=version, names='system input events', ordinal=ordinal)

        self.domain = piw.clockdomain_ctl()

        self.sysin_events = sysin_events_native.sysin_events(self.domain)

        self.__input = bundles.VectorInput(self.sysin_events.mouse_input(), self.domain, signals=(1,2,3,4))

        self[1] = atom.Atom(names='mouse inputs')
        self[1][1] = atom.Atom(domain=domain.BoundedFloat(-1,1), names="mouse horizontal input", policy=self.__input.vector_policy(1,True))
        self[1][2] = atom.Atom(domain=domain.BoundedFloat(-1,1), names="mouse vertical input", policy=self.__input.vector_policy(2,True))
        self[1][3] = atom.Atom(domain=domain.BoundedFloat(-1,1), names="left mouse button input", policy=self.__input.vector_policy(3,True))
        self[1][4] = atom.Atom(domain=domain.BoundedFloat(-1,1), names="right mouse button input", policy=self.__input.vector_policy(4,True))

        self[2] = KeyPresses(self)
        
        self[3] = atom.Atom(names='velocity curve controls')
        self[3][1] = atom.Atom(domain=domain.BoundedInt(1,1000), init=4, names="velocity sample", policy=atom.default_policy(self.__set_samples))
        self[3][2] = atom.Atom(domain=domain.BoundedFloat(0.1,10), init=4, names="velocity curve", policy=atom.default_policy(self.__set_curve))
        self[3][3] = atom.Atom(domain=domain.BoundedFloat(0.1,10), init=4, names="velocity scale", policy=atom.default_policy(self.__set_scale))

        self[4] = atom.Atom(names='mouse controls')
        self[4][1] = atom.Atom(domain=domain.BoundedFloat(-10,10), init=2.0, policy=atom.default_policy(self.__set_mouse_x_scale), names='mouse horizontal scale')
        self[4][2] = atom.Atom(domain=domain.BoundedFloat(-10,10), init=-1.0, policy=atom.default_policy(self.__set_mouse_y_scale), names='mouse vertical scale')
        self[4][3] = atom.Atom(domain=domain.BoundedFloat(0,1), init=0.1, policy=atom.default_policy(self.__set_mouse_x_deadband), names='mouse horizontal deadband')
        self[4][4] = atom.Atom(domain=domain.BoundedFloat(0,1), init=0.1, policy=atom.default_policy(self.__set_mouse_y_deadband), names='mouse vertical deadband')
        self[4][5] = atom.Atom(domain=domain.BoundedFloat(-1,1), names='mouse button threshold 1', init=0.0, policy=atom.default_policy(self.__set_mouse_button_threshold1))
        self[4][6] = atom.Atom(domain=domain.BoundedFloat(-1,1), names='mouse button threshold 2', init=0.0, policy=atom.default_policy(self.__set_mouse_button_threshold2))
        self[4][7] = atom.Atom(domain=domain.Bool(), names='mouse button velocity 1', init=False, policy=atom.default_policy(self.__set_mouse_button_velocity1))
        self[4][8] = atom.Atom(domain=domain.Bool(), names='mouse button velocity 2', init=False, policy=atom.default_policy(self.__set_mouse_button_velocity2))

        self.add_verb2(1,'press([],~a,role(None,[matches([key])]),role(as,[numeric]))',create_action=self.__press_key)
        self.add_verb2(2,'press([],~a,role(None,[matches([character])]),role(as,[abstract]))',create_action=self.__press_character)
        self.add_verb2(3,'move([],~a,role(None,[matches([mouse])]),role(to,[numeric]),role(with,[numeric]))',create_action=self.__move_mouse)
Beispiel #9
0
    def __init__(self, address, ordinal):
        agent.Agent.__init__(self,
                             signature=version,
                             names='alpha manager',
                             protocols='has_subsys',
                             ordinal=ordinal)
        self.domain = piw.clockdomain_ctl()
        self.domain.set_source(piw.makestring('*', 0L))

        self.__thing = piw.thing()
        piw.tsd_thing(self.__thing)
        self.__thing.set_slow_dequeue_handler(utils.changify(self.__dequeue))

        self.__base = dict()

        self.__enum = []

        lsf = lambda c: picross.make_string_functor(
            utils.make_locked_callable(c))
        self.__enum.append(
            picross.enumerator(0xbeca, 0x0102, lsf(self.add_alpha2keyboard)))
        self.__enum.append(
            picross.enumerator(0xbeca, 0x0103, lsf(self.add_taukeyboard)))
        self.__enum.append(
            picross.enumerator(0x2139, 0x0002,
                               lsf(self.download_base_station)))
        self.__enum.append(
            picross.enumerator(0x2139, 0x0003, lsf(self.download_psu)))
        self.__enum.append(
            picross.enumerator(0x2139, 0x0104, lsf(self.add_base_station),
                               lsf(self.del_base_station)))
        self.__enum.append(
            picross.enumerator(0x2139, 0x0105, lsf(self.add_base_station),
                               lsf(self.del_base_station)))
Beispiel #10
0
    def __init__(self, address, ordinal):
        agent.Agent.__init__(self, signature=version,names='clarinet oscillator',ordinal=ordinal)
        self.domain = piw.clockdomain_ctl()

        self[1] = bundles.Output(1,True,names="audio output")

        self.output = bundles.Splitter(self.domain, self[1])
        self.inst = stk_native.clarinet(self.output.cookie(),self.domain)
        self.input = bundles.VectorInput(self.inst.cookie(), self.domain,signals=(1,2,3,4,5,6,7,8,9))

        param=(T('inc',0.02),T('biginc',0.2),T('control','updown'))
        self[2] = atom.Atom()
        self[2][1] = atom.Atom(names='activation input', domain=domain.BoundedFloat(0,1), policy=self.input.merge_policy(1,False))
        self[2][2] = atom.Atom(names='frequency input', domain=domain.BoundedFloat(1,96000), policy=self.input.vector_policy(2,False))
        self[2][3] = atom.Atom(names='pressure input', domain=domain.BoundedFloat(0,1), policy=self.input.merge_policy(3,False))
        
        # TODO: remove
        #self[2][4] = atom.Atom(names='reed stiffness input', domain=domain.BoundedFloat(0,1,hints=param), init=0.5, policy=self.input.merge_policy(4,False))

        self[2][5] = atom.Atom(names='noise gain input', domain=domain.BoundedFloat(0,1,hints=param), init=0.25, policy=self.input.merge_policy(5,False))

        # TODO: remove
        #self[2][6] = atom.Atom(names='vibrato frequency input', domain=domain.BoundedFloat(0,1,hints=param), init=0.2, policy=self.input.merge_policy(6,False), protocols='explicit')
        # TODO: remove
        #self[2][7] = atom.Atom(names='vibrato gain input', domain=domain.BoundedFloat(0,1,hints=param), init=0, policy=self.input.merge_policy(7,False))
        
        self[2][8] = atom.Atom(names='pitch time input', domain=domain.BoundedFloat(0,100000,hints=param), init=10, policy=self.input.merge_policy(8,False))
        self[2][9] = atom.Atom(names='minimum frequency', domain=domain.BoundedFloat(0.1,20,hints=param), init=20, policy=self.input.merge_policy(9,False))
Beispiel #11
0
    def __init__(self, address, ordinal):
        #
        agent.Agent.__init__(self, signature=version, names='scale illuminator', ordinal=ordinal)

        self.domain = piw.clockdomain_ctl()

        self.domain.set_source(piw.makestring('*',0))

        self[1] = atom.Atom(names='outputs')
        self[1][1] = bundles.Output(OUT_LIGHT, False, names='light output', protocols='revconnect')
        self.output = bundles.Splitter(self.domain, self[1][1])
        self.illuminator = scale_illuminator(self.domain, self.output.cookie())
        
        th=(T('stageinc',1),T('inc',1),T('biginc',1),T('control','updown'))
        sh=(T('choices','[0,2,4,5,7,9,11,12]','[0,1,2,3,4,5,6,7,8,9,10,11,12]','[0,2,4,6,8,10,12]','[0,2,3,5,7,8,10,12]','[0,3,5,6,7,10,12]', '[0,2,3,6,7,8,11,12]','[0,3,5,7,10,12]','[0,2,4,7,9,12]'), T('control','selector'))

        self.control_input = bundles.VectorInput(self.illuminator.cookie(), self.domain, signals=(1,))
        self[2] = atom.Atom(names="inputs")
        self[2][1] =atom.Atom(domain=domain.Aniso(),policy=self.control_input.vector_policy(1,False),names='controller input')
        self[2][2] = atom.Atom(domain=domain.String(hints=sh), policy=atom.default_policy(self.__change_scale), names='scale',protocols='bind set',container=(None,'scale',self.verb_container()))
        self[2][2].add_verb2(1,'set([],~a,role(None,[instance(~self)]),role(to,[ideal([None,scale]),singular]))',callback=self.__tune_scale)
        self[2][3] = atom.Atom(domain=domain.BoundedFloatOrNull(0,12,hints=th),init=None,policy=atom.default_policy(self.__change_tonic),names='tonic',protocols='bind set',container=(None,'tonic',self.verb_container()))
        self[2][3].add_verb2(1,'set([],~a,role(None,[instance(~self)]),role(to,[ideal([None,note]),singular]))',callback=self.__tune_tonic)
        self[2][4] = atom.Atom(domain=domain.Bool(),init=False,policy=atom.default_policy(self.__change_inverted),names='inverted')
        self[2][5] = atom.Atom(domain=domain.Bool(),init=True,policy=atom.default_policy(self.__change_root_light),names='root')

        self.add_verb2(3,'clear([],None,role(None,[matches([scale])]))', callback=self.__clear_scale )
Beispiel #12
0
    def __init__(self, address, ordinal):
        agent.Agent.__init__(self,names='midi input',signature=version,container=6,ordinal=ordinal)

        self.domain = piw.clockdomain_ctl()
        self.domain.set_source(piw.makestring('*',0))
        self.set_private(node.Server(value=piw.makestring('[]',0), change=self.__settrim))

        self[1] = bundles.Output(1,False,names='key output')
        self[2] = bundles.Output(1,False,names='continuous controller output')
        self[8] = bundles.Output(1,False,names='program change output')
        self[10] = bundles.Output(1,False,names='trigger output')

        self.key_output = bundles.Splitter(self.domain,self[1])
        self.cc_output = bundles.Splitter(self.domain,self[2])
        self.programchange_output = bundles.Splitter(self.domain,self[8])
        self.trigger_output = bundles.Splitter(self.domain,self[10])

        self[6] = bundles.Output(1,False,names='midi output')
        self[7] = bundles.Output(2,False,names='midi clock output')
        self.midi_output = bundles.Splitter(self.domain,self[6],self[7])

        self[3] = VirtualKey()
        self[4] = VirtualCC()
        self[9] = VirtualProgramChange()
        self[11] = VirtualTrigger()
        self[5] = MidiPort(self.key_output.cookie(),self.cc_output.cookie(),self.programchange_output.cookie(),self.trigger_output.cookie(),self.midi_output.cookie())

        self.add_verb2(2,'choose([],None,role(None,[ideal([~server,midiport]),singular]))',self.__chooseport)
        self.add_verb2(3,'invert([],None,role(None,[cmpdsc(~(s)"#2")]))', self.__invert);
        self.add_verb2(4,'minimise([],None,role(None,[cmpdsc(~(s)"#2")]),option(to,[numeric]))', self.__setmin);
        self.add_verb2(5,'maximise([],None,role(None,[cmpdsc(~(s)"#2")]),option(to,[numeric]))', self.__setmax);

        self.set_ordinal(ordinal)
Beispiel #13
0
    def __init__(self, address, ordinal):
        agent.Agent.__init__(self,
                             signature=version,
                             names='rig',
                             ordinal=ordinal,
                             protocols='rigouter')

        self.file_name = 'rig%d' % ordinal
        self.inner_name = '%s.%s' % (piw.tsd_scope(), self.file_name)
        self.__inner_agent = InnerAgent(self)
        self.__domain = piw.clockdomain_ctl()

        self.set_property_string('rig', self.file_name)

        self[2] = OutputList(None)
        self[3] = InputList(None, True)
        self[3].set_output_peer(self.__inner_agent[2])
        self.__inner_agent[3].set_output_peer(self[2])
        self[4] = OuterGroupList()
        self.__inner_agent[4].set_outer_peer(self[4])

        self.add_verb2(
            1,
            'create([],None,role(None,[abstract,matches([input])]),option(called,[abstract]))',
            self.__create_input)
        self.add_verb2(
            2,
            'create([],None,role(None,[abstract,matches([output])]),option(called,[abstract]))',
            self.__create_output)
Beispiel #14
0
    def __init__(self, address, ordinal):
        agent.Agent.__init__(self, signature=version,names='ranger',ordinal=ordinal)

        self[2] = atom.Atom()
        self[2][1] = bundles.Output(1,False,names='output')

        self.domain = piw.clockdomain_ctl()
        self.domain.set_source(piw.makestring('*',0))
        self.output = bundles.Splitter(self.domain,*self[2].values())
        self.ranger = piw.ranger(self.domain,self.output.cookie())

        self.ctl_input = bundles.ScalarInput(self.ranger.ctl_cookie(), self.domain,signals=(1,2,3))
        self.data_input = bundles.VectorInput(self.ranger.data_cookie(), self.domain,signals=(1,))

        self[1] = atom.Atom()
        self[1][1]=atom.Atom(domain=domain.BoundedFloat(-10000000,10000000),init=-1,policy=self.ctl_input.policy(1,False),names='minimum')
        self[1][2]=atom.Atom(domain=domain.BoundedFloat(-10000000,10000000),init=1,policy=self.ctl_input.policy(2,False),names='maximum')
        self[1][3]=atom.Atom(domain=domain.BoundedFloat(-10000000,10000000),init=0,policy=self.ctl_input.policy(3,False),names='rest')
        self[1][4]=atom.Atom(domain=domain.BoundedFloat(-1,1),init=0,policy=self.data_input.vector_policy(1,False),names='input')

        self[3]=atom.Atom(domain=domain.Bool(),policy=atom.default_policy(self.__setsticky),names='sticky')
        self[4]=atom.Atom(domain=domain.BoundedFloat(-10,10),policy=atom.default_policy(self.__setcurve),names='curve')
        self[5]=atom.Atom(domain=domain.Bool(),policy=atom.default_policy(self.__setmono),names='mono')
        self[6]=atom.Atom(domain=domain.Bool(),init=True,policy=atom.default_policy(self.__setabsolute),names='absolute')

        self.ranger.set_absolute(True)
        self.add_verb2(1,'reset([],None)',self.__reset)
    def __init__(self, address, ordinal):
        agent.Agent.__init__(self,
                             signature=version,
                             names='noise oscillator',
                             ordinal=ordinal)

        self.domain = piw.clockdomain_ctl()

        # One Iso output for the noise
        self[1] = atom.Atom(names='outputs')
        self[1][1] = bundles.Output(1, True, names='audio output')
        self.output = bundles.Splitter(self.domain, self[1][1])

        self.osc = synth_noise.noise(self.output.cookie(), self.domain)

        # Two Iso inputs, volume, and filter freq
        self.input = bundles.VectorInput(self.osc.cookie(),
                                         self.domain,
                                         signals=(1, 2))
        self[2] = atom.Atom(names='inputs')
        self[2][1] = atom.Atom(domain=domain.BoundedFloat(0, 1),
                               names="volume input",
                               policy=self.input.local_policy(
                                   1, policy.IsoStreamPolicy(1, 0, 0)))
        self[2][2] = atom.Atom(domain=domain.BoundedFloat(0, 20000),
                               names="filter frequency input",
                               policy=self.input.merge_policy(2, True))
Beispiel #16
0
    def __init__(self, address, ordinal):
        agent.Agent.__init__(self,signature=version,names='clicker',container=3,ordinal=ordinal)
        self.domain = piw.clockdomain_ctl()
        accent = wav_resource('accent.wav')
        beat = wav_resource('beat.wav')

        self[1] = bundles.Output(1,True,names='audio output')
        self.output = bundles.Splitter(self.domain, self[1])
        self.clicker = loop_native.clicker(self.output.cookie(),self.domain,accent,beat)
        self.input = bundles.ScalarInput(self.clicker.cookie(), self.domain, signals=(1,2))

        self[2] = atom.Atom()
        self[2][1] = atom.Atom(domain=domain.Aniso(),policy=self.input.policy(1,False),names='running input')
        self[2][2] = atom.Atom(domain=domain.Aniso(),policy=self.input.policy(2,False),names='bar beat input')

        self.add_verb2(1,'play([],None)',self.__play,status_action=self.__status)
        self.add_verb2(2,'play([un],None)',self.__unplay,status_action=self.__status)
        self.add_verb2(3,'play([toggle],None)',self.__toggle,status_action=self.__status)
        
        self[4]=bundles.Output(1,False,names='status output')
        self.light_output=bundles.Splitter(self.domain,self[4])
        self.lights=piw.lightsource(piw.change_nb(),0,self.light_output.cookie())
        self.lights.set_size(1)
        self.lights.set_status(1,const.status_inactive)
        self.__playstate = node.Server(value=piw.makebool(True,0),change=self.__playchanged)
        self.set_private(self.__playstate)
        self.__playing=False
Beispiel #17
0
    def __init__(self, address, ordinal):
        agent.Agent.__init__(self,signature=version,names='talker',container=5,ordinal=ordinal)

        self.add_mode2(4,'mode([],role(when,[singular,numeric]),option(using,[instance(~server)]))', self.__mode, self.__query, self.__cancel_mode, self.__attach_mode)
        self.add_mode2(7,'mode([],role(when,[singular,numeric]),role(called,[singular,numeric]),option(using,[instance(~server)]))', self.__cmode, self.__cquery, self.__cancel_mode, self.__attach_mode)
        self.add_verb2(1,'cancel([],None,role(None,[ideal([~server,event])]))', self.__cancel_verb)
        self.add_verb2(8,'cancel([],None,role(None,[singular,numeric]),role(called,[singular,numeric]))', self.__cancel_verb_called)
        self.add_verb2(5,'colour([],None,role(None,[singular,numeric]),role(to,[singular,numeric]))', self.__color_verb)
        self.add_verb2(6,'colour([],None,role(None,[singular,numeric]),role(to,[singular,numeric]),role(from,[singular,numeric]))', self.__all_color_verb)

        self.domain = piw.clockdomain_ctl()
        self.domain.set_source(piw.makestring('*',0))
        self.__size = 0

        self[1] = bundles.Output(1,False, names='light output',protocols='revconnect')
        self.light_output = bundles.Splitter(self.domain,self[1])
        self.light_convertor = piw.lightconvertor(self.light_output.cookie())
        self.light_aggregator = piw.aggregator(self.light_convertor.cookie(),self.domain)
        self.controller = piw.controller(self.light_aggregator.get_output(1),utils.pack_str(1))

        self.activation_input = bundles.VectorInput(self.controller.cookie(), self.domain,signals=(1,))

        self[2] = atom.Atom(domain=domain.BoundedFloat(0,1), policy=self.activation_input.local_policy(1,False),names='activation input')
        self[3] = atom.Atom(creator=self.__create,wrecker=self.__wreck)
        self[4] = PhraseBrowser(self.__eventbykey,self.__keylist)
Beispiel #18
0
    def __init__(self, address, ordinal):
        agent.Agent.__init__(self,
                             signature=version,
                             names='orb',
                             ordinal=ordinal)

        self.domain = piw.clockdomain_ctl()
        self.domain.set_source(piw.makestring('*', 0))

        self[2] = atom.Atom(names="outputs")
        self[2][1] = bundles.Output(1, False, names='angle output')
        self[2][2] = bundles.Output(2, False, names='radius output')

        self.output = bundles.Splitter(self.domain, *self[2].values())
        self.native = orb(self.domain, self.output.cookie())

        self.key_input = bundles.VectorInput(self.native.cookie(),
                                             self.domain,
                                             signals=(1, 2))

        self[1] = atom.Atom(names="inputs")

        self[1][1] = atom.Atom(domain=domain.BoundedFloat(-1, 1),
                               policy=self.key_input.vector_policy(1, False),
                               names='roll input')
        self[1][2] = atom.Atom(domain=domain.BoundedFloat(-1, 1),
                               policy=self.key_input.vector_policy(2, False),
                               names='yaw input')
Beispiel #19
0
    def __init__(self, address, ordinal):
        agent.Agent.__init__(self,
                             signature=version,
                             names='envelope',
                             ordinal=ordinal)

        self[2] = atom.Atom()
        self[2][2] = bundles.Output(2, False, names='pressure output')
        self[2][100] = bundles.Output(1, True, names='volume output')

        self.domain = piw.clockdomain_ctl()
        self.output = bundles.Splitter(self.domain, *self[2].values())
        self.adsr = synth_native.adsr(self.output.cookie(), self.domain)
        self.vel = piw.velocitydetect(self.adsr.cookie(), 2, 1)
        self.input = bundles.VectorInput(self.vel.cookie(),
                                         self.domain,
                                         signals=(1, 2, 8, 9, 10, 11),
                                         threshold=5)

        time = (T('inc', 0.01), T('biginc', 0.2), T('control', 'updown'))
        self[1] = atom.Atom()

        self[1][1] = atom.Atom(domain=domain.BoundedFloat(0, 1),
                               names='activation input',
                               policy=self.input.merge_policy(1, False))
        self[1][2] = atom.Atom(domain=domain.BoundedFloat(0, 1),
                               init=0,
                               policy=self.input.vector_policy(2, False),
                               names='pressure input')
        self[1][8] = atom.Atom(domain=domain.BoundedFloat(0, 60, hints=time),
                               init=0.01,
                               names="attack input",
                               policy=self.input.merge_policy(8, False))
        self[1][9] = atom.Atom(domain=domain.BoundedFloat(0, 60, hints=time),
                               init=0.05,
                               names="decay input",
                               policy=self.input.merge_policy(9, False))
        self[1][10] = atom.Atom(domain=domain.BoundedFloat(0, 1),
                                init=0,
                                policy=self.input.merge_policy(
                                    10, policy.IsoStreamPolicy(1, 0, 0)),
                                names='sustain input',
                                fuzzy='++++pressure')
        self[1][11] = atom.Atom(domain=domain.BoundedFloat(0, 60, hints=time),
                                init=0.25,
                                names="release input",
                                policy=self.input.merge_policy(11, False))

        self[3] = atom.Atom(domain=domain.BoundedInt(1, 1000),
                            init=4,
                            names="velocity sample",
                            policy=atom.default_policy(self.__set_samples))
        self[4] = atom.Atom(domain=domain.BoundedFloat(0.1, 10),
                            init=4,
                            names="velocity curve",
                            policy=atom.default_policy(self.__set_curve))
        self[5] = atom.Atom(domain=domain.BoundedFloat(0.1, 10),
                            init=4,
                            names="velocity scale",
                            policy=atom.default_policy(self.__set_scale))
    def __init__(self, address, ordinal):
        agent.Agent.__init__(self, signature=version, names='vu meter', ordinal=ordinal)

        self.domain = piw.clockdomain_ctl()

        self[1] = atom.Atom(names='outputs')
        self[1][1] = bundles.Output(OUT_LIGHT, True, names='light output', protocols='revconnect')
        self.output = bundles.Splitter(self.domain, self[1][1])

        self.native = vu_meter_native.vu_meter(self.output.cookie(), self.domain)

        self.input = bundles.VectorInput(self.native.cookie(), self.domain, signals=(IN_AUDIO,))

        self[2] = atom.Atom(names='inputs')
        self[2][1] = atom.Atom(domain=domain.BoundedFloat(-1,1), names="audio input", policy=self.input.vector_policy(IN_AUDIO,policy.IsoStreamPolicy(1,-1,0)))
        
        self[3] = atom.Atom(names='thresholds')
        self[3][1] = atom.Atom(domain=domain.BoundedFloat(-90,0), init=-40.0, policy=atom.default_policy(self.__signal_level), names='signal threshold')
        self[3][2] = atom.Atom(domain=domain.BoundedFloat(-90,0), init=-6.0, policy=atom.default_policy(self.__high_level), names='high threshold')
        self[3][3] = atom.Atom(domain=domain.BoundedFloat(-90,0), init=-1, policy=atom.default_policy(self.__clip_level), names='clip threshold')
        
        self[4] = atom.Atom(domain=domain.BoundedInt(1,100), init=5, policy=atom.default_policy(self.__size), names='size')
        self[5] = atom.Atom(domain=domain.BoundedFloat(0.0,30), init=5, policy=atom.default_policy(self.__clip_hold), names='clip hold')
        
        self.__send_parameters()
Beispiel #21
0
    def __init__(self, address, ordinal):
        agent.Agent.__init__(self,
                             signature=version,
                             names='shaper',
                             ordinal=ordinal)

        self[3] = bundles.Output(1, False, names='output')

        self.domain = piw.clockdomain_ctl()
        self.output = bundles.Splitter(self.domain, self[3])

        Z = piw.makefloat_bounded(1, 0, 0, 0, 0)

        self.compress = piw.function1(False, 1, 1, Z, self.output.cookie())
        self.compress.set_functor(synth_native.compressor(0))

        self.sharpen = piw.function1(False, 1, 1, Z, self.compress.cookie())
        self.sharpen.set_functor(synth_native.sharpener(0))

        self.input = bundles.VectorInput(self.sharpen.cookie(),
                                         self.domain,
                                         signals=(1, ))

        self[2] = atom.Atom(domain=domain.BoundedFloat(-1, 1),
                            policy=self.input.vector_policy(1, False),
                            names='input')

        self[1] = atom.Atom(names='controls')
        self[1][1] = atom.Atom(domain=domain.BoundedFloat(0, 1),
                               names="compression",
                               policy=atom.default_policy(self.__compression))
        self[1][2] = atom.Atom(domain=domain.BoundedFloat(0, 1),
                               names="sharpness",
                               policy=atom.default_policy(self.__sharpness))
Beispiel #22
0
    def __init__(self,address, ordinal):
        agent.Agent.__init__(self,signature=version,names='pico manager',protocols='has_subsys',ordinal=ordinal)
        self.domain = piw.clockdomain_ctl()
        self.domain.set_source(piw.makestring('*', 0L))

        self.load_enumerator = picross.enumerator(ezload.vendor,ezload.product,picross.make_string_functor(self.download_keyboard))
        self.load_enumerator2 = picross.enumerator(ezload.new_vendor,ezload.new_product,picross.make_string_functor(self.download_keyboard))
        self.add_enumerator = picross.enumerator(0x2139,0x0101,picross.make_string_functor(utils.make_locked_callable(self.add_keyboard)))
    def __init__(self, address, ordinal):
        agent.Agent.__init__(self,
                             signature=version,
                             names='midi program chooser',
                             ordinal=ordinal)

        self.domain = piw.clockdomain_ctl()

        self[1] = atom.Atom(names='outputs')
        self[1][1] = bundles.Output(1,
                                    False,
                                    names='light output',
                                    protocols='revconnect')
        self[1][2] = bundles.Output(2, False, names='midi output')
        self.output = bundles.Splitter(self.domain, self[1][1], self[1][2])

        self.chooser = midi_native.midi_pgm_chooser(self.output.cookie(),
                                                    self.domain)

        self.input = bundles.VectorInput(self.chooser.cookie(),
                                         self.domain,
                                         signals=(
                                             1,
                                             2,
                                         ))

        self[2] = atom.Atom(names='inputs')
        self[2][1] = atom.Atom(domain=domain.Aniso(),
                               policy=self.input.vector_policy(1, False),
                               names='key input')
        self[2][2] = atom.Atom(domain=domain.Aniso(),
                               policy=self.input.vector_policy(2, False),
                               names='controller input')

        self[3] = atom.Atom(domain=domain.Bool(),
                            init=False,
                            policy=atom.default_policy(self.__bankview),
                            names='bank view')
        self[4] = atom.Atom(domain=domain.BoundedInt(0, 127),
                            init=0,
                            policy=atom.default_policy(self.__program),
                            names='program')
        self[5] = atom.Atom(domain=domain.BoundedInt(0, 16),
                            init=1,
                            policy=atom.default_policy(self.__channel),
                            names='midi channel')
        self[6] = atom.Atom(domain=domain.BoundedInt(0, 127),
                            init=0,
                            policy=atom.default_policy(self.__window),
                            names='window')
        self[7] = atom.Atom(domain=domain.BoundedInt(0, 127),
                            init=0,
                            policy=atom.default_policy(self.__bank),
                            names='bank')

        self.add_verb2(1, 'reset([],None)', callback=self.__reset)
        self.add_verb2(2, 'up([],None)', callback=self.__up)
        self.add_verb2(3, 'down([],None)', callback=self.__down)
Beispiel #24
0
    def __init__(self, address, ordinal):
        agent.Agent.__init__(self, signature=version, names='illuminator', ordinal=ordinal)

        self.domain = piw.clockdomain_ctl()

        self[7] = bundles.Output(1, False, names='server status output')
        self.server_status_output = bundles.Splitter(self.domain, self[7])
        self.server_lights = piw.lightsource(piw.change_nb(), 0, self.server_status_output.cookie())
        self.server_lights.set_size(1)        

        self[1] = bundles.Output(1, False, names='light output',protocols='revconnect')
        self.output = bundles.Splitter(self.domain, self[1])

        self.status_buffer = piw.statusbuffer(self.output.cookie())
        self.status_buffer.autosend(False)
 
        self[2] = atom.Atom(domain=domain.String(), init='[]', names='physical light mapping', policy=atom.default_policy(self.__physical_light_map))
        self[3] = atom.Atom(domain=domain.String(), init='[]', names='musical light mapping', policy=atom.default_policy(self.__musical_light_map))
        self[5] = atom.Atom(domain=domain.BoundedIntOrNull(0,65535,0), names='server port', policy=atom.default_policy(self.__server_port))
        self[6] = atom.Atom(domain=domain.Bool(), init=False, names='server start', policy=atom.default_policy(self.__server_start))

        self.keyfunctor = piw.functor_backend(1, False)
        self.keyinput = bundles.VectorInput(self.keyfunctor.cookie(), self.domain, signals=(1,))
        self[4] = atom.Atom(domain=domain.Aniso(), policy=self.keyinput.vector_policy(1,False), names='key input')
        self.choicefunctor = utils.make_change_nb(piw.slowchange(utils.changify(self.__choice)))

        self[8] = StoredLightMaps(self)

        self.add_verb2(1,'clear([],None)', callback=self.__clear)
        self.add_verb2(2,'clear([],None,role(None,[matches([physical])]))', callback=self.__clear_physical)
        self.add_verb2(3,'clear([],None,role(None,[matches([musical])]))', callback=self.__clear_musical)
        self.add_verb2(4,'set([],None,role(None,[coord(physical,[column],[row])]),role(to,[abstract,matches([red])]))', callback=self.__set_physical)
        self.add_verb2(5,'set([],None,role(None,[coord(physical,[column],[row])]),role(to,[abstract,matches([green])]))', callback=self.__set_physical)
        self.add_verb2(6,'set([],None,role(None,[coord(physical,[column],[row])]),role(to,[abstract,matches([orange])]))', callback=self.__set_physical)
        self.add_verb2(7,'set([],None,role(None,[coord(musical,[course],[key])]),role(to,[abstract,matches([red])]))', callback=self.__set_musical)
        self.add_verb2(8,'set([],None,role(None,[coord(musical,[course],[key])]),role(to,[abstract,matches([green])]))', callback=self.__set_musical)
        self.add_verb2(9,'set([],None,role(None,[coord(musical,[course],[key])]),role(to,[abstract,matches([orange])]))', callback=self.__set_musical)
        self.add_verb2(10,'set([un],None,role(None,[coord(physical,[column],[row])]))', callback=self.__unset_physical)
        self.add_verb2(11,'set([un],None,role(None,[coord(musical,[course],[key])]))', callback=self.__unset_musical)
        self.add_verb2(12,'choose([],None,role(None,[matches([physical])]),role(as,[abstract,matches([red])]))',self.__choose_physical)
        self.add_verb2(13,'choose([],None,role(None,[matches([physical])]),role(as,[abstract,matches([green])]))',self.__choose_physical)
        self.add_verb2(14,'choose([],None,role(None,[matches([physical])]),role(as,[abstract,matches([orange])]))',self.__choose_physical)
        self.add_verb2(15,'choose([],None,role(None,[matches([musical])]),role(as,[abstract,matches([red])]))',self.__choose_musical)
        self.add_verb2(16,'choose([],None,role(None,[matches([musical])]),role(as,[abstract,matches([green])]))',self.__choose_musical)
        self.add_verb2(17,'choose([],None,role(None,[matches([musical])]),role(as,[abstract,matches([orange])]))',self.__choose_musical)
        self.add_verb2(18,'choose([un],None)',self.__unchoose)
        self.add_verb2(19,'start([],None,role(None,[matches([server])]))',self.__start_server,status_action=self.__status_server)
        self.add_verb2(20,'stop([],None,role(None,[matches([server])]))',self.__stop_server,status_action=self.__status_server)
        self.add_verb2(21,'start([toggle],None,role(None,[matches([server])]))',self.__toggle_server,status_action=self.__status_server)
        self.add_verb2(22,'load([],None,role(None,[concrete,singular,partof(~(a)#8)]))', self.__load_lightmap)
        self.add_verb2(23,'delete([],None,role(None,[concrete,singular,partof(~(a)#8)]))', self.__delete_lightmap)
        self.add_verb2(24,'save([],None,role(None,[abstract]))', self.__save_lightmap)
        self.add_verb2(25,'save([],None)', self.__save_lightmap)

        self.httpServer = None

        self.__update_server_status()
Beispiel #25
0
    def __init__(self,address,ordinal):
        agent.Agent.__init__(self, signature=version, names='blink manager', ordinal=ordinal)

        self.domain = piw.clockdomain_ctl()

        self.blink = blink_native.blink(self.domain)

        for i in range(1,17):
            self[i] = Blink(self,i)
Beispiel #26
0
    def __init__(self, address, ordinal):
        agent.Agent.__init__(self, signature=version, names='scaler',protocols='bind set',icon='plg_simple/scaler.png',container=5,ordinal=ordinal)
        self.domain = piw.clockdomain_ctl()
        self.domain.set_source(piw.makestring('*',0))

        self.__fixed = False
        self.set_private(node.Server(value=piw.makebool(False,0),change=self.__changefix))

        self[1] = atom.Atom()
        self[1][1] = bundles.Output(1,False,names='activation output', protocols='')
        self[1][2] = bundles.Output(2,False,names='pressure output', protocols='')
        self[1][3] = bundles.Output(3,False,names='roll output', protocols='')
        self[1][4] = bundles.Output(4,False,names='yaw output', protocols='')
        self[1][5] = bundles.Output(5,False,names='scale note output', protocols='')
        self[1][6] = bundles.Output(6,False,names='frequency output', protocols='')

        self.ctl = piw.scaler_controller()
        self.ctl_input = bundles.VectorInput(self.ctl.cookie(),self.domain,signals=(1,))

        self.output = bundles.Splitter(self.domain,*self[1].values())
        self.filter = piw.scaler(self.ctl,self.output.cookie(),cubic())
        self.input = bundles.VectorInput(self.filter.cookie(), self.domain,signals=(1,2,3,4,5,6,7,9,10,11,12,13,14,15,16,17))
        self.input.correlator.clocksink().add_upstream(self.ctl_input.correlator.clocksink())

        self[4]=atom.Atom()

        self[4][1]=atom.Atom(domain=domain.BoundedFloat(0,1),policy=self.input.merge_policy(1,False),names='activation input')
        self[4][2]=atom.Atom(domain=domain.BoundedFloat(0,1),policy=self.input.vector_policy(2,False),names='pressure input')
        self[4][3]=atom.Atom(domain=domain.BoundedFloat(-1,1),policy=self.input.merge_policy(3,False),names='roll input')
        self[4][4]=atom.Atom(domain=domain.BoundedFloat(-1,1),policy=self.input.merge_policy(4,False),names='yaw input')

        th=(T('inc',1),T('biginc',1),T('control','updown'))
        bh=(T('inc',1),T('biginc',1),T('control','updown'))
        sh=(T('choices','[0,2,4,5,7,9,11,12]','[0,1,2,3,4,5,6,7,8,9,10,11,12]','[0,2,4,6,8,10,12]','[0,2,3,5,7,8,10,12]','[0,3,5,6,7,10,12]', '[0,2,3,6,7,8,11,12]','[0,3,5,7,10,12]','[0,2,4,7,9,12]'), T('control','selector'))
        self[4][5]=atom.Atom(domain=domain.BoundedFloat(0,12,hints=th),policy=self.input.merge_policy(5,False),names='tonic input',protocols='bind set',container=(None,'tonic',self.verb_container()))
        self[4][6]=atom.Atom(domain=domain.BoundedFloat(-20,20,hints=bh),policy=self.input.merge_policy(6,False),names='base note input',protocols='bind')


        self[4][7]=atom.Atom(domain=domain.String(hints=sh),init='[0,2,4,5,7,9,11,12]',policy=self.input.merge_policy(7,False),names='scale input',protocols='bind set',container=(None,'scale',self.verb_container()))
        self[4][8]=atom.Atom(domain=domain.BoundedFloat(-1,1),policy=self.input.merge_policy(9,policy.LopassStreamPolicy(200,0.6)),names='k pitch bend input')
        self[4][9]=atom.Atom(domain=domain.BoundedFloat(-1,1),policy=self.input.merge_policy(10,False),names='global pitch bend input')
        self[4][10]=atom.Atom(domain=domain.BoundedFloat(0,72),init=1,policy=self.input.merge_policy(11,False),names='k bend range input',protocols='bind')
        self[4][11]=atom.Atom(domain=domain.BoundedFloat(0,72),init=12,policy=self.input.merge_policy(12,False),names='global bend range input',protocols='bind')
        self[4][12]=atom.Atom(domain=domain.Aniso(),policy=self.ctl_input.vector_policy(1,False),names='controller input')
        self[4][13]=atom.Atom(domain=domain.Bool(),policy=self.input.merge_policy(14,False),names='override',protocols='bind')
        self[4][14]=atom.Atom(domain=domain.BoundedFloat(-1,9,hints=th),init=3,policy=self.input.merge_policy(15,False),names='octave input',protocols='bind',container=(None,'octave',self.verb_container()))
        self[4][15]=atom.Atom(domain=domain.BoundedInt(1,4),init=2,policy=atom.default_policy(self.__set_curve),names='curve',protocols='bind')
        self[4][16]=atom.Atom(domain=domain.BoundedFloat(0,1000),policy=self.input.merge_nodefault_policy(16,False),names='key input')
        self[4][17]=atom.Atom(domain=domain.BoundedFloat(-10,10,hints=th),init=0,policy=self.input.merge_policy(17,False),names='relative octave input',protocols='bind')

        self.add_verb2(3,'choose([],None,role(none,[ideal([None,scale]),singular]))',callback=self.__tune_scale)
        self.add_verb2(5,'fix([],None)',callback=self.__fix)
        self.add_verb2(6,'fix([un],None)',callback=self.__unfix)

        self[4][5].add_verb2(1,'set([],~a,role(None,[instance(~self)]),role(to,[ideal([None,note]),singular]))',callback=self.__tune_tonic)
        self[4][7].add_verb2(2,'set([],~a,role(None,[instance(~self)]),role(to,[ideal([None,scale]),singular]))',callback=self.__tune_scale)
Beispiel #27
0
    def __init__(self, address, ordinal):
        self.domain = piw.clockdomain_ctl()
        agent.Agent.__init__(self, signature=version,names='drummer',icon='plg_loop/bass_drum_64.png',container=(4,'drummer',atom.VerbContainer(clock_domain=self.domain)),protocols='browse',ordinal=ordinal)

        self.updater = Updater()
        self.loopdb = loopdb.LoopDatabase()
        self.__timestamp = 0

        self[1] = atom.Atom()
        self[1][1] = bundles.Output(1,True,names='left audio output')
        self[1][2] = bundles.Output(2,True,names='right audio output')

        self.output = bundles.Splitter(self.domain,*self[1].values())
        self.summer = piw.stereosummer(self.domain,self.output.cookie(),2)
        self.aggregator = piw.aggregator(self.summer.cookie(),self.domain)

        self.clock_cloner = piw.sclone()
        self.input = bundles.ScalarInput(self.clock_cloner.cookie(), self.domain,signals=(1,2))
        self.input.add_upstream(self.verb_container().clock)

        self[2] = atom.Atom()
        self[2][1] = atom.Atom(domain=domain.BoundedFloat(0,100), policy=self.input.policy(1, False), names='song beat input')
        self[2][2] = atom.Atom(domain=domain.Bool(), init=False, policy=self.input.policy(2,False), names='running input')

        self[3] = LoopBrowser(self)

        vc = '[or([partof(~(s)"#5")],[numeric])]'

        self.add_verb2(1,'first([],None)',self.__first)
        self.add_verb2(2,'next([],None)',self.__next)
        self.add_verb2(3,'name([],None,role(None,[ideal([~server,loop]),singular]),role(to,[abstract]))',self.__name)
        self.add_verb2(4,'choose([],None,role(None,[ideal([~server,loop]),singular]))',self.__choose)
        self.add_verb2(5,'play([],None)',create_action=self.__play,clock=True)
        self.add_verb2(6,'play([un],None)',create_action=self.__unplay,clock=True)
        self.add_verb2(7,'add([],None,option(None,[ideal([~server,loop]),singular]))',self.__add)
        self.add_verb2(8,'remove([],None,option(None,%s))' % vc,self.__remove)
        self.add_verb2(9,'select([],None,role(None,%s))' % vc,self.__select)
        self.add_verb2(10,'play([],None,role(None,%s))' % vc,create_action=self.__play_voice,clock=True,status_action=self.__status)
        self.add_verb2(11,'play([un],None,role(None,%s))' % vc,create_action=self.__unplay_voice,clock=True,status_action=self.__status)
        self.add_verb2(15,'first([],None,role(None,%s))' % vc,self.__firstv)
        self.add_verb2(16,'next([],None,role(None,%s))' % vc,self.__nextv)
        self.add_verb2(17,'play([once],None,role(None,%s))' % vc,create_action=self.__once,clock=True,status_action=self.__status)
        self.add_verb2(21,'scan([],~self)',self.__rescan)
        self.add_verb2(22,'play([toggle],~self,role(None,%s))' % vc,create_action=self.__toggle_voice,clock=True,status_action=self.__status)
        self.add_verb2(23,'play([toggle],None)',create_action=self.__toggle,clock=True)
        
        self.loop_on = piw.changelist()
        self.loop_off = piw.changelist()
        self.loop_toggle = piw.changelist()

        self[6]=bundles.Output(1,False,names='status output')
        self.light_output=bundles.Splitter(self.domain,self[6])
        self.lights=piw.lightsource(piw.change_nb(),0,self.light_output.cookie())
        self[5] = VoiceList(self)
        self[5].populate([1])
        self.__first(None)
Beispiel #28
0
    def __init__(self,names,ordinal,dom,remove,keys):
        self.kbd_keys = keys
        agent.Agent.__init__(self,names=names,ordinal=ordinal,signature=version,subsystem='kbd',volatile=True,container=102,protocols='browse is_subsys')

        self.remover=remove

        self.domain = piw.clockdomain_ctl()
        self.domain.set_source(piw.makestring('*',0))

        self[1] = bundles.Output(1,False,names='activation output')
        self[2] = bundles.Output(2,False,names='pressure output')
        self[3] = bundles.Output(3,False,names='roll output')
        self[4] = bundles.Output(4,False,names='yaw output')

        self[5] = bundles.Output(1,False,names='strip position output',ordinal=1)

        self[7] = bundles.Output(1,False,names='breath output')
        self[10] = bundles.Output(2,False,names='absolute strip output',ordinal=1)

        self[12] = bundles.Output(1,False,names='pedal output',ordinal=1)
        self[13] = bundles.Output(1,False,names='pedal output',ordinal=2)
        self[14] = bundles.Output(1,False,names='pedal output',ordinal=3)
        self[15] = bundles.Output(1,False,names='pedal output',ordinal=4)

        self.led_backend = piw.functor_backend(1,True)
        self.status_mixer = piw.statusmixer(self.led_backend.cookie())
        self.led_input = bundles.VectorInput(self.status_mixer.cookie(),self.domain,signals=(1,))
        self[8] = atom.Atom(names='light input',protocols='revconnect',policy=self.led_input.vector_policy(1,False,False,auto_slot=True),domain=domain.Aniso())

        self[100] = VirtualKey(self.kbd_keys)

        self.koutput = bundles.Splitter(self.domain,self[1],self[2],self[3],self[4])
        self.kpoly = piw.polyctl(10,self.koutput.cookie(),False,5)
        self.s1output = bundles.Splitter(self.domain,self[5],self[10])
        self.boutput = bundles.Splitter(self.domain,self[7])
        self.poutput1 = bundles.Splitter(self.domain,self[12])
        self.poutput2 = bundles.Splitter(self.domain,self[13])
        self.poutput3 = bundles.Splitter(self.domain,self[14])
        self.poutput4 = bundles.Splitter(self.domain,self[15])

        self.kclone=piw.sclone()
        self.kclone.set_filtered_output(1,self.kpoly.cookie(),piw.first_filter(1))
        self.kclone.set_filtered_output(2,self.s1output.cookie(),piw.first_filter(2))
        self.kclone.set_filtered_output(5,self.boutput.cookie(),piw.first_filter(5)) 
        self.kclone.set_filtered_output(6,self.poutput1.cookie(),piw.first_filter(6))
        self.kclone.set_filtered_output(7,self.poutput2.cookie(),piw.first_filter(7))
        self.kclone.set_filtered_output(8,self.poutput3.cookie(),piw.first_filter(8))
        self.kclone.set_filtered_output(9,self.poutput4.cookie(),piw.first_filter(9))

        self[9] = atom.Atom(names='controller output',domain=domain.Aniso(),init=self.courses())

        self.add_verb2(4,'maximise([],None,role(None,[mass([pedal])]))',self.__maximise)
        self.add_verb2(5,'minimise([],none,role(None,[mass([pedal])]))',self.__minimise)

        self.__timestamp = piw.tsd_time()
        self.update()
Beispiel #29
0
    def __init__(self, address, ordinal):
        agent.Agent.__init__(self, signature=version, names='leap', ordinal=ordinal)

        self.domain = piw.clockdomain_ctl()

        self.eleap = eleap_native.eleap(self.domain)

        self[1] = atom.Atom(names='hands')
        for i in range(1,3):
            self[1][i] = Hand(self,i)
Beispiel #30
0
 def __init__(self, name, address, abs, wav):
     self.__cdomain = piw.clockdomain_ctl()
     self.__backend = piw.capture_backend(name, 1, abs, wav)
     self.__correlator = piw.correlator(self.__cdomain, chr(1),
                                        piw.null_filter(),
                                        self.__backend.cookie(), 0, 0)
     self.__filter = piw.signal_cnc_filter(0, 0)
     self.__plumber = policy.Plumber(self.__correlator, 1, 1, -1,
                                     policy.Plumber.input_input,
                                     policy.AnisoStreamPolicy(), address,
                                     self.__filter, False, self.__connected)
Beispiel #31
0
    def __init__(self, address, ordinal):
        agent.Agent.__init__(self,
                             signature=version,
                             names='conductor',
                             ordinal=ordinal)
        self.domain = piw.clockdomain_ctl()

        self.__timestamp = 0

        self[2] = atom.Atom(names='outputs')
        self[2][1] = bundles.Output(1, True, names='audio output 1')
        self.output = bundles.Splitter(self.domain, self[2][1])

        self.conductor = conductor_native.conductor(
            self.output.cookie(), self.domain,
            resource.user_resource_dir(resource.conductor_dir, version=''))

        self[1] = AudioInputChannelList(self)

        self.input_clock = bundles.ScalarInput(
            self.conductor.metronome_cookie(),
            self.domain,
            signals=(1, 2, 3, 4))
        self[3] = atom.Atom(names='metronome inputs')
        self[3][1] = atom.Atom(domain=domain.BoundedFloat(0, 10000000),
                               policy=self.input_clock.nodefault_policy(
                                   1, False),
                               names='song beat input')
        self[3][2] = atom.Atom(domain=domain.BoundedFloat(0, 100),
                               policy=self.input_clock.nodefault_policy(
                                   2, False),
                               names='bar beat input')
        self[3][3] = atom.Atom(domain=domain.Bool(),
                               init=False,
                               policy=self.input_clock.nodefault_policy(
                                   3, False),
                               names='running input')
        self[3][4] = atom.Atom(domain=domain.BoundedFloat(0, 100000),
                               init=120,
                               policy=self.input_clock.nodefault_policy(
                                   4, False),
                               names="tempo input")

        self.add_verb2(1, 'create([],None,role(None,[mass([audio,input])]))',
                       self.__create_audio_input)
        self.add_verb2(2, 'create([un],None,role(None,[mass([audio,input])]))',
                       self.__uncreate_audio_input)
        self.add_verb2(3, 'record([],None)', self.__record)
        self.add_verb2(4, 'stop([],None)', self.__stop)

        self[10] = atom.Atom("stage")
        self[10][1] = ClipPoolWidget()
        self[10][2] = ArrangeViewWidget()
        self[10][3] = SceneViewWidget()
Beispiel #32
0
    def __init__(self, address, ordinal):
        agent.Agent.__init__(self,
                             signature=version,
                             names='stereo mixer',
                             protocols='inputlist has_subsys',
                             icon='plg_synth/mixer.png',
                             ordinal=ordinal)

        self.clk = piw.clockdomain_ctl()
        self.vol = piw.make_f2f_table(
            0, 120, 1000, picross.make_f2f_functor(volume_function))
        self.pan = piw.make_f2f_table(-1, 1, 1000,
                                      picross.make_f2f_functor(pan_function))

        self[1] = atom.Atom()
        self[1][1] = bundles.Output(1, True, names='left audio output')
        self[1][2] = bundles.Output(2, True, names='right audio output')

        self.output = bundles.Splitter(self.clk, self[1][1], self[1][2])
        self.final_mixer = piw.stereomixer(self.vol, self.pan, self.clk,
                                           self.output.cookie())
        self.aggregator = piw.aggregator(self.final_mixer.cookie(), self.clk)

        self.ctl_input = bundles.ScalarInput(self.aggregator.get_output(1),
                                             self.clk,
                                             signals=(1, 2))

        self[2] = atom.Atom()
        self[2][1] = atom.Atom(
            domain=domain.BoundedFloat(0,
                                       120,
                                       hints=(T('inc', 1), T('biginc', 10),
                                              T('control', 'updown'))),
            init=100,
            names='master volume',
            policy=self.ctl_input.policy(1,
                                         policy.LopassStreamPolicy(1000,
                                                                   0.97)))
        self[2][2] = atom.Atom(
            domain=domain.BoundedFloat(-1,
                                       1,
                                       hints=(T('inc', 0.02), T('biginc', 0.2),
                                              T('control', 'updown'))),
            init=0,
            names='master pan',
            policy=self.ctl_input.policy(2,
                                         policy.LopassStreamPolicy(1000,
                                                                   0.97)))

        for n in range(0, num_inputs):
            ss = Input(n + 1, self.vol, self.pan, self.clk,
                       self.aggregator.get_output(n + 2), self.signature)
            self.add_subsystem(str(n), ss)
Beispiel #33
0
    def __init__(self, address, ordinal):
        agent.Agent.__init__(self,
                             signature=version,
                             names='blink manager',
                             ordinal=ordinal)

        self.domain = piw.clockdomain_ctl()

        self.blink = blink_native.blink(self.domain)

        for i in range(1, 17):
            self[i] = Blink(self, i)
Beispiel #34
0
    def __init__(self, address, ordinal):
        agent.Agent.__init__(self,
                             signature=version,
                             names='vu meter',
                             ordinal=ordinal)

        self.domain = piw.clockdomain_ctl()

        self[1] = atom.Atom(names='outputs')
        self[1][1] = bundles.Output(OUT_LIGHT,
                                    True,
                                    names='light output',
                                    protocols='revconnect')
        self.output = bundles.Splitter(self.domain, self[1][1])

        self.native = vu_meter_native.vu_meter(self.output.cookie(),
                                               self.domain)

        self.input = bundles.VectorInput(self.native.cookie(),
                                         self.domain,
                                         signals=(IN_AUDIO, ))

        self[2] = atom.Atom(names='inputs')
        self[2][1] = atom.Atom(domain=domain.BoundedFloat(-1, 1),
                               names="audio input",
                               policy=self.input.vector_policy(
                                   IN_AUDIO, policy.IsoStreamPolicy(1, -1, 0)))

        self[3] = atom.Atom(names='thresholds')
        self[3][1] = atom.Atom(domain=domain.BoundedFloat(-90, 0),
                               init=-40.0,
                               policy=atom.default_policy(self.__signal_level),
                               names='signal threshold')
        self[3][2] = atom.Atom(domain=domain.BoundedFloat(-90, 0),
                               init=-6.0,
                               policy=atom.default_policy(self.__high_level),
                               names='high threshold')
        self[3][3] = atom.Atom(domain=domain.BoundedFloat(-90, 0),
                               init=-1,
                               policy=atom.default_policy(self.__clip_level),
                               names='clip threshold')

        self[4] = atom.Atom(domain=domain.BoundedInt(1, 100),
                            init=5,
                            policy=atom.default_policy(self.__size),
                            names='size')
        self[5] = atom.Atom(domain=domain.BoundedFloat(0.0, 30),
                            init=5,
                            policy=atom.default_policy(self.__clip_hold),
                            names='clip hold')

        self.__send_parameters()
Beispiel #35
0
    def __init__(self,address,ordinal):
        self.domain = piw.clockdomain_ctl()
        vc = atom.VerbContainer(clock_domain=self.domain)

        self.finder = talker.TalkerFinder()

        agent.Agent.__init__(self,signature=version,names='arranger', protocols='bind', container=(9,'agent',vc), ordinal=ordinal)

        self[1] = self.verb_container()

        self.model = arranger_native.model(self.domain)

        self.light_output = bundles.Output(1,False,names='light output',protocols='revconnect')
        self.light_splitter = bundles.Splitter(self.domain, self.light_output)
        self.light_convertor = piw.lightconvertor(True,self.light_splitter.cookie())
        self.view = arranger_native.view(self.model,self.light_convertor.cookie())

        self.ctlr_fb = piw.functor_backend(1,True)
        self.ctlr_fb.set_functor(piw.pathnull(0),self.view.control())
        self.ctlr_input = bundles.ScalarInput(self.ctlr_fb.cookie(),self.domain,signals=(1,))
        self[2] = atom.Atom(domain=domain.Aniso(),policy=self.ctlr_input.policy(1,False),names='controller input')

        self.kinput = bundles.VectorInput(self.view.cookie(),self.domain,signals=(1,2,3,5))
        self[3] = atom.Atom(names='key inputs')
        self[3][1] = atom.Atom(domain=domain.BoundedFloat(0,1),policy=self.kinput.vector_policy(1,False),names='pressure input',protocols='nostage')
        self[3][2] = atom.Atom(domain=domain.BoundedFloat(-1,1),policy=self.kinput.merge_policy(2,False),names='roll input',protocols='nostage')
        self[3][3] = atom.Atom(domain=domain.BoundedFloat(-1,1),policy=self.kinput.merge_policy(3,False),names='yaw input',protocols='nostage')
        self[3][5] = atom.Atom(domain=domain.Aniso(), policy=self.kinput.vector_policy(5,False),names='key input')
        self[3][4] = self.light_output

        self.cinput = bundles.ScalarInput(self.model.cookie(),self.domain,signals=(1,2))
        self.cinput.add_upstream(self.verb_container().clock)
        self[4] = atom.Atom(names='metronome inputs')
        self[4][1] = atom.Atom(domain=domain.Aniso(), policy=self.cinput.nodefault_policy(1,False),names='song beat input')
        self[4][2] = atom.Atom(domain=domain.Aniso(), policy=self.cinput.nodefault_policy(2,False),names='running input')

        self[5] = collection.Collection(creator=self.__createtarget,wrecker=self.__wrecktarget,names="row",inst_creator=self.__createtarget_inst,inst_wrecker=self.__wrecktarget_inst,protocols='hidden-connection explicit')

        self[7] = Parameters(self)

        self.__eventlist = EventList(self)
        self.__playstop = node.Server(change=self.__play_change)
        self.__playstop[1] = self.__eventlist
        
        self.set_private(self.__playstop)

        self.add_verb2(1,'play([],None)',create_action=self.__play,clock=True)
        self.add_verb2(2,'play([un],None)',create_action=self.__unplay,clock=True)
        self.add_verb2(3,'cancel([],None,role(None,[numeric]),option(called,[numeric]))',self.__cancel_verb)
        self.add_verb2(4,'clear([],None)',self.__clear_verb)
        self.add_verb2(5,'do([],None,role(None,[abstract]),role(when,[numeric]),option(called,[numeric]))', self.__do_verb)
        self.model.playstop_set(piw.make_change_nb(utils.slowchange(self.__play_set)))
    def __init__(self, address, ordinal):
        agent.Agent.__init__(self, signature=version, names='audiocubes', ordinal=ordinal)

        self.domain = piw.clockdomain_ctl()

        self[2] = bundles.Output(1, False, names='topology output')
        self.__output = bundles.Splitter(self.domain, self[2])

        self.audiocubes = audiocubes_native.audiocubes(self.domain, self.__output.cookie())

        self[1] = atom.Atom(names='audiocubes')
        for i in range(1,16):
            self[1][i] = AudioCube(self,i)
Beispiel #37
0
    def __init__(self,address, ordinal):
        agent.Agent.__init__(self,signature=version,names='example',ordinal=ordinal)
        self.domain = piw.clockdomain_ctl()

        self[1] = atom.Atom(names='outputs')
        self[1][1] = bundles.Output(1, True, names='audio output')
        self.output = bundles.Splitter(self.domain, self[1][1])

        self.example = cfiltertemplate_native.example(self.output.cookie(), self.domain)
        self.input = bundles.VectorInput(self.example.cookie(), self.domain, signals=(1, 2))

        self[2] = atom.Atom(names='inputs')
        self[2][1] = atom.Atom(domain=domain.BoundedFloat(0,1), names="volume input", policy=self.input.local_policy(1,policy.IsoStreamPolicy(1,0,0)))
        self[2][1] = atom.Atom(domain=domain.BoundedFloat(0,96000, rest=440), names="frequency input", policy=self.input.merge_policy(2,False))
    def __init__(self, address, ordinal):
        agent.Agent.__init__(self, signature=version, names='frequency detector', ordinal=ordinal)

        self.domain = piw.clockdomain_ctl()

        self[1] = atom.Atom(names='outputs')
        self[1][1] = bundles.Output(1, False, names='frequency output')
        self.output = bundles.Splitter(self.domain, self[1][1])

        self.frequency_detector = frequency_detector_native.frequency_detector(self.output.cookie(), self.domain)

        self.input = bundles.VectorInput(self.frequency_detector.cookie(), self.domain, signals=(1,))

        self[2] = atom.Atom(names='inputs')
        self[2][1] = atom.Atom(domain=domain.BoundedFloat(0,1), names="audio input", policy=self.input.vector_policy(1,True))

        self[3] = atom.Atom(domain=domain.BoundedFloat(0,1), init=0.01, policy=atom.default_policy(self.__threshold), names='threshold')
        self[4] = atom.Atom(domain=domain.BoundedInt(5,20), init=10, policy=atom.default_policy(self.__buffer_count), names='buffer count')
    def __init__(self, address, ordinal):
        agent.Agent.__init__(self, signature=version, names='control voltage calibration', ordinal=ordinal)

        self.domain = piw.clockdomain_ctl()

        self[1] = atom.Atom(names='outputs')
        self[1][1] = bundles.Output(1, False, names='voltage output')
        self[1][2] = bundles.Output(2, False, names='calibration output')
        self.output = bundles.Splitter(self.domain, self[1][1], self[1][2])

        self.cv_calibration = cv_calibration_native.cv_calibration(self.output.cookie(), self.domain)

        self.input = bundles.VectorInput(self.cv_calibration.cookie(), self.domain, signals=(1,))

        self[2] = atom.Atom(names='inputs')
        self[2][1] = atom.Atom(domain=domain.BoundedFloat(0,96000,rest=0),names="frequency input",policy=self.input.vector_policy(1,False))

        self.add_verb2(1,'calibrate([],None)',callback=self.__calibrate)
Beispiel #40
0
    def __init__(self, address, ordinal):
        #
        agent.Agent.__init__(self, signature=version, names='osc pad', ordinal=ordinal)

        self.domain = piw.clockdomain_ctl()

        self.domain.set_source(piw.makestring('*',0))

        self[1] = atom.Atom(names='outputs')
        self[1][1] = bundles.Output(OUT_LIGHT, False, names='light output', protocols='revconnect')
        self.output = bundles.Splitter(self.domain, self[1][1])
        self.osc = osc_pad(self.domain, self.output.cookie(),"localhost", "9000","9001")


        self.key_input = bundles.VectorInput(self.osc.cookie(), self.domain, signals=(1,2,3,4))
        self[2] = atom.Atom(names="inputs")
        self[2][1] = atom.Atom(domain=domain.Aniso(), policy=self.key_input.vector_policy(1,False), names='key input')
        self[2][2] = atom.Atom(domain=domain.BoundedFloat(0,1), policy=self.key_input.vector_policy(2,False), names='pressure input')
        self[2][3] = atom.Atom(domain=domain.BoundedFloat(-1,1), policy=self.key_input.vector_policy(3,False), names='roll input')
        self[2][4] = atom.Atom(domain=domain.BoundedFloat(-1,1), policy=self.key_input.vector_policy(4,False), names='yaw input')
        
        self.left = 1;
        self.width = 50;
        self.top =1;
        self.height = 25;
        
        self[3] = atom.Atom(names='view')
        self[3][1] = atom.Atom(domain=domain.BoundedInt(1,100), policy=atom.default_policy(self.__top), init=self.top, names='top')
        self[3][2] = atom.Atom(domain=domain.BoundedInt(1,100), policy=atom.default_policy(self.__height), init=self.height, names='height')
        self[3][3] = atom.Atom(domain=domain.BoundedInt(1,100), policy=atom.default_policy(self.__left), init=self.left, names='left')
        self[3][4] = atom.Atom(domain=domain.BoundedInt(1,100), policy=atom.default_policy(self.__width), init=self.width, names='width')
        
        self[4] = atom.Atom(domain=domain.BoundedInt(0,100), policy=atom.default_policy(self.__arrangement), init=0, names='arrangement')
        
        self.add_verb2(1,'reset([],None)', callback=self.__reset)
        self.add_verb2(2,'play([],None)', callback=self.__play)
        self.add_verb2(3,'stop([],None)', callback=self.__stop)
        self.add_verb2(4,'undo([],None)', callback=self.__undo)
        self.add_verb2(5,'undo([un],None)', callback=self.__redo)
        
        self.osc.set_window(self.top,self.height,self.left,self.width);
    def __init__(self,address, ordinal):
        agent.Agent.__init__(self, signature=version, names='noise oscillator',
            ordinal=ordinal)

        self.domain = piw.clockdomain_ctl()

        # One Iso output for the noise
        self[1] = atom.Atom(names='outputs')
        self[1][1] = bundles.Output(1, True, names='audio output')
        self.output = bundles.Splitter(self.domain, self[1][1])

        self.osc = synth_noise.noise(self.output.cookie(),self.domain)

        # Two Iso inputs, volume, and filter freq
        self.input = bundles.VectorInput(self.osc.cookie(), self.domain, 
            signals=(1,2))
        self[2] = atom.Atom(names='inputs')
        self[2][1] = atom.Atom(domain=domain.BoundedFloat(0,1), 
            names="volume input", 
            policy=self.input.local_policy(1, policy.IsoStreamPolicy(1, 0, 0)))
        self[2][2] = atom.Atom(domain=domain.BoundedFloat(0, 20000), 
            names="filter frequency input", 
            policy=self.input.merge_policy(2, True))
    def __init__(self, address, ordinal):
        agent.Agent.__init__(self, signature=version, names='tabulator', ordinal=ordinal)
        
        self.domain = piw.clockdomain_ctl()

        self[5] = bundles.Output(1, False, names='status output')
        self.status_output = bundles.Splitter(self.domain, self[5])
        self.lights = piw.lightsource(piw.change_nb(), 0, self.status_output.cookie())
        self.lights.set_size(1)        

        self.cfunctor = piw.functor_backend(1, False)
        self.cinput = bundles.VectorInput(self.cfunctor.cookie(), self.domain, signals=(1,))
        self[1] = atom.Atom(domain=domain.Aniso(), policy=self.cinput.vector_policy(1,False), names='controller input')
        self.cfunctor.set_gfunctor(utils.make_change_nb(piw.slowchange(utils.changify(self.__controller))))

        self.keyfunctor = piw.functor_backend(1, False)
        self.keyinput = bundles.VectorInput(self.keyfunctor.cookie(), self.domain, signals=(1,))
        self[2] = atom.Atom(domain=domain.Aniso(), policy=self.keyinput.vector_policy(1,False), names='key input')
        self.keyfunctor.set_gfunctor(utils.make_change_nb(piw.slowchange(utils.changify(self.__key))))

        self[3] = atom.Atom(domain=domain.BoundedInt(1,100), init=DEFAULT_CHORD_TIMEOUT, policy=atom.default_policy(self.__set_chordtimeout), names='chord timeout')
        self[4] = atom.Atom(domain=domain.BoundedInt(80,200), init=DEFAULT_PAGE_WIDTH, policy=atom.default_policy(self.__set_pagewidth), names='page width')
        self[6] = atom.Atom(domain=domain.Bool(), init=False, names='start', policy=atom.default_policy(self.__change_start))

        self.add_verb2(1,'start([],None)',self.__start,status_action=self.__status)
        self.add_verb2(2,'stop([],None)',self.__stop,status_action=self.__status)
        self.add_verb2(3,'start([toggle],None)',self.__toggle,status_action=self.__status)

        self.__set_chordtimeout(DEFAULT_CHORD_TIMEOUT)
        self.__set_pagewidth(DEFAULT_PAGE_WIDTH)

        self.__courselen = None
        self.__coursesqueue = None
        self.__coursesrender = None
        self.__lasttime = None
        
        self.__update_status()