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): self.domain = piw.clockdomain_ctl() self.domain.set_source(piw.makestring('*', 0)) agent.Agent.__init__( self, signature=version, names='fingerer', protocols='bind set', container=(5, 'fingerer', atom.VerbContainer(clock_domain=self.domain)), ordinal=ordinal) self.__maximum = 0.1 self.__threshold = 0.0 self.__breath_threshold = 0.001 self[1] = atom.Atom(names='outputs') self[1][1] = bundles.Output(1, False, names='pressure output', protocols='') self[1][2] = bundles.Output(2, False, names='roll output', protocols='') self[1][3] = bundles.Output(3, False, names='yaw output', protocols='') self[1][4] = bundles.Output(4, False, names='key output', protocols='') self[1][5] = bundles.Output(5, False, names='modifier output', protocols='') self.output = bundles.Splitter(self.domain, *self[1].values()) self.finger = finger_native.cfinger(self.domain, self.output.cookie()) self.input = bundles.VectorInput(self.finger.cookie(), self.domain, signals=(1, 2, 3, 4, 5)) self[5] = Fingering(self.__change_fingering) self.current_fingering = finger_native.fingering() self.__set_fingering(self[5].default_fingering(), self.current_fingering) self.current_fingering.set_range(self.__threshold, self.__maximum) self.current_fingering.set_breath_threshold(self.__breath_threshold) self.finger.set_fingering(self.current_fingering) self[4] = atom.Atom(names='inputs') self[4][1] = atom.Atom(domain=domain.BoundedFloat(0, 1), policy=self.input.merge_policy(1, False), names='pressure input', init=1.0) self[4][2] = atom.Atom(domain=domain.BoundedFloat(-1, 1), policy=self.input.merge_policy(2, False), names='roll input') self[4][3] = atom.Atom(domain=domain.BoundedFloat(-1, 1), policy=self.input.merge_policy(3, False), names='yaw input') self[4][4] = atom.Atom(domain=domain.Aniso(), policy=self.input.vector_policy(4, False), names='key input') self[4][5] = atom.Atom(domain=domain.BoundedFloat(-1, 1), policy=self.input.local_policy(5, False), names='breath input', init=1.0) self[6] = atom.Atom(names='key parameter') self[6][1] = atom.Atom(domain=domain.BoundedFloat(0, 1), names='maximum', policy=atom.default_policy( self.__change_maximum), init=self.__maximum) self[6][2] = atom.Atom(domain=domain.BoundedFloat(0, 1), names='threshold', policy=atom.default_policy( self.__change_threshold), init=self.__threshold) self[7] = atom.Atom(names='breath parameter') self[7][1] = atom.Atom(domain=domain.BoundedFloat(0, 1), names='activation threshold', policy=atom.default_policy( self.__change_breath_threshold), init=self.__breath_threshold)
def __init__(self, address, ordinal): self.domain = piw.clockdomain_ctl() agent.Agent.__init__( self, signature=version, names='synth filter', container=(10, 'agent', atom.VerbContainer(clock_domain=self.domain)), ordinal=ordinal) self[1] = bundles.Output(1, True, names="low pass output") self[2] = bundles.Output(2, True, names="high pass output") self[3] = bundles.Output(3, True, names="band pass output") self.output = bundles.Splitter(self.domain, self[1], self[2], self[3]) self.filter = synth_native.synthfilter(self.output.cookie(), self.domain) self.bend_filter = piw.function2( True, 3, 4, 1, piw.makefloat_bounded_nb(96000, 0, 0, 440, 0), piw.makefloat_bounded_nb(1, -1, 0, 0, 0), self.filter.cookie()) self.bender = piw.fast_pitchbender() self.bend_filter.set_functor(self.bender.bend_functor()) self.input = bundles.VectorInput(self.bend_filter.cookie(), self.domain, signals=(5, 2, 3, 4), threshold=5) self.input.add_upstream(self.verb_container().clock) self[4] = atom.Atom(domain=domain.BoundedFloat(-1, 1), names="audio input", policy=self.input.vector_policy(5, True)) self[5] = atom.Atom(domain=domain.BoundedFloat( 0, 1, rest=0.5, hints=(T('control', 'updown'), T('inc', 0.01), T('biginc', 0.05))), names="resonance input", policy=self.input.merge_policy(2, False)) self[6] = atom.Atom(domain=domain.BoundedFloat(0, 96000), init=5000, names="cutoff frequency input", policy=self.input.merge_policy(3, False)) self[7] = atom.Atom(domain=domain.BoundedFloat(-1, 1), names="bend input", policy=self.input.merge_policy(4, False)) self[8] = atom.Atom(domain=domain.BoundedFloat(0, 72), init=24, policy=atom.default_policy(self.__rchange), names='frequency range', protocols='bind set', container=(None, 'range', self.verb_container())) self[8].add_verb2( 1, 'set([],None,role(None,[instance(~self)]),role(to,[]))', create_action=self.__rcreate, clock=True) self[9] = atom.Atom(domain=domain.BoundedFloat(-144, 144, rest=0), init=24, policy=atom.default_policy(self.__ochange), names='frequency offset', protocols='bind set', container=(None, 'offset', self.verb_container())) self[9].add_verb2( 2, 'set([],None,role(None,[instance(~self)]),role(to,[]))', create_action=self.__ocreate, clock=True) self.__rchange(24) self.__ochange(24)
def __init__(self, address, ordinal): self.domain = piw.clockdomain_ctl() agent.Agent.__init__( self, signature=version, names='ladder filter', container=(2, 'agent', atom.VerbContainer(clock_domain=self.domain)), ordinal=ordinal) self[1] = bundles.Output(1, True, names="low pass output") self.output = bundles.Splitter(self.domain, self[1]) self.filter = synth_native.synthfilter2(self.output.cookie(), self.domain) self.bend_filter = piw.function2( True, 3, 4, 1, piw.makefloat_bounded(96000, 0, 0, 440, 0), piw.makefloat_bounded(1, -1, 0, 0, 0), self.filter.cookie()) self.bender = piw.fast_pitchbender() self.bend_filter.set_functor(self.bender.bend_functor()) self.input = bundles.VectorInput(self.bend_filter.cookie(), self.domain, signals=(2, 3, 4, 5, 6), threshold=5) self.input.add_upstream(self.verb_container().clock) self[4] = atom.Atom(domain=domain.BoundedFloat(-1, 1), names="audio input", policy=self.input.vector_policy(5, True)) self[5] = atom.Atom(domain=domain.BoundedFloat( 0, 1, rest=0.5, hints=(T('control', 'updown'), T('inc', 0.01), T('biginc', 0.05))), init=0.8, names="resonance input", policy=self.input.merge_policy(2, False)) self[6] = atom.Atom(domain=domain.BoundedFloat(0, 96000), init=5000, names="cutoff frequency input", policy=self.input.merge_policy(3, False)) self[7] = atom.Atom(domain=domain.BoundedFloat(-1, 1), names="bend input", policy=self.input.merge_policy(4, False)) self[8] = atom.Atom(domain=domain.BoundedFloat(0, 72), init=24, policy=atom.default_policy(self.__rchange), names='frequency range', protocols='bind', container=(None, 'range', self.verb_container())) self[9] = atom.Atom(domain=domain.BoundedFloat(-72, 72, rest=0), init=24, policy=atom.default_policy(self.__ochange), names='frequency offset', protocols='bind', container=(None, 'offset', self.verb_container())) self[10] = atom.Atom(domain=domain.BoundedFloat(1, 100), init=50, policy=self.input.merge_policy(6, False), names='temperature') self.__rchange(24) self.__ochange(24)
def __init__(self, address, ordinal): self.domain = piw.clockdomain_ctl() self.domain.set_source(piw.makestring('*',0)) agent.Agent.__init__(self, signature=version, names='stringer',protocols='bind set',container=(5,'stringer',atom.VerbContainer(clock_domain=self.domain)),ordinal=ordinal) self[1] = atom.Atom(names='outputs') self[1][1] = bundles.Output(1,False, names='controller output', continuous=True) 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='key output', protocols='') self.output = bundles.Splitter(self.domain,self[1][2],self[1][3],self[1][4],self[1][5]) self.coutput = bundles.Splitter(self.domain,self[1][1]) # stringer self.stringer = piw.stringer(self.output.cookie()) # clone controller input to copy it to an output and the stringer self.cclone = piw.clone(True) self.cclone.set_output(1,self.coutput.cookie()) self.ctl_input = bundles.VectorInput(self.cclone.cookie(),self.domain,signals=(1,)) self.data_input = bundles.VectorInput(self.stringer.data_cookie(),self.domain,signals=(2,3,4,5)) self[4]=atom.Atom(names='inputs') self[4][1]=atom.Atom(domain=domain.Aniso(),policy=self.ctl_input.vector_policy(1,False),names='controller input') self[4][2]=atom.Atom(domain=domain.BoundedFloat(0,1),policy=self.data_input.merge_policy(2,False),names='pressure input',protocols='nostage') self[4][3]=atom.Atom(domain=domain.BoundedFloat(-1,1),policy=self.data_input.merge_policy(3,False),names='roll input',protocols='nostage') self[4][4]=atom.Atom(domain=domain.BoundedFloat(-1,1),policy=self.data_input.merge_policy(4,False),names='yaw input',protocols='nostage') self[4][5]=atom.Atom(domain=domain.Aniso(),policy=self.data_input.vector_policy(5,False), names='key input') # self[5] is the verb container # enable, to deactivate the stringer self[6] = atom.Atom(domain=domain.Bool(),init=True,names="enable",policy=atom.default_policy(self.__enable)) # status output to drive the talker lights self[7]=bundles.Output(1,False,names='status output') self.light_output=bundles.Splitter(self.domain,self[7]) self.lights=piw.lightsource(piw.change_nb(),0,self.light_output.cookie()) self.lights.set_size(1) self.__set_lights(self[6].get_value()) # toggle enable verb, has status action to ensure the status output will be connected to a talker self.add_verb2(1,'enable([toggle],None)',callback=self.__toggle_enable,status_action=self.__status)
def __init__(self, address, ordinal): self.domain = piw.clockdomain_ctl() agent.Agent.__init__(self, signature=version, names='recorder', protocols='bind',icon='plg_recorder/recorder.png',container=(3,'agent',atom.VerbContainer(clock_domain=self.domain)),ordinal=ordinal) self[2] = atom.Atom() self[2][1] = bundles.Output(1,False,names='activation output', protocols='') self[2][2] = bundles.Output(2,False,names='pressure output', protocols='') self[2][3] = bundles.Output(3,False,names='roll output', protocols='') self[2][4] = bundles.Output(4,False,names='yaw output', protocols='') self[2][5] = bundles.Output(1,False,names='auxilliary output', ordinal=1, protocols='') self[2][6] = bundles.Output(1,False,names='auxilliary output', ordinal=2, protocols='') self[2][7] = bundles.Output(1,False,names='auxilliary output', ordinal=3, protocols='') self[2][8] = bundles.Output(1,False,names='auxilliary output', ordinal=4, protocols='') self[2][9] = bundles.Output(1,False,names='auxilliary output', ordinal=5, protocols='') self[2][10] = bundles.Output(1,False,names='auxilliary output', ordinal=6, protocols='') self[2][11] = bundles.Output(1,False,names='auxilliary output', ordinal=7, protocols='') self[2][12] = bundles.Output(1,False,names='auxilliary output', ordinal=8, protocols='') self[2][13] = bundles.Output(1,False,names='auxilliary output', ordinal=9, protocols='') self[2][14] = bundles.Output(1,False,names='auxilliary output', ordinal=10, protocols='') self.output_data = bundles.Splitter(self.domain,self[2][1],self[2][2],self[2][3],self[2][4]) self.output_aux1 = bundles.Splitter(self.domain,self[2][5]) self.output_aux2 = bundles.Splitter(self.domain,self[2][6]) self.output_aux3 = bundles.Splitter(self.domain,self[2][7]) self.output_aux4 = bundles.Splitter(self.domain,self[2][8]) self.output_aux5 = bundles.Splitter(self.domain,self[2][9]) self.output_aux6 = bundles.Splitter(self.domain,self[2][10]) self.output_aux7 = bundles.Splitter(self.domain,self[2][11]) self.output_aux8 = bundles.Splitter(self.domain,self[2][12]) self.output_aux9 = bundles.Splitter(self.domain,self[2][13]) self.output_aux10 = bundles.Splitter(self.domain,self[2][14]) self.poly_data = piw.polyctl(poly_data_initial,self.output_data.cookie(),False,poly_data_headroom) self.poly_aux1 = piw.polyctl(poly_aux_initial,self.output_aux1.cookie(),False,poly_aux_headroom) self.poly_aux2 = piw.polyctl(poly_aux_initial,self.output_aux2.cookie(),False,poly_aux_headroom) self.poly_aux3 = piw.polyctl(poly_aux_initial,self.output_aux3.cookie(),False,poly_aux_headroom) self.poly_aux4 = piw.polyctl(poly_aux_initial,self.output_aux4.cookie(),False,poly_aux_headroom) self.poly_aux5 = piw.polyctl(poly_aux_initial,self.output_aux5.cookie(),False,poly_aux_headroom) self.poly_aux6 = piw.polyctl(poly_aux_initial,self.output_aux6.cookie(),False,poly_aux_headroom) self.poly_aux7 = piw.polyctl(poly_aux_initial,self.output_aux7.cookie(),False,poly_aux_headroom) self.poly_aux8 = piw.polyctl(poly_aux_initial,self.output_aux8.cookie(),False,poly_aux_headroom) self.poly_aux9 = piw.polyctl(poly_aux_initial,self.output_aux9.cookie(),False,poly_aux_headroom) self.poly_aux10 = piw.polyctl(poly_aux_initial,self.output_aux10.cookie(),False,poly_aux_headroom) self.output_clone = piw.clone(True) self.output_clone.set_filtered_output(2,self.poly_data.cookie(),piw.grist_deaggregation_filter2(2,100)) self.output_clone.set_filtered_output(3,self.poly_aux1.cookie(),piw.grist_deaggregation_filter(3)) self.output_clone.set_filtered_output(4,self.poly_aux2.cookie(),piw.grist_deaggregation_filter(4)) self.output_clone.set_filtered_output(5,self.poly_aux3.cookie(),piw.grist_deaggregation_filter(5)) self.output_clone.set_filtered_output(6,self.poly_aux4.cookie(),piw.grist_deaggregation_filter(6)) self.output_clone.set_filtered_output(7,self.poly_aux5.cookie(),piw.grist_deaggregation_filter(7)) self.output_clone.set_filtered_output(8,self.poly_aux6.cookie(),piw.grist_deaggregation_filter(8)) self.output_clone.set_filtered_output(9,self.poly_aux7.cookie(),piw.grist_deaggregation_filter(9)) self.output_clone.set_filtered_output(10,self.poly_aux8.cookie(),piw.grist_deaggregation_filter(10)) self.output_clone.set_filtered_output(11,self.poly_aux9.cookie(),piw.grist_deaggregation_filter(11)) self.output_clone.set_filtered_output(12,self.poly_aux10.cookie(),piw.grist_deaggregation_filter(12)) self.output_aggregator = piw.aggregator(self.output_clone.cookie(), self.domain) self.player = recorder_native.kplayer(self.domain, 16, 9, self.output_aggregator.get_output(2)) self.recorder = Recorder(self.domain,9) self.input_clone = piw.clone(True) self.input_clone.set_output(1,self.output_aggregator.get_output(1)) self.input_clone.set_output(2,self.player.cookie()) self.input_clone.set_output(3,self.recorder.cookie()) self.input_aggregator = piw.aggregator(self.input_clone.cookie(), self.domain) self.input_clock = bundles.ScalarInput(self.input_aggregator.get_filtered_output(1,piw.grist_aggregation_filter(1)), self.domain, signals=(1,2,3)) self.input_clock.add_upstream(self.verb_container().clock) self.input_poly = piw.polyctl(10,self.input_aggregator.get_filtered_output(2,piw.grist_aggregation_filter(2)), False,5) self.input_data = bundles.VectorInput(self.input_poly.cookie(), self.domain, signals=(1,2,3,4)) self.input_aux1 = bundles.VectorInput(self.input_aggregator.get_filtered_output(3,piw.grist_aggregation_filter(3)), self.domain, signals=(1,)) self.input_aux2 = bundles.VectorInput(self.input_aggregator.get_filtered_output(4,piw.grist_aggregation_filter(4)), self.domain, signals=(1,)) self.input_aux3 = bundles.VectorInput(self.input_aggregator.get_filtered_output(5,piw.grist_aggregation_filter(5)), self.domain, signals=(1,)) self.input_aux4 = bundles.VectorInput(self.input_aggregator.get_filtered_output(6,piw.grist_aggregation_filter(6)), self.domain, signals=(1,)) self.input_aux5 = bundles.VectorInput(self.input_aggregator.get_filtered_output(7,piw.grist_aggregation_filter(7)), self.domain, signals=(1,)) self.input_aux6 = bundles.VectorInput(self.input_aggregator.get_filtered_output(8,piw.grist_aggregation_filter(8)), self.domain, signals=(1,)) self.input_aux7 = bundles.VectorInput(self.input_aggregator.get_filtered_output(9,piw.grist_aggregation_filter(9)), self.domain, signals=(1,)) self.input_aux8 = bundles.VectorInput(self.input_aggregator.get_filtered_output(10,piw.grist_aggregation_filter(10)), self.domain, signals=(1,)) self.input_aux9 = bundles.VectorInput(self.input_aggregator.get_filtered_output(11,piw.grist_aggregation_filter(11)), self.domain, signals=(1,)) self.input_aux10 = bundles.VectorInput(self.input_aggregator.get_filtered_output(12,piw.grist_aggregation_filter(12)), self.domain, signals=(1,)) self.nplayer = recorder_native.nplayer(self.output_aggregator.get_filtered_output(3,piw.gristchaff_aggregation_filter(100,3)),16,2,self.domain) self.input_clock.add_upstream(self.nplayer.get_clock()) self[1] = atom.Atom() self[1][1]=atom.Atom(domain=domain.BoundedFloat(0,1), policy=self.input_data.vector_policy(1,False),names='activation input') self[1][2]=atom.Atom(domain=domain.BoundedFloat(0,1), policy=self.input_data.vector_policy(2,False),names='pressure input') self[1][3]=atom.Atom(domain=domain.BoundedFloat(-1,1), policy=self.input_data.vector_policy(3,False),names='roll input') self[1][4]=atom.Atom(domain=domain.BoundedFloat(-1,1), policy=self.input_data.vector_policy(4,False),names='yaw input') self[1][5]=atom.Atom(domain=domain.Aniso(), policy=self.input_aux1.vector_policy(1,False),names='auxilliary input', ordinal=1) self[1][6]=atom.Atom(domain=domain.Aniso(), policy=self.input_aux2.vector_policy(1,False),names='auxilliary input', ordinal=2) self[1][7]=atom.Atom(domain=domain.Aniso(), policy=self.input_aux3.vector_policy(1,False),names='auxilliary input', ordinal=3) self[1][8]=atom.Atom(domain=domain.Aniso(), policy=self.input_aux4.vector_policy(1,False),names='auxilliary input', ordinal=4) self[1][9]=atom.Atom(domain=domain.Aniso(), policy=self.input_aux5.vector_policy(1,False),names='auxilliary input', ordinal=5) self[1][10]=atom.Atom(domain=domain.Aniso(), policy=self.input_aux6.vector_policy(1,False),names='auxilliary input', ordinal=6) self[1][11]=atom.Atom(domain=domain.Aniso(), policy=self.input_aux7.vector_policy(1,False),names='auxilliary input', ordinal=7) self[1][12]=atom.Atom(domain=domain.Aniso(), policy=self.input_aux8.vector_policy(1,False),names='auxilliary input', ordinal=8) self[1][13]=atom.Atom(domain=domain.Aniso(), policy=self.input_aux9.vector_policy(1,False),names='auxilliary input', ordinal=9) self[1][14]=atom.Atom(domain=domain.Aniso(), policy=self.input_aux10.vector_policy(1,False),names='auxilliary input', ordinal=10) self[1][16]=atom.Atom(domain=domain.BoundedFloat(0,10000000), policy=self.input_clock.nodefault_policy(1,False),names='song beat input') self[1][17]=atom.Atom(domain=domain.BoundedFloat(0,100), policy=self.input_clock.nodefault_policy(2,False),names='bar beat input') self[1][18]=atom.Atom(domain=domain.Bool(), init=False, policy=self.input_clock.nodefault_policy(3,False),names='running input') c = dict(c=schedproxy.get_constraints(), x='[ideal([~server,take]),singular]', o='option(with,[or([[matches([stretch],stretch)],[matches([un,stretch],unstretch)],[matches([chop],chop)]])])' ) a = dict(create_action=self.__create_deferred, destroy_action=self.__destroy_deferred,clock=True) self.add_verb2(1,'record([],None,role(None,[mass([bar])]),%(o)s)'%c,self.__record) self.add_verb2(2,'play([un],None,option(None,%(x)s))'%c,self.__unplay) self.add_verb2(3,'play([],None,role(None,%(x)s),%(o)s)'%c,callback=self.__play_now,**a) self.add_verb2(4,'play([],None,role(None,%(x)s),role(at,%(c)s),option(until,%(c)s),option(every,%(c)s),%(o)s)'%c,callback=self.__play_aue,**a) self.add_verb2(5,'play([],None,role(None,%(x)s),role(until,%(c)s),option(every,%(c)s),%(o)s)'%c,callback=self.__play_ue,**a) self.add_verb2(6,'play([],None,role(None,%(x)s),role(every,%(c)s),%(o)s)'%c,callback=self.__play_e,**a) self.add_verb2(7,'play([dont],None,option(None,%(x)s))'%c,self.__unplay) self.add_verb2(8,'repeat([],None,role(None,%(x)s),%(o)s)'%c,callback=self.__repeat,**a) self.add_verb2(9,'name([],None,role(None,[ideal([~server,take]),singular]),role(to,[abstract]))',self.__name) self.add_verb2(10,'copy([],None,role(None,[gideal(take),singular]))',callback=self.__copy) self.add_verb2(11,'use([],None,role(None,[concrete,proto(scheduler),singular]))',callback=self.__usesched) self.add_verb2(12,'delete([],None,role(None,[ideal([~server,take]),singular]))',self.__delete) self.add_verb2(13,'play([],None,role(None,[mass([note])]),role(with,[mass([velocity])]))',create_action=self.__playnv,clock=True) self.add_verb2(14,'play([],None,role(None,[mass([note])]),role(with,[mass([velocity])]),role(for,[mass([second])]))',create_action=self.__playnvl,clock=True) self.add_verb2(15,'play([toggle],None,role(None,%(x)s),%(o)s)'%c,callback=self.__tog_play_now,**a) self.add_verb2(16,'play([toggle],None,role(None,%(x)s),role(at,%(c)s),option(until,%(c)s),option(every,%(c)s),%(o)s)'%c,callback=self.__tog_play_aue,**a) self.add_verb2(17,'play([toggle],None,role(None,%(x)s),role(until,%(c)s),option(every,%(c)s),%(o)s)'%c,callback=self.__tog_play_ue,**a) self.add_verb2(18,'play([toggle],None,role(None,%(x)s),role(every,%(c)s),%(o)s)'%c,callback=self.__tog_play_e,**a) self.add_verb2(19,'repeat([toggle],None,role(None,%(x)s),%(o)s)'%c,callback=self.__tog_repeat,**a) self.add_verb2(20,'cancel([],None)',self.__cancel) self[4] = TakeBrowser(self) self.library = TakeLibrary(self) self.__scheduler = schedproxy.SchedProxy(delegate=self) self.set_private(node.server(value=piw.makestring('',0),change=self.__schedchange)) self.__schedready = False self[5] = Voice(self) # don't use self[6], it was previously used by a legacy status output that was removed in 1.2 self[7]=toggle.Toggle(None,self.domain,container=(None,'overdub',self.verb_container()),init=False,names='overdub',transient=True)
def __init__(self, address, ordinal): self.domain = piw.clockdomain_ctl() agent.Agent.__init__(self, signature=version,names='drummer',container=(4,'drummer',atom.VerbContainer(clock_domain=self.domain)),protocols='oldbrowse',ordinal=ordinal) self.updater = Updater() self.loopdb = loopdb.LoopDatabase() self.__timestamp = 0 self[1] = atom.Atom(names='outputs') 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(names='inputs') 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') vc = '[or([partof(~(s)"#5")],[numeric])]' 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(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.add_verb2(24,'create([un],None,role(None,%s))' % vc, self.__uncreate) self.add_verb2(25,'create([],None,role(None,[numeric]))', self.__create1) self.add_verb2(26,'create([],None,role(None,[matches([voice])]))', self.__create2) self.add_verb2(27,'create([],None,role(None,[mass([voice])]))', self.__create3) 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])
def __init__(self, address, ordinal): self.domain = piw.clockdomain_ctl() agent.Agent.__init__(self, signature=version, names='player', container=(const.verb_node,'player',atom.VerbContainer(clock_domain=self.domain)), ordinal=ordinal) self[2] = atom.Atom(names='outputs') self[2][1] = bundles.Output(1,False,names='pressure output', protocols='') self[2][2] = bundles.Output(2,False,names='key output', protocols='') self[2][3] = bundles.Output(3,False,names='controller output', protocols='') self.data_output = bundles.Splitter(self.domain,self[2][1],self[2][2]) self.ctl_output = bundles.Splitter(self.domain,self[2][3]) self.player = recorder_native.nplayer(self.data_output.cookie(),self.ctl_output.cookie(),16,100,self.domain) self[3] = atom.Atom(domain=domain.BoundedInt(1,10000,100), policy=atom.default_policy(self.player.set_size), names="size") self.add_verb2(1,'play([],None,role(None,[mass([note])]),role(with,[mass([velocity])]))',create_action=self.__playnv,clock=True) self.add_verb2(2,'play([],None,role(None,[mass([note])]),role(with,[mass([velocity])]),role(for,[mass([second])]))',create_action=self.__playnvl,clock=True)