示例#1
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)
示例#2
0
    def __init__(self, controller, index, tag):
        atom.Atom.__init__(self,
                           names="connector",
                           ordinal=index,
                           protocols='remove')

        self.controller = controller
        self.index = index
        self.control = None
        self.monitor = None

        self[1] = atom.Atom(domain=domain.BoundedInt(-32767, 32767),
                            names='key column',
                            init=0,
                            policy=atom.default_policy(
                                self.__change_key_column),
                            protocols="input explicit")
        self[2] = atom.Atom(domain=domain.BoundedInt(-32767, 32767),
                            names='key row',
                            init=0,
                            policy=atom.default_policy(self.__change_key_row),
                            protocols="input explicit")
        self[3] = atom.Atom(domain=domain.Bool(),
                            names='key column end relative',
                            init=False,
                            policy=atom.default_policy(
                                self.__change_key_column_endrel),
                            protocols="input explicit")
        self[5] = atom.Atom(domain=domain.Bool(),
                            names='key row end relative',
                            init=False,
                            policy=atom.default_policy(
                                self.__change_key_row_endrel),
                            protocols="input explicit")
        self[4] = ConnectorOutput(self)
示例#3
0
 def __init__(self,agent):
     self.__agent = agent
     audio.AudioInput.__init__(self,self.__agent.audio_input,1,2,names='headphone')
     self[100] = toggle.Toggle(self.__enable,self.__agent.domain,container=(None,'headphone',self.__agent.verb_container()),names='enable')
     self[101] = atom.Atom(domain=domain.BoundedInt(0,127,hints=(T('inc',1),T('biginc',5),T('control','updown'))),names='gain',init=70,policy=atom.default_policy(self.__gain))
     self[102] = atom.Atom(domain=domain.BoundedInt(0,4),names='quality',init=0,policy=atom.default_policy(self.__quality))
     self[103] = atom.Atom(domain=domain.Bool(),names='limit',init=True,policy=atom.default_policy(self.__limit))
示例#4
0
 def __init__(self, agent):
     self.__agent = agent
     audio.AudioInput.__init__(self,
                               self.__agent.audio_input,
                               1,
                               2,
                               names='headphone')
     self[100] = toggle.Toggle(self.__enable,
                               self.__agent.domain,
                               container=(None, 'headphone',
                                          self.__agent.verb_container()),
                               names='enable')
     self[101] = atom.Atom(domain=domain.BoundedInt(
         0,
         127,
         hints=(T('stageinc',
                  1), T('inc', 1), T('biginc', 5), T('control', 'updown'))),
                           names='gain',
                           init=70,
                           policy=atom.default_policy(self.__gain))
     self[102] = atom.Atom(domain=domain.BoundedInt(0, 4),
                           names='quality',
                           init=0,
                           policy=atom.default_policy(self.__quality))
     self[103] = atom.Atom(domain=domain.Bool(),
                           names='limit',
                           init=True,
                           policy=atom.default_policy(self.__limit))
     self[103].set_property_string(
         'show_warning',
         'BY CHANGING THE PRESET HEADPHONE LIMIT YOU ABSOLVE EIGENLABS LTD OF ALL LIABILITY FOR ANY HEARING DAMAGE THAT MAY BE CAUSED AS A RESULT OF SUCH ACTIONS'
     )
示例#5
0
    def __init__(self,agent,voice):
        self.agent = agent
        self.voice = voice

        self.__timestamp = piw.tsd_time()

        atom.Atom.__init__(self,domain=domain.String(),names='voice',ordinal=voice,protocols='remove browse',policy=atom.default_policy(self.set_loop))

        self.looper = loop_native.player(agent.aggregator.get_output(voice),agent.domain,utils.statusify(self.__loop_status))
        agent.clock_cloner.set_output(voice,self.looper.cookie())

        self.loop_off = self.looper.player(0)
        self.loop_on = self.looper.player(1)
        self.loop_toggle = self.looper.player(3)
        self.loop_once = self.looper.player(2)

        self.agent.lights.set_status(self.voice,const.status_inactive)

        self[1] = atom.Atom(domain=domain.BoundedFloat(0.0,100.0,0.0,hints=(T('stageinc',1),T('inc',1),T('biginc',10),T('control','updown')),verbinc=10.0),init=100.0,policy=atom.default_policy(self.set_volume),names='volume')
        self[2] = atom.Atom(domain=domain.BoundedFloat(0.0,100.0,0.0,hints=(T('stageinc',1),T('inc',1),T('biginc',10),T('control','updown')),verbinc=10.0),init=10.0,policy=atom.default_policy(self.set_chop),names='chop')
        self[3] = atom.Atom(domain=domain.Bool(),init=False,names='enable',policy=atom.default_policy(self.set_playing),protocols='set',container=(None,'voice%d'%voice,agent.verb_container()))

        self[3].add_verb2(1,'set([],~a,role(None,[instance(~self)]))', create_action=self.__enable_set, status_action=self.__enable_status)
        self[3].add_verb2(2,'set([un],~a,role(None,[instance(~self)]))', create_action=self.__enable_unset, status_action=self.__enable_status)
        self[3].add_verb2(3,'set([toggle],~a,role(None,[instance(~self)]))', create_action=self.__enable_toggle, status_action=self.__enable_status)

        self.looper.set_chop(10.0)
        self.looper.set_volume(1.0)

        piw.changelist_connect(agent.loop_on,self.loop_on)
        piw.changelist_connect(agent.loop_off,self.loop_off)
        piw.changelist_connect(agent.loop_toggle,self.loop_toggle)

        self.first()
示例#6
0
    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)
示例#7
0
    def __init__(self, chan_agent, cookie, name, ordinal_str, fx_chan_num,
                 is_fx_chan):
        self.chan_agent = chan_agent
        self.fx_chan_num = fx_chan_num
        self.__is_fx_chan = is_fx_chan

        if ordinal_str != '':
            ordinal = int(ordinal_str)
        else:
            ordinal = None

        self.label = '%s %s' % (name, ordinal_str)
        atom.Atom.__init__(self, names=name, ordinal=ordinal)

        self.set_property_string('cname', 'effect')
        self.set_property_long('cordinal', fx_chan_num)

        # ------- effect send levels and enables -------
        # enable
        self[1] = atom.Atom(domain=domain.Bool(),
                            init=False,
                            names='enable',
                            policy=atom.default_policy(
                                self.__set_fx_send_enable))
        # send
        self.send_input = bundles.ScalarInput(cookie,
                                              chan_agent.main_agent.clk,
                                              signals=(1, ))
        self[2] = atom.Atom(
            domain=domain.BoundedFloat(0,
                                       120,
                                       hints=(T('inc', 1), T('biginc', 10),
                                              T('control', 'updown'))),
            init=120,
            names='send',
            policy=self.send_input.notify_policy(
                1,
                policy.LopassStreamPolicy(1000, 0.97),
                notify=self.chan_agent.main_agent.volume_changed),
            protocols='bind input')
        self[3] = atom.Atom(domain=domain.Bool(),
                            init=False,
                            names='prefader',
                            policy=atom.default_policy(
                                self.__set_fx_send_prefader))
