コード例 #1
0
ファイル: arranger_plg.py プロジェクト: shamharoth/EigenD
    def __init__(self,agent):
        self.__agent = agent
        atom.Atom.__init__(self,names='parameters')

        self[1] = atom.Atom(domain=domain.BoundedInt(1,10000),names='beginning',policy=atom.default_policy(self.__start_change),container=(None,'loopstart',self.__agent.verb_container()),protocols='set')
        self[1].add_verb2(1,'set([],~a,role(None,[instance(~self)]),role(to,[numeric]))',create_action=self.__start_create,clock=True)
        self.__agent.model.loopstart_set(piw.make_change_nb(utils.slowchange(self.__start_set)))

        self[2] = atom.Atom(domain=domain.BoundedInt(1,10000),init=16,names='end',policy=atom.default_policy(self.__end_change),container=(None,'loopend',self.__agent.verb_container()),protocols='set')
        self[2].add_verb2(1,'set([],~a,role(None,[instance(~self)]),role(to,[numeric]))',create_action=self.__end_create,clock=True)
        self.__agent.model.loopend_set(piw.make_change_nb(utils.slowchange(self.__end_set)))

        self[3] = atom.Atom(domain=domain.BoundedFloat(1,100),init=1,names="step",policy=atom.default_policy(self.__step_change),container=(None,'step',self.__agent.verb_container()),protocols='set')
        self[3].add_verb2(1,'set([],~a,role(None,[instance(~self)]),role(to,[numeric]))',create_action=self.__step_create,clock=True)
        self.__agent.model.stepnumerator_set(piw.make_change_nb(utils.slowchange(self.__step_set)))

        self[4] = atom.Atom(domain=domain.BoundedFloat(1,100),init=2,names="fraction",policy=atom.default_policy(self.__fraction_change),container=(None,'fraction',self.__agent.verb_container()),protocols='set')
        self[4].add_verb2(1,'set([],~a,role(None,[instance(~self)]),role(to,[numeric]))',create_action=self.__fraction_create,clock=True)
        self.__agent.model.stepdenominator_set(piw.make_change_nb(utils.slowchange(self.__fraction_set)))

        self[5] = atom.Atom(names="position",container=(None,'position',self.__agent.verb_container()),protocols='set')
        self[5].add_verb2(1,'set([],~a,role(None,[instance(~self)]),role(to,[numeric]))',create_action=self.__position_create,clock=True)

        self[6] = atom.Atom(domain=domain.BoundedFloat(0.5,20,hints=(T('stageinc',0.1),T('inc',0.1),T('biginc',1),T('control','updown'))),init=0.5,names='doubletap',policy=atom.default_policy(self.__doubletap_change))
        self.__agent.view.doubletap_set(piw.make_change_nb(utils.slowchange(self.__doubletap_set)))
コード例 #2
0
ファイル: arranger_plg.py プロジェクト: tylerwood/EigenD
 def __init__(self, agent, data=None):
     self.__agent = agent
     node.Server.__init__(self, creator=self.__create)
     self.__setter = piw.fastchange(self.__agent.model.set_event())
     self.__agent.model.event_set(
         piw.make_change_nb(utils.slowchange(self.model_changed)))
     self.__agent.model.events_cleared(
         piw.make_change_nb(utils.slowchange(self.model_cleared)))
コード例 #3
0
ファイル: arranger_plg.py プロジェクト: shamharoth/EigenD
    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)))