示例#8
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)
示例#9
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)
示例#10
0
    def __init__(self, address, ordinal):
        agent.Agent.__init__(self, signature=version,names='cycler',container=10,ordinal=ordinal)

        self.set_private(node.Server())
        self.get_private()[1]=node.Server(change=self.__cycle_set,value=piw.makebool(True,0))
        self.get_private()[2]=node.Server(change=self.__invert_set,value=piw.makebool(False,0))

        self[2] = atom.Atom(names='outputs')
        self[2][2] = bundles.Output(2,False,names='pressure output')
        self[2][3] = bundles.Output(3,False,names='roll output')
        self[2][4] = bundles.Output(4,False,names='yaw output')
        self[2][5] = bundles.Output(5,False,names='scale note output')
        self[2][6] = bundles.Output(6,False,names='frequency output')
        self[2][7] = bundles.Output(16,False,names='damper output')

        self[3] = atom.Atom(names="cycling",domain=domain.Bool(),init=True,policy=atom.default_policy(self.__setcycling))

        self.domain = piw.clockdomain_ctl()
        self.domain.set_source(piw.makestring('*',0))
        self.main_output = bundles.Splitter(self.domain,self[2][2],self[2][3],self[2][4],self[2][5],self[2][6])
        self.damp_output = bundles.Splitter(self.domain,self[2][7])
        self.cycler = piw.cycler(self.domain,32,self.main_output.cookie(),self.damp_output.cookie(),False)
        self.input = bundles.VectorInput(self.cycler.main_cookie(),self.domain,signals=(2,3,4,5,6,16,17),threshold=5)
        self.feedback = bundles.VectorInput(self.cycler.feedback_cookie(),self.domain,signals=(1,),threshold=5)

        self.cycler.set_cycle(True)
        self.cycler.set_maxdamp(1.0)
        self.cycler.set_invert(True)
        self.cycler.set_curve(1.0)

        self[1] = atom.Atom(names='inputs')
        self[1][2]=atom.Atom(domain=domain.BoundedFloat(0,1),policy=self.input.vector_policy(2,False),names='pressure input')
        self[1][3]=atom.Atom(domain=domain.BoundedFloat(-1,1),policy=self.input.vector_policy(3,False),names='roll input')
        self[1][4]=atom.Atom(domain=domain.BoundedFloat(-1,1),policy=self.input.vector_policy(4,False),names='yaw input')
        self[1][5]=atom.Atom(domain=domain.BoundedFloat(0,1000),policy=self.input.vector_policy(5,False),names='scale note input')
        self[1][6]=atom.Atom(domain=domain.BoundedFloat(0,96000),policy=self.input.vector_policy(6,False),names='frequency input')
        self[1][7]=atom.Atom(domain=domain.BoundedFloat(0,1),policy=self.feedback.vector_policy(1,False,clocked=False),names='feedback input')
        self[1][8]=atom.Atom(domain=domain.BoundedFloat(0,1),init=0.0,policy=self.input.linger_policy(16,False),names='damper pedal input',container=(None,'damper',self.verb_container()))
        self[1][10]=atom.Atom(domain=domain.BoundedFloat(0,1,hints=(T('stageinc',0.01),T('inc',0.01),T('biginc',0.1),T('control','updown'))),init=1.0,policy=atom.default_policy(self.__setmaxdamp),names='damper maximum input')
        self[1][12]=atom.Atom(domain=domain.BoundedFloat(0,1),policy=self.input.latch_policy(17,False),names='hold pedal input')
        self[1][13]=atom.Atom(domain=domain.BoundedFloat(0.1,10,hints=(T('stageinc',0.1),T('inc',0.1),T('biginc',1),T('control','updown'))),init=1,names="damper curve",policy=atom.default_policy(self.__setdcurve))

        self[4] = atom.Atom(names="inverted damper",domain=domain.Bool(),init=True,policy=atom.default_policy(self.__setinverted))
示例#11
0
    def __init__(self, agent, index):
        atom.Atom.__init__(self,
                           names='key press',
                           ordinal=index,
                           protocols='remove')

        self.__agent = agent
        self.__index = index

        self.__inputcookie = self.__agent.sysin_events.create_keypress_input(
            self.__index)
        self.__input = bundles.VectorInput(self.__inputcookie,
                                           agent.domain,
                                           signals=(1, ))

        self[1] = atom.Atom(domain=domain.BoundedFloat(-1, 1),
                            names="pressure input",
                            policy=self.__input.vector_policy(1, True))

        self[2] = atom.Atom(domain=domain.BoundedInt(0, 127),
                            names='key code',
                            policy=atom.default_policy(self.__set_code))
        self[3] = atom.Atom(domain=domain.String(),
                            names='character',
                            init='',
                            policy=atom.default_policy(self.__set_character))
        self[4] = atom.Atom(domain=domain.Bool(),
                            names='hold',
                            init=True,
                            policy=atom.default_policy(self.__set_hold))
        self[5] = atom.Atom(domain=domain.BoundedFloat(-1, 1),
                            names='threshold',
                            init=0.0,
                            policy=atom.default_policy(self.__set_threshold))
        self[6] = atom.Atom(domain=domain.Bool(),
                            names='velocity',
                            init=False,
                            policy=atom.default_policy(self.__set_velocity))
        self[7] = atom.Atom(domain=domain.String(),
                            names='description',
                            init='',
                            policy=atom.default_policy(self.__set_description))
示例#12
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()
示例#13
0
    def __init__(self, channel, fx_chan_num, is_fx_chan):
        self.channel = channel
        self.fx_chan_num = fx_chan_num
        self.__is_fx_chan = is_fx_chan

        atom.Atom.__init__(self, names='effect', ordinal=fx_chan_num)

        cookie = channel.aggregator.get_output(2 + fx_chan_num)

        # ------- effect send levels and enables -------
        # enable
        self[1] = atom.Atom(domain=domain.Bool(),
                            init=False,
                            names='enable',
                            policy=atom.default_policy(
                                self.__set_fx_send_enable))
        # send
        self.send_input = bundles.ScalarInput(cookie,
                                              channel.main_agent.clk,
                                              signals=(1, ))
        self[2] = atom.Atom(
            domain=domain.BoundedFloat(-70,
                                       14,
                                       hints=(T('stageinc', 0.1), T('inc', 1),
                                              T('biginc',
                                                10), T('control', 'updown'),
                                              T('distribution', 'tapered'))),
            init=0,
            names='send',
            policy=self.send_input.notify_policy(
                1,
                policy.LopassStreamPolicy(1000, 0.97),
                notify=self.channel.main_agent.changes_pending),
            protocols='bind input')
        self[3] = atom.Atom(domain=domain.Bool(),
                            init=False,
                            names='prefader',
                            policy=atom.default_policy(
                                self.__set_fx_send_prefader))
示例#14
0
    def __init__(self, address, ordinal):
        agent.Agent.__init__(self,
                             signature=version,
                             names='metronome',
                             ordinal=ordinal)

        self.beat_changes = node.Server(creator=self.__beat_creator,
                                        wrecker=self.__beat_wrecker)
        self.bar_changes = node.Server(creator=self.__bar_creator,
                                       wrecker=self.__bar_wrecker)

        self.set_private(node.Server())
        self.get_private()[1] = self.beat_changes
        self.get_private()[2] = self.bar_changes

        self[2] = atom.Atom()
        self[2][1] = bundles.Output(1, False, names='running output')
        self[2][2] = bundles.Output(2, False, names='time output')
        self[2][3] = bundles.Output(3, False, names='song beat output')
        self[2][4] = bundles.Output(5, False, names='tempo output')
        self[2][5] = bundles.Output(8, False, names='bar beat output')

        self.domain = piw.clockdomain_ctl()
        self.domain.set_source(piw.makestring('*', 0))
        self.output = bundles.Splitter(self.domain, *self[2].values())
        self.barclock = clock_native.clock(6, 1.0, 4.0, self.output.cookie(),
                                           self.domain)
        self.beatclock = clock_native.clock(2, -60.0, 60.0,
                                            self.barclock.cookie(),
                                            self.domain)
        self.input = bundles.ScalarInput(self.beatclock.cookie(),
                                         self.domain,
                                         signals=(1, 2))

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

        self[3] = atom.Atom()
        self[3][1] = action.Verb(
            'set(none,none,role(at,[mass([second])]),role(to,[abstract]),role(none,[matches([tempo])]))',
            lambda s, a, t, x: self.__add(a, t))
        self[3][2] = action.Verb(
            'set(dont,none,role(at,[mass([second])]),role(to,[abstract]),role(none,[matches([tempo])]))',
            lambda s, a, t, x: self.__del(a, t))
示例#15
0
    def __init__(self, address, ordinal):
        agent.Agent.__init__(self,signature=version,names='sampler oscillator',container=8,ordinal=ordinal)
        self.domain = piw.clockdomain_ctl()

        self[1] = atom.Atom(names='outputs')
        self[1][1] = bundles.Output(1,True,names="left audio output")
        self[1][10] = bundles.Output(2,True,names="right audio output")
        self[1][3] = bundles.Output(1,False,names="activation output")
        self[1][4] = bundles.Output(2,False,names="delay output")
        self[1][5] = bundles.Output(3,False,names="attack output")
        self[1][6] = bundles.Output(4,False,names="hold output")
        self[1][7] = bundles.Output(5,False,names="decay output")
        self[1][8] = bundles.Output(6,False,names="sustain output")
        self[1][9] = bundles.Output(7,False,names="release output")

        self.audio_output = bundles.Splitter(self.domain, self[1][1], self[1][10])
        self.envelope_output = bundles.Splitter(self.domain, self[1][3], self[1][4], self[1][5], self[1][6], self[1][7], self[1][8], self[1][9])

        self.synth_player = sampler2_native.player(self.audio_output.cookie(),self.domain)
        self.synth_loader = sampler2_native.loader(self.synth_player,self.envelope_output.cookie(),self.domain)
        self.vdetector = piw.velocitydetect(self.synth_loader.cookie(),4,3)

        vel=(T('stageinc',0.1),T('inc',0.1),T('biginc',1),T('control','updown'))
        self[4] = atom.Atom(domain=domain.BoundedInt(1,1000),init=4,names="velocity sample",policy=atom.default_policy(self.__set_samples))
        self[5] = atom.Atom(domain=domain.BoundedFloat(0.1,10,hints=vel),init=4,names="velocity curve",policy=atom.default_policy(self.__set_curve))
        self[7] = atom.Atom(domain=domain.BoundedFloat(0.1,10,hints=vel),init=4,names="velocity scale",policy=atom.default_policy(self.__set_scale))

        self.loader_input = bundles.VectorInput(self.vdetector.cookie(), self.domain, signals=(1,4),threshold=5)
        self.player_input = bundles.VectorInput(self.synth_player.cookie(), self.domain, signals=(1,2,3),threshold=5)

        self[2] = atom.Atom(names='inputs')
        self[2][1]=atom.Atom(domain=domain.BoundedFloat(0,96000,rest=440), names='frequency input',ordinal=1,policy=self.player_input.merge_policy(1,False))
        self[2][2]=atom.Atom(domain=domain.BoundedFloat(-1200,1200,hints=(T('stageinc',1),T('inc',1),T('biginc',10),T('control','updown'))), names='detune input',policy=self.player_input.merge_policy(2,False))
        self[2][3]=atom.Atom(domain=domain.BoundedFloat(0,1), names='activation input',policy=self.player_input.vector_policy(3,False))

        self[2][4]=atom.Atom(domain=domain.BoundedFloat(0,1), names='pressure input',policy=self.loader_input.vector_policy(4,False))
        self[2][5]=atom.Atom(domain=domain.BoundedFloat(-72,72,hints=(T('stageinc',0.5),T('inc',0.5),T('biginc',12),T('control','updown'))), names='transpose', policy=atom.default_policy(self.__settranspose))
        self[2][6]=atom.Atom(domain=domain.BoundedFloat(0,96000,rest=440), names='frequency input',ordinal=2,policy=self.loader_input.merge_policy(1,False))

        self.__transpose = 0
        self[3] = Sample(self)
        self[6] = atom.Atom(domain=domain.Bool(), init=True, names='fade enable', protocols='input explicit', policy=atom.default_policy(self.__set_fade))

        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,sample]),singular]),role(to,[abstract]))',self.__name)
        self.add_verb2(4,'choose([],None,role(None,[ideal([~server,sample]),singular]))',self.__choose)
        self.add_verb2(5,'name([un],None,role(None,[ideal([~server,sample]),singular]))',self.__unname)

        self.synth_player.set_fade(True)
示例#16
0
    def __init__(self,address,ordinal):
        agent.Agent.__init__(self, signature=version,names='audio',container=9,ordinal=ordinal)
        self.domain = piw.clockdomain_ctl()

        self.__timestamp = 0

        self.output = bundles.Splitter(self.domain)
        self[2] = AudioOutputList(self,'outputs')

        self.clone = piw.clone(True)
        self.audio = AudioDelegate(self,self.domain)
        self.recorder = piw.wavrecorder(self.domain)
        self.clone.set_output(1,self.audio.cookie())
        self.clone.set_output(2,self.recorder.cookie())
        self.input = bundles.ScalarInput(self.clone.cookie(),self.domain,signals=(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64),threshold=0)
        self.__loading = False

        self[1] = AudioInputList(self)
        self[1].create_channel(1)
        self[1].create_channel(2)

        self[3] = atom.Atom(domain=domain.EnumOrNull(44100,48000,96000), names='sample rate', protocols='bind set', policy=atom.default_policy(self.__change_sample_rate),container=(None,'sample rate',self.verb_container()))
        self[3].add_verb2(1,'set([],~a,role(None,[instance(~self)]),role(to,[numeric]))',callback=self.__set_sample_rate)
        self[3].add_verb2(2,'set([un],~a,role(None,[instance(~self)]))',callback=self.__unset_sample_rate)

        self[4] = atom.Atom(domain=domain.BoundedIntOrNull(0,64), names='input channels', protocols='output', policy=policy.ReadOnlyPolicy())
        self[5] = atom.Atom(domain=domain.BoundedIntOrNull(0,64), names='output channels', protocols='output', policy=policy.ReadOnlyPolicy())

        self[7] = Port(self)

        self[8] = atom.Atom(domain=domain.BoundedIntOrNull(0,3072,0), names='buffer size', protocols='bind set', policy=atom.default_policy(self.__change_buffer_size),container=(None,'buffer size',self.verb_container()))
        self[8].add_verb2(1,'set([],~a,role(None,[instance(~self)]),role(to,[numeric]))',callback=self.__set_buffer_size)
        self[8].add_verb2(2,'set([un],~a,role(None,[instance(~self)]))',callback=self.__unset_buffer_size)

        self.add_verb2(1,'mute([],None)', self.__mute)
        self.add_verb2(2,'mute([un],None)', self.__unmute)
        self.add_verb2(3,'choose([],None,role(None,[ideal([~server,port]),singular]))',self.__choose)
        self.add_verb2(4,'create([],None,role(None,[mass([input])]))', self.__create_input)
        self.add_verb2(5,'create([un],None,role(None,[mass([input])]))', self.__uncreate_input)
        self.add_verb2(6,'create([],None,role(None,[mass([output])]))', self.__create_output)
        self.add_verb2(7,'create([un],None,role(None,[mass([output])]))', self.__uncreate_output)

        self.enum()

        self.__filename = resource.new_resource_file('Audio','audio.wav')
        self.recorder.setfile(self.__filename)

        self[10] = atom.Atom(domain=domain.Bool(),init=False,transient=True,policy=policy.FastPolicy(self.recorder.record(),policy.TriggerStreamPolicy()),protocols='nostage',names='recorder running input')

        self[2].channels_changed()
示例#17
0
    def __init__(self, callback, *args, **kwds):
        self.__scroller = piw.scroller2(utils.changify(callback))
        atom.Atom.__init__(self, *args, **kwds)

        self[1] = atom.Atom(domain=domain.BoundedInt(-32767, 32767),
                            names='column',
                            init=None,
                            policy=atom.default_policy(self.__change_column))
        self[2] = atom.Atom(domain=domain.BoundedInt(-32767, 32767),
                            names='row',
                            init=None,
                            policy=atom.default_policy(self.__change_row))
        self[3] = atom.Atom(domain=domain.Bool(),
                            names='column end relative',
                            init=False,
                            policy=atom.default_policy(
                                self.__change_column_endrel))
        self[4] = atom.Atom(domain=domain.Bool(),
                            names='row end relative',
                            init=False,
                            policy=atom.default_policy(
                                self.__change_row_endrel))
        self.__key_changed()
示例#18
0
    def __init__(self, func1, func2, *args, **kwds):
        self.__delegate = ScrollerDelegate(func1, func2)
        self.__scroller = piw.scroller(self.__delegate, 0.5, 0.5, 100)
        atom.Atom.__init__(self, *args, **kwds)

        self[1] = atom.Atom(domain=domain.BoundedInt(-32767, 32767),
                            names='column',
                            init=None,
                            policy=atom.default_policy(self.__change_column))
        self[2] = atom.Atom(domain=domain.BoundedInt(-32767, 32767),
                            names='row',
                            init=None,
                            policy=atom.default_policy(self.__change_row))
        self[3] = atom.Atom(domain=domain.Bool(),
                            names='column end relative',
                            init=False,
                            policy=atom.default_policy(
                                self.__change_column_endrel))
        self[4] = atom.Atom(domain=domain.Bool(),
                            names='row end relative',
                            init=False,
                            policy=atom.default_policy(
                                self.__change_row_endrel))
        self.__key_changed()
示例#19
0
    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)
示例#20
0
    def __init__(self,usbname,ordinal,dom,remove):
        agent.Agent.__init__(self,names='keyboard pico',ordinal=ordinal,signature=version,subsystem='kbd',volatile=True,container=102,protocols='is_subsys')

        self.usbname=usbname
        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')
        self[6] = bundles.Output(1,False, names='breath output')
        self[8] = bundles.Output(2,False, names='absolute strip output')
        
        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[7] = atom.Atom(names='light input',protocols='revconnect',policy=self.led_input.vector_policy(1,False,False,auto_slot=True),domain=domain.Aniso())

        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.soutput = bundles.Splitter(self.domain,self[5],self[8])
        self.boutput = bundles.Splitter(self.domain,self[6])

        self.kclone=piw.sclone()
        self.kclone.set_filtered_output(1,self.kpoly.cookie(),piw.first_filter(1))
        self.kclone.set_filtered_output(2,self.soutput.cookie(),piw.first_filter(2))
        self.kclone.set_filtered_output(3,self.boutput.cookie(),piw.first_filter(3))
        self.keyboard=pkbd_native.bundle(usbname,self.kclone.cookie(),utils.notify(self.dead),utils.changify(self.signal))

        self[100] = VirtualKey()
        #self[102] = vc

        self[251] = atom.Atom(domain=domain.BoundedFloat(0,1), init=self.keyboard.get_threshold1(), protocols='input output', names='soft threshold', policy=atom.default_policy(self.keyboard.set_threshold1))
        self[249] = atom.Atom(domain=domain.BoundedFloat(0,1), init=self.keyboard.get_threshold2(), protocols='input output', names='hard threshold', policy=atom.default_policy(self.keyboard.set_threshold2))
        self[240] = atom.Atom(domain=domain.BoundedFloat(0,1), init=self.keyboard.get_roll_axis_window(), protocols='input output', names='roll axis window', policy=atom.default_policy(self.keyboard.set_roll_axis_window))
        self[241] = atom.Atom(domain=domain.BoundedFloat(0,1), init=self.keyboard.get_yaw_axis_window(), protocols='input output', names='yaw axis window', policy=atom.default_policy(self.keyboard.set_yaw_axis_window))
        self[242] = atom.Atom(domain=domain.Bool(), init=False, protocols='input output nostage', names='k logging', policy=atom.default_policy(self.keyboard.enable_key_logging))

        f=self.keyboard.led_functor()
        self.led_backend.set_functor(piw.pathnull(0),f)

        self[9] = atom.Atom(names='controller output',domain=domain.Aniso(),init=self.__courses())
示例#21
0
 def __init__(self, e, d, **kw):
     self.__enable = e
     atom.Atom.__init__(self,
                        domain=domain.Bool(),
                        protocols='set',
                        policy=atom.default_policy(self.__change),
                        **kw)
     self.add_verb2(1, 'set([],~a,role(None,[instance(~self)]))',
                    self.__verb_set)
     self.add_verb2(2, 'set([un],~a,role(None,[instance(~self)]))',
                    self.__verb_unset)
     self.add_verb2(3,
                    'set([toggle],~a,role(None,[instance(~self)]))',
                    callback=self.__verb_togset,
                    status_action=self.__status)
     self[1] = bundles.Output(1, False, names='status output')
     self.light_output = bundles.Splitter(d, self[1])
     self.lights = piw.lightsource(piw.change_nb(), 0,
                                   self.light_output.cookie())
     self.lights.set_size(1)
     self.__set_status(self.get_value())
     self.__state = False
示例#22
0
    def __init__(self, scheduler, index):
        self.scheduler = scheduler
        self.index = index
        self.event = piw.event(scheduler.scheduler, False,
                               utils.changify(self.__enable_changed))
        self.event.set_self_light(const.status_selector_off)

        talker.Talker.__init__(
            self,
            scheduler.finder,
            self.event.fastdata(),
            self.scheduler.light_aggregator.get_output(index),
            names='event',
            ordinal=index,
            protocols='remove')

        self[3] = atom.Atom(domain=domain.String(),
                            policy=atom.default_policy(self.__change_schema),
                            names='schema')
        self[4] = atom.Atom(domain=domain.Bool(),
                            init=False,
                            policy=atom.default_policy(self.__change_enabled),
                            names='enabled')
示例#23
0
    def __init__(self, address, ordinal):
        agent.Agent.__init__(self,
                             signature=version,
                             names='metronome',
                             container=4,
                             protocols='browse metronome',
                             ordinal=ordinal)

        self[1] = atom.Atom(names='outputs')
        self[1][1] = bundles.Output(1, False, names='bar beat output')
        self[1][2] = bundles.Output(2, False, names='song beat output')
        self[1][3] = bundles.Output(3, False, names='running output')
        self[1][4] = bundles.Output(4, False, names='bar output')
        self[1][5] = bundles.Output(5, False, names='tempo output')
        self[14] = bundles.Output(1, False, names='status output')

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

        self.clk_output = bundles.Splitter(self.domain, self[1][1], self[1][2],
                                           self[1][3], self[1][4])
        self.tempo_output = bundles.Splitter(self.domain, self[1][5])
        self.status_output = bundles.Splitter(self.domain, self[14])

        self.pinger = loop_native.pinger(self.clk_output.cookie(),
                                         self.tempo_output.cookie(),
                                         self.status_output.cookie(),
                                         self.domain, sc(self.__tempo_set),
                                         sc(self.__beats_set),
                                         sc(self.__preroll_set))
        self.aggregator = piw.aggregator(self.pinger.cookie(), self.domain)

        self.tap_input = bundles.ScalarInput(self.aggregator.get_output(1),
                                             self.domain,
                                             signals=(1, 2))
        self.midi_clock_input = bundles.ScalarInput(
            self.aggregator.get_output(2), self.domain, signals=(1, ))

        self[2] = atom.Atom(domain=domain.BoundedFloat(
            0,
            500,
            hints=(T('stageinc',
                     1), T('inc', 1), T('biginc', 10), T('control',
                                                         'updown'))),
                            init=120,
                            names='tempo input',
                            policy=atom.default_policy(self.__set_tempo))
        self[3] = atom.Atom(domain=domain.BoundedFloat(0,
                                                       100,
                                                       rest=4,
                                                       hints=(
                                                           T('stageinc', 1),
                                                           T('inc', 1),
                                                       )),
                            names='beat input',
                            policy=atom.default_policy(self.__set_beats))
        # self[4] is the verb container
        self[5] = atom.Atom(domain=domain.BoundedFloat(0,
                                                       1,
                                                       rest=0,
                                                       hints=(T(
                                                           'control',
                                                           'trigger'), )),
                            policy=self.tap_input.nodefault_policy(
                                1, policy.ImpulseStreamPolicy()),
                            names='beat trigger',
                            transient=True)
        self[6] = atom.Atom(domain=domain.BoundedFloat(0,
                                                       1,
                                                       rest=0,
                                                       hints=(T(
                                                           'control',
                                                           'trigger'), )),
                            policy=self.tap_input.nodefault_policy(
                                2, policy.ImpulseStreamPolicy()),
                            names='bar trigger',
                            transient=True)
        self[7] = atom.Atom(domain=domain.BoundedFloat(1, 500),
                            init=30,
                            names='tap tempo minimum',
                            policy=atom.default_policy(
                                self.__set_tempo_lbound))
        self[8] = atom.Atom(domain=domain.BoundedFloat(1, 500),
                            init=240,
                            names='tap tempo maximum',
                            policy=atom.default_policy(
                                self.__set_tempo_ubound))
        self[9] = atom.Atom(
            domain=domain.Bool(hints=(T('control', 'toggle'), )),
            policy=atom.default_policy(self.__preroll),
            names='preroll trigger',
            transient=True)
        self[10] = atom.Atom(domain=domain.BoundedInt(1, 32),
                             init=4,
                             names='preroll',
                             policy=atom.default_policy(
                                 self.__set_preroll_count))

        self[15] = atom.Atom(domain=domain.Aniso(),
                             policy=self.midi_clock_input.nodefault_policy(
                                 1, False),
                             names='midi clock input')
        self[16] = toggle.Toggle(self.__set_midi_clock_enable,
                                 self.domain,
                                 container=(None, 'midi clock enable',
                                            self.verb_container()),
                                 names='midi clock enable')
        self[17] = atom.Atom(
            domain=domain.BoundedFloat(-1000,
                                       1000,
                                       hints=(T('inc',
                                                1), T('control', 'updown'))),
            init=0,
            names='midi clock latency',
            policy=atom.default_policy(self.__midi_clock_set_latency))
        self[18] = atom.Atom(domain=domain.BoundedIntOrNull(0, 2000),
                             init=0,
                             names='beat flash persistence',
                             policy=atom.default_policy(
                                 self.__set_beat_flash_persistence))

        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)

        print 'init tempo=', self[2].get_value()
        self.pinger.set_tempo(self[2].get_value())
        self.pinger.set_beats(self[3].get_value())
        self.pinger.set_range(self[8].get_value(), self[7].get_value())

        self.__playing = False

        self.__timestamp = piw.tsd_time()
        self.__selected = None
        self.update()
示例#24
0
    def __init__(self, address, ordinal):
        agent.Agent.__init__(self, signature=version, names='t3d output', ordinal=ordinal)

        self.domain = piw.clockdomain_ctl()

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

        self.t3d_output = t3d_output(self.domain, "localhost", 3123);
        self.output = self.t3d_output.create_output("", True, 0)
        self.input = bundles.VectorInput(self.output, self.domain, signals=(IN_KEY,IN_PRESSURE,IN_ROLL,IN_YAW,IN_FREQ))

		# related inputs for a key
        self[1] = atom.Atom(names="inputs")
        self[1][1] = atom.Atom(domain=domain.Aniso(), policy=self.input.vector_policy(IN_KEY,False), names='key input')
        self[1][2] = atom.Atom(domain=domain.BoundedFloat(0,1), policy=self.input.vector_policy(IN_PRESSURE,False), names='pressure input')
        self[1][3] = atom.Atom(domain=domain.BoundedFloat(-1,1), policy=self.input.vector_policy(IN_ROLL,False), names='roll input')
        self[1][4] = atom.Atom(domain=domain.BoundedFloat(-1,1), policy=self.input.vector_policy(IN_YAW,False), names='yaw input')

        self[1][5] = atom.Atom(names='frequency input', domain=domain.BoundedFloat(1,96000), policy=self.input.vector_policy(IN_FREQ,False))


		# breath output
        self.breath_output = self.t3d_output.create_output("breath",False,1)
        self.breath_input = bundles.VectorInput(self.breath_output, self.domain,signals=(1,))
        self[1][6] = atom.Atom(domain=domain.BoundedFloat(0,1), policy=self.breath_input.vector_policy(1,False), names='breath input')

        # outputs for strips
        self.absstrip1_output = self.t3d_output.create_output("strip1",False,4)
        self.absstrip1_input = bundles.VectorInput(self.absstrip1_output, self.domain,signals=(1,))
        self[1][7] = atom.Atom(domain=domain.BoundedFloat(-1,1), policy=self.absstrip1_input.vector_policy(1,False), names='absolute strip input', ordinal=1)
        self.absstrip2_output = self.t3d_output.create_output("strip2",False,5)
        self.absstrip2_input = bundles.VectorInput(self.absstrip2_output, self.domain,signals=(1,))
        self[1][8] = atom.Atom(domain=domain.BoundedFloat(-1,1), policy=self.absstrip2_input.vector_policy(1,False), names='absolute strip input', ordinal=2)
        self.strippos1_output = self.t3d_output.create_output("d_strip1",False,2)
        self.strippos1_input = bundles.VectorInput(self.strippos1_output, self.domain,signals=(1,))
        self[1][9] = atom.Atom(domain=domain.BoundedFloat(-1,1), policy=self.strippos1_input.vector_policy(1,False), names='strip position input', ordinal=1)
        self.strippos2_output = self.t3d_output.create_output("d_strip2",False,3)
        self.strippos2_input = bundles.VectorInput(self.strippos2_output, self.domain,signals=(1,))
        self[1][10] = atom.Atom(domain=domain.BoundedFloat(-1,1), policy=self.strippos2_input.vector_policy(1,False), names='strip position input', ordinal=2)

        self.p1_output = self.t3d_output.create_output("pedal1",False,6)
        self.p1_input = bundles.VectorInput(self.p1_output, self.domain,signals=(1,))
        self[1][11] = atom.Atom(domain=domain.BoundedFloat(-1,1), policy=self.p1_input.vector_policy(1,False), names='pedal input', ordinal=1)

        self.p2_output = self.t3d_output.create_output("pedal2",False,7)
        self.p2_input = bundles.VectorInput(self.p2_output, self.domain,signals=(1,))
        self[1][12] = atom.Atom(domain=domain.BoundedFloat(-1,1), policy=self.p2_input.vector_policy(1,False), names='pedal input', ordinal=2)        

        self.p3_output = self.t3d_output.create_output("pedal3",False,8)
        self.p3_input = bundles.VectorInput(self.p3_output, self.domain,signals=(1,)) 
        self[1][13] = atom.Atom(domain=domain.BoundedFloat(-1,1), policy=self.p3_input.vector_policy(1,False), names='pedal input', ordinal=3)
                
        self.p4_output = self.t3d_output.create_output("pedal4",False,9)
        self.p4_input = bundles.VectorInput(self.p4_output, self.domain,signals=(1,))
        self[1][14] = atom.Atom(domain=domain.BoundedFloat(-1,1), policy=self.p4_input.vector_policy(1,False), names='pedal input', ordinal=4)        

        self[2] = atom.Atom(names="host")
        self[2][1] = atom.Atom(domain=domain.String(), init='localhost', names='name', policy=atom.default_policy(self.__set_host));
        self[2][2] = atom.Atom(domain=domain.BoundedInt(1,9999), init=3123, names='port', policy=atom.default_policy(self.__set_port), )

        self[3] = atom.Atom(domain=domain.BoundedInt(1,2000), init=250, policy=atom.default_policy(self.__set_data_freq), names='data frequency')

        self[5] = atom.Atom(domain=domain.BoundedInt(1,16), init=16, policy=atom.default_policy(self.__set_max_voice_count), names='max voice count')
        self[6] = atom.Atom(domain=domain.Bool(),init=False,policy=atom.default_policy(self.__set_kyma_mode),names='kyma')
   
        self.ctlr_fb = piw.functor_backend(1,True)
        self.ctlr_fb.set_functor(piw.pathnull(0),self.t3d_output.control())
        self.ctlr_input = bundles.ScalarInput(self.ctlr_fb.cookie(),self.domain,signals=(IN_CONTROL,))
        self[7] = atom.Atom(domain=domain.Aniso(),policy=self.ctlr_input.policy(IN_CONTROL,False),names='controller input')
 
        self[8] = atom.Atom(domain=domain.Bool(),init=False,policy=atom.default_policy(self.__set_continuous_mode),names='continuous')
  
        self.t3d_output.connect(self[2][1].get_value(), self[2][2].get_value())
示例#25
0
    def __init__(self, address, ordinal):
        #
        agent.Agent.__init__(self,
                             signature=version,
                             names='t3d device',
                             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(1, False, names='key output')
        self[1][2] = bundles.Output(2, False, names='pressure output')
        self[1][3] = bundles.Output(3, False, names='roll output')
        self[1][4] = bundles.Output(4, False, names='yaw output')
        self[1][5] = bundles.Output(5, False, names='frequency')

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

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

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

        # key outputs
        self.koutput = bundles.Splitter(self.domain, self[1][1], self[1][2],
                                        self[1][3], self[1][4], self[1][5])
        self.kpoly = piw.polyctl(10, self.koutput.cookie(), False, 6)
        # breath
        self.boutput = bundles.Splitter(self.domain, self[1][6])
        # strips
        self.s1output = bundles.Splitter(self.domain, self[1][7], self[1][8])
        self.s2output = bundles.Splitter(self.domain, self[1][9], self[1][10])
        # pedals
        self.poutput1 = bundles.Splitter(self.domain, self[1][11])
        self.poutput2 = bundles.Splitter(self.domain, self[1][12])
        self.poutput3 = bundles.Splitter(self.domain, self[1][13])
        self.poutput4 = bundles.Splitter(self.domain, self[1][14])

        # now we need to set of outputs
        self.output = piw.sclone()
        self.output.set_filtered_output(OUT_KEY, self.kpoly.cookie(),
                                        piw.first_filter(OUT_KEY))
        self.output.set_filtered_output(OUT_STRIP_1, self.s1output.cookie(),
                                        piw.first_filter(OUT_STRIP_1))
        self.output.set_filtered_output(OUT_STRIP_2, self.s2output.cookie(),
                                        piw.first_filter(OUT_STRIP_2))
        self.output.set_filtered_output(OUT_BREATH, self.boutput.cookie(),
                                        piw.first_filter(OUT_BREATH))
        self.output.set_filtered_output(OUT_PEDAL_1, self.poutput1.cookie(),
                                        piw.first_filter(OUT_PEDAL_1))
        self.output.set_filtered_output(OUT_PEDAL_2, self.poutput2.cookie(),
                                        piw.first_filter(OUT_PEDAL_2))
        self.output.set_filtered_output(OUT_PEDAL_3, self.poutput3.cookie(),
                                        piw.first_filter(OUT_PEDAL_4))
        self.output.set_filtered_output(OUT_PEDAL_4, self.poutput4.cookie(),
                                        piw.first_filter(OUT_PEDAL_4))

        self.device = t3d_device(self.domain, self.output.cookie())

        self[1][15] = atom.Atom(names='controller output',
                                domain=domain.Aniso(),
                                init=self.controllerinit())

        self[3] = atom.Atom(domain=domain.BoundedInt(1, 30),
                            init=30,
                            policy=atom.default_policy(self.__row_size),
                            names='row size')
        self[4] = atom.Atom(domain=domain.BoundedInt(1, 5),
                            init=5,
                            policy=atom.default_policy(self.__col_size),
                            names='col size')
        self[5] = atom.Atom(domain=domain.Bool(),
                            init=False,
                            policy=atom.default_policy(self.__whole_roll),
                            names='whole roll')
        self[6] = atom.Atom(domain=domain.Bool(),
                            init=False,
                            policy=atom.default_policy(self.__whole_yaw),
                            names='whole yaw')
        self[7] = atom.Atom(domain=domain.BoundedInt(0, 9999),
                            init=3123,
                            policy=atom.default_policy(self.__server_port),
                            names='server port')

        self.input = bundles.VectorInput(self.device.cookie(),
                                         self.domain,
                                         signals=(IN_LIGHT, ))
        self[8] = atom.Atom(domain=domain.BoundedInt(0, 9999),
                            init=0,
                            policy=atom.default_policy(self.__light_port),
                            names='light port')
        self[9] = atom.Atom(domain=domain.Aniso(),
                            protocols='revconnect',
                            policy=self.input.vector_policy(IN_LIGHT,
                                                            False,
                                                            clocked=False),
                            names="light input")
        self[10] = atom.Atom(domain=domain.Bool(),
                             init=False,
                             policy=atom.default_policy(self.__continuous_key),
                             names='continuous key')
        self[11] = atom.Atom(domain=domain.Bool(),
                             init=True,
                             policy=atom.default_policy(self.__touch_mode),
                             names='touch mode')
        self[12] = atom.Atom(domain=domain.Bool(),
                             init=True,
                             policy=atom.default_policy(self.__quantize),
                             names='quantize')

        print "t3d device connect ", self[7], ",", self[8]
        self.device.connect(self[7].get_value(), self[8].get_value())
示例#26
0
文件: atom.py 项目: shamharoth/EigenD
 def __init__(self, init, **kwd):
     Atom.__init__(self, init=init, domain=domain.Bool(), **kwd)
示例#27
0
    def __init__(self, address, ordinal):
        # the agent event clock
        self.domain = piw.clockdomain_ctl()

        # verb container, used by all taps
        agent.Agent.__init__(self,
                             signature=version,
                             names='convolver',
                             container=3,
                             ordinal=ordinal)

        # outputs
        self[1] = bundles.Output(1, True, names="left audio output")
        self[2] = bundles.Output(2, True, names="right audio output")
        self.output = bundles.Splitter(self.domain, self[1], self[2])

        # the convolver class
        self.convolver = convolver_native.convolver(self.output.cookie(),
                                                    self.domain)

        # input has the correlator and a bundle style output
        self.input = bundles.ScalarInput(self.convolver.cookie(),
                                         self.domain,
                                         signals=(1, 2, 3))

        # self[3] = verb container

        self[4] = ImpulseBrowser(self)

        # audio inputs
        # use vector policy inputs
        self[5] = atom.Atom(domain=domain.BoundedFloat(-1, 1),
                            names="left audio input",
                            policy=self.input.nodefault_policy(1, True))
        self[6] = atom.Atom(domain=domain.BoundedFloat(-1, 1),
                            names="right audio input",
                            policy=self.input.nodefault_policy(2, True))

        # wet/dry mix
        self[7] = atom.Atom(domain=domain.BoundedFloat(0, 1),
                            init=0.5,
                            names="mix",
                            protocols='input',
                            policy=self.input.merge_policy(3, False))
        # effect enable
        self[8] = atom.Atom(domain=domain.Bool(),
                            init=True,
                            names="enable",
                            protocols='input',
                            policy=atom.default_policy(self.__set_enable))
        # mono processing mode
        self[9] = atom.Atom(domain=domain.Bool(),
                            init=False,
                            names="mono",
                            policy=atom.default_policy(
                                self.__set_mono_processing))
        # enable time, time to fade in and out when enabling in ms
        self[10] = atom.Atom(names='enable time input',
                             domain=domain.BoundedFloat(0, 100000),
                             init=100,
                             policy=atom.default_policy(
                                 self.__set_enable_time))

        self.__set_enable(self[8].get_value())
        self.__set_mono_processing(self[9].get_value())
        self.__set_enable_time(self[10].get_value())

        self.add_verb2(
            1,
            'choose([],None,role(None,[ideal([~server,impulse]),singular]))',
            self.__choose)
示例#28
0
    def __init__(self, chan, input, chan_num, vc, default_tap_time):
        print 'Tap, channel init ', chan
        # number of signals
        sigs = 8
        self.input = input
        # by default, feedback and output pan to own channel only
        if chan == "left":
            l_pan_init = 1
            r_pan_init = 0
        else:
            l_pan_init = 0
            r_pan_init = 1

        atom.Atom.__init__(self, names="%s channel" % chan)

        # delay time in beat or seconds, beats +ve, seconds -ve, this is a temporary fix until units are used in domains!
        self[1] = atom.Atom(domain=domain.BoundedFloat(-4, 4),
                            names="time",
                            init=default_tap_time,
                            policy=self.input.policy(chan_num * sigs + 1,
                                                     False),
                            container=vc)
        # feedback
        self[2] = atom.Atom(domain=domain.BoundedFloat(-2, 2),
                            init=0.5,
                            names="feedback",
                            protocols='input',
                            policy=self.input.policy(chan_num * sigs + 2,
                                                     False))
        # filter enable
        self[3] = atom.Atom(domain=domain.Bool(),
                            init=True,
                            names="filter",
                            protocols='input',
                            policy=self.input.policy(chan_num * sigs + 3,
                                                     False))
        # filter cutoff
        self[4] = atom.Atom(domain=domain.BoundedFloat(0, 20000),
                            init=2000,
                            names="cutoff",
                            protocols='input',
                            policy=self.input.policy(chan_num * sigs + 4,
                                                     False))
        # feedback to left channel, explicit stops an implicit connect (e.g. to an left audio input)
        self[5] = atom.Atom(domain=domain.BoundedFloat(0, 1),
                            init=l_pan_init,
                            names="left gain",
                            protocols='input explicit',
                            policy=self.input.policy(chan_num * sigs + 5,
                                                     False))
        # feedback to right channel
        self[6] = atom.Atom(domain=domain.BoundedFloat(0, 1),
                            init=r_pan_init,
                            names="right gain",
                            protocols='input explicit',
                            policy=self.input.policy(chan_num * sigs + 6,
                                                     False))
        # other feedback channels...

        # output to left channel
        self[7] = atom.Atom(domain=domain.BoundedFloat(0, 1),
                            init=l_pan_init,
                            names="left volume",
                            protocols='input explicit',
                            policy=self.input.policy(chan_num * sigs + 7,
                                                     False))
        # output to right channel
        self[8] = atom.Atom(domain=domain.BoundedFloat(0, 1),
                            init=r_pan_init,
                            names="right volume",
                            protocols='input explicit',
                            policy=self.input.policy(chan_num * sigs + 8,
                                                     False))
        # other output channels...

        # delay time set verbs
        self[1].add_verb2(
            1,
            'set([],None,role(None,[instance(~self)]),role(to,[mass([second])]))',
            callback=self.set_time_secs)
        self[1].add_verb2(
            2,
            'set([],None,role(None,[instance(~self)]),role(to,[mass([beat])]))',
            callback=self.set_time_beats)
        self[1].add_verb2(
            3,
            'set([],None,role(None,[instance(~self)]),role(to,[numeric]))',
            callback=self.set_time_beats_default)
        print 'Channel, verbs done'
示例#29
0
    def __init__(self, address, ordinal):
        print "Delay Init"
        # verb container, used by all taps
        agent.Agent.__init__(self,
                             signature=version,
                             names='delay',
                             container=8,
                             ordinal=ordinal)

        # the agent event clock
        self.domain = piw.clockdomain_ctl()

        # outputs
        self[1] = bundles.Output(1, True, names="right audio output")
        self[2] = bundles.Output(2, True, names="left audio output")
        self.output = bundles.Splitter(self.domain, self[1], self[2])

        # the delay class, takes cookies: [audio in, tap], returns [audio out]
        self.delay = piw.delay(self.output.cookie(), self.domain)

        # input has the correlator and a bundle style output
        self.input = bundles.ScalarInput(self.delay.audio_cookie(),
                                         self.domain,
                                         signals=(1, 2, 3, 4, 5, 6))
        # aggregator for tap parameters, combines parameter signals into a single stream
        self.aggregator = piw.aggregator(self.delay.tap_cookie(), self.domain)

        # audio inputs
        # use vector policy inputs
        self[3] = atom.Atom(domain=domain.BoundedFloat(-1, 1),
                            names="left audio input",
                            policy=self.input.nodefault_policy(1, True))
        self[4] = atom.Atom(domain=domain.BoundedFloat(-1, 1),
                            names="right audio input",
                            policy=self.input.nodefault_policy(2, True))

        # more inputs...

        # default tap creation interval
        self[5] = atom.Atom(domain=domain.BoundedFloat(0, 100000),
                            init=0.5,
                            names="tap interval",
                            policy=atom.default_policy(
                                self.__set_tap_interval))
        # TODO: these should be just policy so that these parameters can cause an event to start without needing audio events - merge_policy used for debugging
        # wet/dry mix
        self[6] = atom.Atom(domain=domain.BoundedFloat(0, 1),
                            init=0.5,
                            names="mix",
                            protocols='input',
                            policy=self.input.merge_policy(3, False))
        # master feedback, 'protocols='input' is metadata that labels this as an input without it appearing in Belcanto
        self[9] = atom.Atom(domain=domain.BoundedFloat(0, 2),
                            init=1,
                            names="master feedback",
                            protocols='input',
                            policy=self.input.merge_policy(4, False))
        # input from the metronome to determine tap times from the tempo
        self[10] = atom.Atom(domain=domain.BoundedFloat(0, 100000),
                             init=120,
                             names="tempo input",
                             policy=self.input.merge_policy(5, False))
        # offset feedback,
        self[11] = atom.Atom(domain=domain.BoundedFloat(-2, 2),
                             init=0,
                             names="offset feedback",
                             protocols='input',
                             policy=self.input.merge_policy(6, False))

        # verb to create a tap, no tap number given
        self.add_verb2(1, 'create([],None,role(None,[matches([tap])]))',
                       self.__create_tap)

        # verb to uncreate a tap, tap number is given, #7 is self[7]
        self.add_verb2(2, 'create([un],None,role(None,[partof(~(a)"#7")]))',
                       self.__uncreate_tap)

        # verb to reset delay lines
        self.add_verb2(3, 'clear([],None)', self.__reset_delay_lines)

        # create tap at default time, 1/8 beat
        self.default_tap_time = 0.5
        # default delay interval is 1/8 beat after previous time
        self.default_tap_interval = 0.5

        # the list of taps
        self[7] = TapList(self)

        # effect enable
        self[12] = atom.Atom(domain=domain.Bool(),
                             init=True,
                             names="enable",
                             protocols='input',
                             policy=atom.default_policy(self.__set_enable))

        # enable time, time to fade in and out when enabling in ms
        self[13] = atom.Atom(names='enable time input',
                             domain=domain.BoundedFloat(0, 100000),
                             init=100,
                             policy=atom.default_policy(
                                 self.__set_enable_time))

        print "create default tap..."

        # create a single default tap
        self[7][1] = Tap(self, 1, self.default_tap_time)
        self.default_tap_time += self.default_tap_interval

        print "done."
示例#30
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)