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

        self.finder = talker.TalkerFinder()

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

        self[1] = self.verb_container()

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

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

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

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

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

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

        self[7] = Parameters(self)

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

        self.add_verb2(1,'play([],None)',create_action=self.__play,clock=True)
        self.add_verb2(2,'play([un],None)',create_action=self.__unplay,clock=True)
        self.add_verb2(3,'cancel([],None,role(None,[numeric]),option(called,[numeric]))',self.__cancel_verb)
        self.add_verb2(4,'clear([],None)',self.__clear_verb)
        self.add_verb2(5,'do([],None,role(None,[abstract]),role(when,[numeric]),option(called,[numeric]))', self.__do_verb)
        self.model.playstop_set(piw.make_change_nb(utils.slowchange(self.__play_set)))
Example #2
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)
Example #3
0
    def __init__(self, address, ordinal):
        agent.Agent.__init__(self,signature=version,names='clicker',container=3,ordinal=ordinal)
        self.domain = piw.clockdomain_ctl()
        accent = wav_resource('accent.wav')
        beat = wav_resource('beat.wav')

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

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

        self.add_verb2(1,'play([],None)',self.__play,status_action=self.__status)
        self.add_verb2(2,'play([un],None)',self.__unplay,status_action=self.__status)
        self.add_verb2(3,'play([toggle],None)',self.__toggle,status_action=self.__status)
        
        self[4]=bundles.Output(1,False,names='status output')
        self.light_output=bundles.Splitter(self.domain,self[4])
        self.lights=piw.lightsource(piw.change_nb(),0,self.light_output.cookie())
        self.lights.set_size(1)
        self.lights.set_status(1,const.status_inactive)
        self.__playstate = node.Server(value=piw.makebool(True,0),change=self.__playchanged)
        self.set_private(self.__playstate)
        self.__playing=False
Example #4
0
 def nativekeyboard_setup(self):
     self.keyboard = keyboard_native.tau_bundle(self.usbdev,
                                                self.kclone.cookie(),
                                                utils.notify(self.dead))
     self.audio_input = bundles.ScalarInput(self.keyboard.audio_cookie(),
                                            self.domain,
                                            signals=(1, 2))
     self[103] = HeadphoneInput(self)
Example #5
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)
Example #6
0
    def __init__(self, main_agent, chan_num):
        atom.Atom.__init__(self, names='mixer channel', ordinal=chan_num)
        self.main_agent = main_agent
        self.chan_num = chan_num

        self.aggregator = piw.aggregator(
            main_agent.mixer.create_channel(chan_num - 1), main_agent.clk)

        self.control_input = bundles.ScalarInput(self.aggregator.get_output(1),
                                                 main_agent.clk,
                                                 signals=(1, 2))
        self.audio_input = bundles.VectorInput(self.aggregator.get_output(2),
                                               main_agent.clk,
                                               signals=(1, 2))

        self[1] = atom.Atom(domain=domain.BoundedFloat(-1, 1),
                            init=0,
                            names='left audio input',
                            policy=self.audio_input.vector_policy(1, True),
                            protocols='obm')
        self[2] = atom.Atom(domain=domain.BoundedFloat(-1, 1),
                            init=0,
                            names='right audio input',
                            policy=self.audio_input.vector_policy(2, True),
                            protocols='obm')

        self[3] = atom.Atom(names='controls')
        self[3][1] = 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='volume',
                               policy=self.control_input.notify_policy(
                                   1,
                                   policy.LopassStreamPolicy(1000, 0.97),
                                   notify=main_agent.changes_pending),
                               protocols='bind input')
        self[3][2] = atom.Atom(domain=domain.BoundedFloat(
            -1,
            1,
            hints=(T('stageinc',
                     0.1), T('inc', 0.02), T('biginc',
                                             0.2), T('control', 'updown'))),
                               init=0,
                               names='pan',
                               policy=self.control_input.notify_policy(
                                   2,
                                   policy.LopassStreamPolicy(1000, 0.97),
                                   notify=main_agent.changes_pending),
                               protocols='bind input')

        # fx send controls
        self[4] = FxSendControlsList()
Example #7
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()
Example #8
0
    def __init__(self, address, ordinal):
        agent.Agent.__init__(self,
                             signature=version,
                             names='stereo mixer',
                             protocols='inputlist has_subsys',
                             icon='plg_synth/mixer.png',
                             ordinal=ordinal)

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

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

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

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

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

        for n in range(0, num_inputs):
            ss = Input(n + 1, self.vol, self.pan, self.clk,
                       self.aggregator.get_output(n + 2), self.signature)
            self.add_subsystem(str(n), ss)
Example #9
0
    def __init__(self, index, vol, pan, clk, cookie, sig):
        agent.Agent.__init__(self,
                             names='mixer channel',
                             ordinal=index,
                             protocols='bind is_subsys notagent',
                             subsystem='channel',
                             signature=version)

        self.channel_mixer = piw.stereomixer(vol, pan, clk, cookie)
        self.aggregator = piw.aggregator(self.channel_mixer.cookie(), clk)

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

        self[1] = atom.Atom(domain=domain.BoundedFloat(-1, 1),
                            init=0,
                            names='left audio input',
                            policy=self.audio_input.vector_policy(1, True),
                            protocols='obm')
        self[2] = atom.Atom(domain=domain.BoundedFloat(-1, 1),
                            init=0,
                            names='right audio input',
                            policy=self.audio_input.vector_policy(2, True),
                            protocols='obm')
        self[3] = atom.Atom(
            domain=domain.BoundedFloat(0,
                                       120,
                                       hints=(T('inc', 1), T('biginc', 10),
                                              T('control', 'updown'))),
            init=50,
            names='volume',
            policy=self.ctl_input.policy(1,
                                         policy.LopassStreamPolicy(1000,
                                                                   0.97)),
            protocols='bind input')
        self[4] = atom.Atom(
            domain=domain.BoundedFloat(-1,
                                       1,
                                       hints=(T('inc', 0.02), T('biginc', 0.2),
                                              T('control', 'updown'))),
            init=0,
            names='pan',
            policy=self.ctl_input.policy(2,
                                         policy.LopassStreamPolicy(1000,
                                                                   0.97)),
            protocols='bind input')
Example #10
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))
Example #11
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()
Example #12
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))
Example #13
0
    def __init__(self, agent, tapno, default_tap_time):
        print 'Tap, tap init ', tapno

        self.__agent = agent
        self.__tapno = tapno
        atom.Atom.__init__(self,
                           ordinal=tapno,
                           names='tap',
                           container=(None, 'tap%s' % tapno, agent[8]))

        self.input = bundles.ScalarInput(agent.aggregator.get_output(tapno),
                                         agent.domain,
                                         signals=(1, 2, 3, 4, 5, 6, 7, 8, 9,
                                                  10, 11, 12, 13, 14, 15, 16))

        self[1] = Channel("left", self.input, 0,
                          (None, 'left%s' % tapno, agent[8]), default_tap_time)
        self[2] = Channel("right", self.input, 1,
                          (None, 'right%s' % tapno, agent[8]),
                          default_tap_time)
Example #14
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))
Example #15
0
    def __init__(self, address, ordinal):

        agent.Agent.__init__(self,
                             names='midi clock',
                             signature=version,
                             container=100,
                             ordinal=ordinal)

        self.domain = piw.clockdomain_ctl()

        # the MIDI stream output
        self[1] = bundles.Output(1, False, names="midi output")
        self.output = bundles.Splitter(self.domain, self[1])

        self.midi_clock = midi_native.midi_clock(self.output.cookie(),
                                                 self.domain)

        # the inputs from the metronome
        self.input = bundles.ScalarInput(self.midi_clock.cookie(),
                                         self.domain,
                                         signals=(1, 2, 3))

        self[2] = atom.Atom(names='metronome inputs')
        self[2][1] = atom.Atom(domain=domain.Aniso(),
                               policy=self.input.policy(1, False),
                               names='running input')
        self[2][2] = atom.Atom(domain=domain.Aniso(),
                               policy=self.input.policy(2, False),
                               names='song beat input')
        self[2][3] = atom.Atom(domain=domain.BoundedFloat(0, 100000),
                               init=120,
                               policy=self.input.policy(3, False),
                               names="tempo input")

        h = (T('inc', 0.5), T('biginc', 10), T('control', 'updown'))
        self[3] = atom.Atom(domain=domain.BoundedFloat(-500, 500, hints=h),
                            init=0,
                            policy=atom.default_policy(self.__set_delay),
                            names="delay")
Example #16
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."
Example #17
0
    def __init__(self, address, ordinal):
        agent.Agent.__init__(self,signature=version,names='audio unit',container=100)
        self.set_property_long('cordinal',ordinal)

        self.__state = PluginState(self.__plugin_state_loaded)
        self.set_private(self.__state)

        self.__browser = PluginBrowser(self)
        self.__domain = piw.clockdomain_ctl()
        self.__audio_output = audio.AudioOutput(bundles.Splitter(self.__domain),1,2)
        self.__audio_output_channels = audio.AudioChannels(self.__audio_output)
        self.__midi_output = bundles.Splitter(self.__domain)
        self.__observer = PluginObserver(self.__state,self)
        self.__channel_delegate = MidiChannelDelegate(self)
        self.__host = host_native.plugin_instance(
            self.__observer, self.__channel_delegate,
            self.__domain,self.__audio_output.cookie(),self.__midi_output.cookie(),
            utils.statusify(self.__window_state_changed))
        self.parameter_list = inputparameter.List(self.__host,self.__host.clock_domain(),self.verb_container())
        self.__audio_input = audio.AudioInput(bundles.ScalarInput(self.__host.audio_input(),self.__domain,signals=range(1,65)),1,2)
        self.__audio_input_channels = audio.AudioChannels(self.__audio_input)
        self.__velocity_detector = piw.velocitydetect(self.__host.midi_from_belcanto(),1,4)
        self.__key_input = bundles.VectorInput(self.__velocity_detector.cookie(),self.__domain,signals=(1,2))
        self.__midi_input = bundles.ScalarInput(self.__host.midi_aggregator(),self.__domain,signals=(1,))
        self.__metronome_input = bundles.ScalarInput(self.__host.metronome_input(),self.__domain,signals=(1,2,3,4))
        self.__host.set_bypassed(True)

        # plugin browser
        self[1] = self.__browser

        # audio output
        self[2] = atom.Atom()
        self[2][1] = self.__audio_output
        self[2][2] = self.__audio_output_channels

        # audio input
        self[3] = atom.Atom()
        self[3][1] = self.__audio_input
        self[3][2] = self.__audio_input_channels

        # parameter mapping
        self[4] = self.parameter_list

        # metronome input
        self[5] = atom.Atom()
        self[5][1] = atom.Atom(domain=domain.Aniso(),policy=self.__metronome_input.nodefault_policy(1,False),names='song beat input')
        self[5][2] = atom.Atom(domain=domain.Aniso(),policy=self.__metronome_input.nodefault_policy(2,False),names='running input')
        self[5][3] = atom.Atom(domain=domain.Aniso(),policy=self.__metronome_input.nodefault_policy(3,False),names='tempo input')
        self[5][4] = atom.Atom(domain=domain.Aniso(),policy=self.__metronome_input.nodefault_policy(4,False),names='bar beat input')

        # kbd/controller inputs
        self[6] = atom.Atom()
        self[6][1] = atom.Atom(domain=domain.Aniso(),policy=self.__key_input.vector_policy(1,False),names='pressure input')
        self[6][2] = atom.Atom(domain=domain.Aniso(),policy=self.__key_input.merge_nodefault_policy(2,False),names='frequency input')

        # midi channel 
        self[7] =  atom.Atom(domain=domain.BoundedInt(0,16),init=0,names='midi channel',policy=atom.default_policy(self.set_midi_channel))

        # velocity curve control
        self[8] = atom.Atom()
        self[8][1] = atom.Atom(domain=domain.BoundedInt(1,1000),init=4,names='velocity sample',policy=atom.default_policy(self.__set_velocity_samples))
        self[8][2] = atom.Atom(domain=domain.BoundedFloat(0.1,10),init=4,names='velocity curve',policy=atom.default_policy(self.__set_velocity_curve))
        self[8][3] = atom.Atom(domain=domain.BoundedFloat(0.1,10),init=4,names='velocity scale',policy=atom.default_policy(self.__set_velocity_scale))

        self[10] = atom.Atom(domain=domain.BoundedFloatOrNull(0,100000),init=None,names='tail time',policy=atom.default_policy(self.__set_tail_time))
        self[11] = atom.Atom(domain=domain.BoundedInt(1,16),init=1,names='minimum channel',policy=atom.default_policy(self.set_min_channel))
        self[12] = atom.Atom(domain=domain.BoundedInt(1,16),init=16,names='maximum channel',policy=atom.default_policy(self.set_max_channel))

        # status output to drive the talker lights
        self[13] = bundles.Output(1,False,names='status output')
        self.light_output = bundles.Splitter(self.__domain,self[13])
        self.lights = piw.lightsource(piw.change_nb(),0,self.light_output.cookie())
        self.lights.set_size(2)
        self.set_light(1,True)
        self.set_light(2,False)

        # midi I/O
        # midi input
        self[14] = atom.Atom(domain=domain.Aniso(),policy=self.__midi_input.nodefault_policy(1,False),names='midi input')
        # midi output
        self[15] = self.__midi_output.add_output(bundles.Output(1,False,names='midi output'))

        self.add_verb2(1,'show([],None)',callback=self.__show)
        self.add_verb2(2,'show([un],None)',callback=self.__unshow)
        self.add_verb2(3,'close([],None)',callback=self.__close)
        self.add_verb2(4,'bypass([toggle],None)',callback=self.__tog_bypass,status_action=self.__status_bypass)
        self.add_verb2(5,'show([toggle],None)',callback=self.__tog_show,status_action=self.__status_show)
        self.add_verb2(6,'open([],None,role(None,[abstract]))',callback=self.__open)
        self.add_verb2(7,'scan([],None)',callback=self.__browser.refresh_plugin_list)
        self.add_verb2(8,'bypass([],None)',callback=self.__bypass)
        self.add_verb2(9,'bypass([un],None)',callback=self.__unbypass)

        self.set_ordinal(ordinal)
Example #18
0
    def __init__(self, address, ordinal):
        agent.Agent.__init__(self, signature=version, names='kmapper', icon='plg_simple/kgroup.png',container=17,ordinal=ordinal)

        self.__cur_size = 0
        self.__choices=[]
        self.__coursekeys=[]
        self.__course=1

        self.__private = node.Server(value=piw.makestring('[]',0),change=self.__set_members)
        self.set_private(self.__private)

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

        self.mapper = piw.kgroup_mapper()

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

        self.loutput = bundles.Splitter(self.domain,self[1])
        self.lmapper = piw.clone(True)
        self.lmapper.set_filtered_output(1,self.loutput.cookie(),self.mapper.light_filter())
        self.lmux = piw.multiplexer(self.lmapper.cookie(),self.domain)

        self.linput = bundles.VectorInput(self.lmux.get_input(1),self.domain,signals=(1,))

        self[2] = atom.Atom(names='light input',protocols='revconnect',policy=self.linput.vector_policy(1,False,False),domain=domain.Aniso())

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

        self.soutput = bundles.Splitter(self.domain,self[3],self[4],self[5])
        self.sgate = piw.gate(self.soutput.cookie(),True)
        self.sinput = bundles.VectorInput(self.sgate.cookie(),self.domain,signals=(1,2,3))

        self[6] = atom.Atom(domain=domain.BoundedFloat(-1,1),policy=self.sinput.vector_policy(1,False),names='strip position input',ordinal=1)
        self[7] = atom.Atom(domain=domain.BoundedFloat(-1,1),policy=self.sinput.vector_policy(2,False),names='strip position input',ordinal=2)
        self[8] = atom.Atom(domain=domain.BoundedFloat(0,1),policy=self.sinput.vector_policy(3,False),names='breath input')

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

        self.koutput = bundles.Splitter(self.domain,self[9],self[10],self[11],self[12])
        self.kpoly = piw.polyctl(10,self.koutput.cookie(),False,5)

        self.kclone = piw.clone(True)
        self.kclone.set_policy(False)
        self.kinput = bundles.VectorInput(self.kclone.cookie(),self.domain,signals=(1,2,3,4),filter=self.mapper.key_filter())

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

        self.kclone.set_output(1,self.kpoly.cookie())

        #self.add_verb2(2,'choose([],None,role(None,[matches([k])]),option(from,[numeric,singular]))',self.__choose2)
        #self.add_verb2(3,'choose([],None,role(None,[mass([k])]))',self.__choose3)
        #self.add_verb2(4,'clear([],None)',self.__clear)
        #self.add_verb2(5,'add([],None,role(None,[mass([k])]))',self.__add)

        self.add_verb2(7,'choose([],None,role(None,[matches([k])]),option(as,[numeric]))',self.__choose)
        self.add_verb2(8,'set([],None,role(None,[tagged_ideal([~server,course],[offset])]),role(to,[mass([semitone])]))',callback=self.__set_course_semi)
        self.add_verb2(9,'set([],None,role(None,[tagged_ideal([~server,course],[offset])]),role(to,[mass([interval])]))',callback=self.__set_course_int)
        self.add_verb2(12,'clear([],None,option(None,[mass([course])]))',self.__kclear)
        self.add_verb2(13,'add([],None,role(None,[mass([k])]),option(to,[mass([course])]))',self.__kadd)
        self.add_verb2(14,'add([],None,role(None,[mass([k])]),role(to,[mass([k])]),option(as,[mass([course])]))',self.__radd)

        self[20] = VirtualKey(lambda: self.__cur_size)

        self.statusbuffer = piw.statusbuffer(self.lmux.gate_input(),2,self.lmux.get_input(2))
        self.selgate = piw.functor_backend(1,True)
        self.kclone.set_output(2,self.selgate.cookie())

        self.statusbuffer.enable(1)
        self.kclone.enable(1,True)
        self.sgate.enable(True)

        self.__upstream_size = 0
        self.__set_poly()
        self[21] = atom.Atom(domain=domain.Aniso(),policy=atom.default_policy(self.__upstream),names='controller input')

        self[22] = VirtualChannel()
        
        self[23] = bundles.Output(1,False, names='controller output', continuous=True)
        self.coutput = bundles.Splitter(self.domain,self[23])
        self.controller = Controller(self.coutput.cookie())
        self.__private[2]=self.controller.state()
        self.cgate = piw.gate(self.controller.cookie(),True)
        self.cinput = bundles.ScalarInput(self.cgate.cookie(),self.domain,signals=(1,))
        self[24] = atom.Atom(domain=domain.Aniso(), policy=self.cinput.nodefault_policy(1,False),names='controller input')
        self[25] = VirtualCourse(self.controller)
Example #19
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()
Example #20
0
    def __init__(self, address, ordinal):
        # self[3] is the verb container
        agent.Agent.__init__(self,
                             signature=version,
                             names='console mixer',
                             protocols='inputlist has_subsys browse',
                             icon='plg_synth/mixer.png',
                             container=3,
                             ordinal=ordinal)

        self.__private = node.Server()
        self.set_private(self.__private)
        self.__private[1] = container.PersistentFactory(
            asserted=self.__inst_asserted, retracted=self.__inst_retracted)

        self.__private[2] = node.server(value=piw.makestring('testing1', 0))

        self.clk = piw.clockdomain_ctl()

        pan_function = pan_laws[default_pan]

        # make vol and pan tables
        self.vol = piw.make_f2f_table(
            0, 120, 1000, picross.make_f2f_functor(volume_function))
        self.pan = piw.make_f2f_table(-1, 1, 1000,
                                      picross.make_f2f_functor(pan_function))

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

        self.mixer = piw.consolemixer(self.vol, self.pan, self.clk,
                                      self.output.cookie())

        sh = (T('choices', *pan_laws.keys()), T('control', 'selector'))
        self[10] = atom.Atom(names='pan curve',
                             domain=domain.String(hints=sh),
                             init='default',
                             policy=atom.default_policy(self.__set_pan))

        # channel dicts
        self.channels = {}
        self.fxchannels = {}

        # adds subsystems numbered 1..24, which means effect channels cannot be called 1..24 ...
        for n in range(0, num_inputs):
            ss = Channel(self, n + 1, self.clk, self.mixer.create_channel(n))
            self.add_subsystem(str(n), ss)
            self.channels[n] = ss

        self.master_controls_input = bundles.ScalarInput(
            self.mixer.master_controls_cookie(), self.clk, signals=(1, 2))

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

        # verbs
        # verb to create a named effect channel
        self.add_verb2(
            1,
            'create([],None,role(None,[abstract,matches([effect])]), role(called,[abstract]))',
            self.__create_named_fx_chan)
        self.add_verb2(
            2,
            'create([un],None,role(None, [abstract,matches([effect])]), role(called,[abstract]))',
            self.__uncreate_named_fx_chan)

        self.add_verb2(
            3,
            'label([],None,role(None,[mass([channel])]),role(to,[abstract]))',
            self.__label)
        self.add_verb2(4, 'label([un],None,role(None,[mass([channel])]))',
                       self.__unlabel)
        self.add_verb2(
            5,
            'label([],None,role(None,[mass([effect])]),role(to,[abstract]))',
            self.__labelfx)
        self.add_verb2(6, 'label([un],None,role(None,[mass([effect])]))',
                       self.__unlabelfx)

        self.__timestamp = piw.tsd_time()
        self.__selected = None

        self.__pending = True
        self.__thing = piw.thing()
        piw.tsd_thing(self.__thing)
        self.__thing.set_slow_timer_handler(utils.notify(self.update))
        self.__thing.timer_slow(500)
Example #21
0
    def __init__(self, address, ordinal):
        agent.Agent.__init__(self,
                             signature=version,
                             names='audio unit',
                             container=100,
                             ordinal=ordinal)

        self.__state = PluginState(self.__plugin_state_loaded)
        self.set_private(self.__state)

        self.__browser = PluginBrowser(self)
        self.__domain = piw.clockdomain_ctl()
        self.__audio_output = audio.AudioOutput(bundles.Splitter(
            self.__domain),
                                                1,
                                                2,
                                                names='channels')
        self.__audio_output_channels = audio.AudioChannels(self.__audio_output)
        self.__midi_output = bundles.Splitter(self.__domain)
        self.__observer = PluginObserver(self.__state, self)
        self.host = host_native.plugin_instance(
            self.__observer, self.__domain, self.__audio_output.cookie(),
            self.__midi_output.cookie(),
            utils.statusify(self.__window_state_changed))
        self.parameter_list = inputparameter.List(self.host,
                                                  self.host.clock_domain(),
                                                  self.verb_container())
        self.__audio_input = audio.AudioInput(bundles.ScalarInput(
            self.host.audio_input_cookie(),
            self.__domain,
            signals=range(1, 65)),
                                              1,
                                              2,
                                              names='channels')
        self.__audio_input_channels = audio.AudioChannels(self.__audio_input)
        self.__key_input = bundles.VectorInput(
            self.host.midi_from_belcanto_cookie(),
            self.__domain,
            signals=(1, 2))
        self.__midi_input = bundles.ScalarInput(
            self.host.midi_aggregator_cookie(), self.__domain, signals=(1, ))
        self.__metronome_input = bundles.ScalarInput(
            self.host.metronome_input_cookie(),
            self.__domain,
            signals=(1, 2, 3, 4))
        self.host.set_bypassed(True)

        # plugin browser
        self[1] = self.__browser

        # audio output
        self[2] = atom.Atom(names='audio outputs')
        self[2][1] = self.__audio_output
        self[2][2] = self.__audio_output_channels

        # audio input
        self[3] = atom.Atom(names='audio inputs')
        self[3][1] = self.__audio_input
        self[3][2] = self.__audio_input_channels

        # parameter mapping
        self[4] = self.parameter_list

        # metronome input
        self[5] = atom.Atom(names='metronome inputs')
        self[5][1] = atom.Atom(domain=domain.Aniso(),
                               policy=self.__metronome_input.nodefault_policy(
                                   1, False),
                               names='song beat input')
        self[5][2] = atom.Atom(domain=domain.Aniso(),
                               policy=self.__metronome_input.nodefault_policy(
                                   2, False),
                               names='running input')
        self[5][3] = atom.Atom(domain=domain.Aniso(),
                               policy=self.__metronome_input.nodefault_policy(
                                   3, False),
                               names='tempo input')
        self[5][4] = atom.Atom(domain=domain.Aniso(),
                               policy=self.__metronome_input.nodefault_policy(
                                   4, False),
                               names='bar beat input')

        # kbd/controller inputs
        self[6] = atom.Atom(names='musical inputs')
        self[6][1] = atom.Atom(domain=domain.Aniso(),
                               policy=self.__key_input.vector_policy(1, False),
                               names='pressure input')
        self[6][2] = atom.Atom(domain=domain.Aniso(),
                               policy=self.__key_input.merge_nodefault_policy(
                                   2, False),
                               names='frequency input')

        # midi channel
        self[7] = atom.Atom(domain=domain.BoundedInt(0, 20),
                            init=0,
                            names='midi channel',
                            policy=atom.default_policy(self.set_midi_channel))

        # velocity curve control
        vel = (T('stageinc', 0.1), T('inc', 0.1), T('biginc',
                                                    1), T('control', 'updown'))
        self[8] = atom.Atom(names='velocity curve controls')
        self[8][1] = atom.Atom(domain=domain.BoundedInt(1, 1000),
                               init=4,
                               names='velocity sample',
                               policy=atom.default_policy(
                                   self.__set_velocity_samples))
        self[8][2] = atom.Atom(domain=domain.BoundedFloat(0.1, 10, hints=vel),
                               init=4,
                               names='velocity curve',
                               policy=atom.default_policy(
                                   self.__set_velocity_curve))
        self[8][3] = atom.Atom(domain=domain.BoundedFloat(0.1, 10, hints=vel),
                               init=4,
                               names='velocity scale',
                               policy=atom.default_policy(
                                   self.__set_velocity_scale))

        self[9] = atom.Atom(domain=domain.Bool(),
                            init=True,
                            names='tail time enable',
                            policy=atom.default_policy(
                                self.__set_tail_time_enabled))
        self[10] = atom.Atom(domain=domain.BoundedFloatOrNull(0, 100000),
                             init=10,
                             names='tail time',
                             policy=atom.default_policy(self.__set_tail_time))
        self[11] = atom.Atom(domain=domain.BoundedInt(1, 16),
                             init=1,
                             names='minimum channel',
                             policy=atom.default_policy(self.set_min_channel))
        self[12] = atom.Atom(domain=domain.BoundedInt(1, 16),
                             init=16,
                             names='maximum channel',
                             policy=atom.default_policy(self.set_max_channel))

        # other global settings inputs
        self[20] = atom.Atom(domain=domain.BoundedInt(0, 100),
                             init=0,
                             names="minimum decimation",
                             policy=atom.default_policy(
                                 self.set_min_decimation))
        self[21] = atom.Atom(domain=domain.Bool(),
                             init=True,
                             names="notes enable",
                             policy=atom.default_policy(self.set_midi_notes))
        self[22] = atom.Atom(domain=domain.Bool(),
                             init=True,
                             names="pitch bend enable",
                             policy=atom.default_policy(
                                 self.set_midi_pitchbend))
        self[23] = atom.Atom(domain=domain.Bool(),
                             init=False,
                             names="high resolution velocity enable",
                             policy=atom.default_policy(
                                 self.set_midi_hires_velocity))
        self[24] = atom.Atom(domain=domain.BoundedInt(0, 96),
                             init=1,
                             names="pitch bend range upper",
                             policy=atom.default_policy(self.set_pitchbend_up))
        self[25] = atom.Atom(domain=domain.BoundedInt(0, 96),
                             init=1,
                             names="pitch bend range lower",
                             policy=atom.default_policy(
                                 self.set_pitchbend_down))

        # status output to drive the talker lights
        self[13] = bundles.Output(1, False, names='status output')
        self.light_output = bundles.Splitter(self.__domain, self[13])
        self.lights = piw.lightsource(piw.change_nb(), 0,
                                      self.light_output.cookie())
        self.lights.set_size(2)
        self.set_light(1, True)
        self.set_light(2, False)

        # midi I/O
        # midi input
        self[14] = atom.Atom(domain=domain.Aniso(),
                             policy=self.__midi_input.nodefault_policy(
                                 1, False),
                             names='midi input')
        # midi output
        self[15] = self.__midi_output.add_output(
            bundles.Output(1, False, names='midi output'))

        # controller input/output to add labels
        self[16] = atom.Atom(
            domain=domain.Aniso(hints=(logic.make_term('continuous'), )),
            names='controller output',
            policy=atom.readonly_policy())

        self[17] = atom.Atom(domain=domain.String(),
                             init='Plugin',
                             names='label category',
                             policy=atom.default_policy(self.__set_category))
        self[18] = atom.Atom(domain=domain.String(),
                             init='',
                             names='label',
                             policy=atom.default_policy(self.__set_label))

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

        self.__ctl = []

        # verbs
        self.add_verb2(1, 'show([],None)', callback=self.__show)
        self.add_verb2(2, 'show([un],None)', callback=self.__unshow)
        self.add_verb2(3, 'close([],None)', callback=self.__close)
        self.add_verb2(4,
                       'bypass([toggle],None)',
                       callback=self.__tog_bypass,
                       status_action=self.__status_bypass)
        self.add_verb2(5,
                       'show([toggle],None)',
                       callback=self.__tog_show,
                       status_action=self.__status_show)
        self.add_verb2(6,
                       'open([],None,role(None,[abstract]))',
                       callback=self.__open)
        self.add_verb2(7,
                       'scan([],None)',
                       callback=self.__browser.refresh_plugin_list)
        self.add_verb2(8, 'bypass([],None)', callback=self.__bypass)
        self.add_verb2(9, 'bypass([un],None)', callback=self.__unbypass)

        # control change
        self.add_verb2(
            10,
            'set([],~a,role(None,[matches([midi,program])]),role(to,[numeric]))',
            create_action=self.__set_program_change)
        self.add_verb2(
            11,
            'set([],~a,role(None,[matches([midi,bank])]),role(to,[numeric]))',
            create_action=self.__set_bank_change)
        self.add_verb2(
            12,
            'set([],~a,role(None,[mass([midi,controller])]),role(to,[numeric]))',
            create_action=self.__set_midi_control)

        self.set_ordinal(ordinal)
Example #22
0
    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)
Example #23
0
 def audio_input_setup(self):
     self.audio_input = bundles.ScalarInput(self.keyboard.audio_cookie(),
                                            self.domain,
                                            signals=(1, 2))
     self[103] = HeadphoneInput(self)
Example #24
0
    def __init__(self, main_agent, fx_chan_num):
        atom.Atom.__init__(self,
                           names='effect',
                           protocols='remove',
                           ordinal=fx_chan_num)
        self.main_agent = main_agent
        self.fx_chan_num = fx_chan_num

        # audio send output
        self[3] = atom.Atom(names='outputs')
        self[3][1] = bundles.Output(1, True, names='left audio output')
        self[3][2] = bundles.Output(2, True, names='right audio output')
        self.send_output = bundles.Splitter(main_agent.clk, self[3][1],
                                            self[3][2])

        output_cookie = self.send_output.cookie()
        # create fx_chan_num-1 to start channel implementation index at 0
        input_cookie = main_agent.mixer.create_fx_channel(
            fx_chan_num - 1, output_cookie)

        self.aggregator = piw.aggregator(input_cookie, main_agent.clk)

        self.control_input = bundles.ScalarInput(self.aggregator.get_output(1),
                                                 main_agent.clk,
                                                 signals=(1, 2))
        self[4] = atom.Atom(names='controls')
        self[4][1] = 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='volume',
                               policy=self.control_input.notify_policy(
                                   1,
                                   policy.LopassStreamPolicy(1000, 0.97),
                                   notify=main_agent.changes_pending),
                               protocols='bind input')
        self[4][2] = atom.Atom(domain=domain.BoundedFloat(
            -1,
            1,
            hints=(T('stageinc',
                     0.1), T('inc', 0.02), T('biginc',
                                             0.2), T('control', 'updown'))),
                               init=0,
                               names='pan',
                               policy=self.control_input.notify_policy(
                                   2,
                                   policy.LopassStreamPolicy(1000, 0.97),
                                   notify=main_agent.changes_pending),
                               protocols='bind input')

        # audio return input
        self.return_input = bundles.VectorInput(self.aggregator.get_output(2),
                                                main_agent.clk,
                                                signals=(1, 2))
        self[1] = atom.Atom(domain=domain.BoundedFloat(-1, 1),
                            init=0,
                            names='left audio input',
                            policy=self.return_input.vector_policy(1, True),
                            protocols='obm')
        self[2] = atom.Atom(domain=domain.BoundedFloat(-1, 1),
                            init=0,
                            names='right audio input',
                            policy=self.return_input.vector_policy(2, True),
                            protocols='obm')

        # fx send controls
        self[5] = FxSendControlsList()
Example #25
0
    def __init__(self, main_agent, chan_num, clk, cookie):
        agent.Agent.__init__(self,
                             names='mixer channel',
                             ordinal=chan_num,
                             protocols='bind is_subsys notagent',
                             subsystem='channel',
                             signature=version)
        self.main_agent = main_agent
        self.chan_num = chan_num

        self.aggregator = piw.aggregator(cookie, clk)

        self.control_input = bundles.ScalarInput(self.aggregator.get_output(1),
                                                 clk,
                                                 signals=(1, 2))
        self.audio_input = bundles.VectorInput(self.aggregator.get_output(2),
                                               clk,
                                               signals=(1, 2))

        self.__label = ''
        self.set_private(
            node.server(change=self.__setlabel,
                        value=piw.makestring(self.__label, 0)))

        self[1] = atom.Atom(domain=domain.BoundedFloat(-1, 1),
                            init=0,
                            names='left audio input',
                            policy=self.audio_input.vector_policy(1, True),
                            protocols='obm')
        self[2] = atom.Atom(domain=domain.BoundedFloat(-1, 1),
                            init=0,
                            names='right audio input',
                            policy=self.audio_input.vector_policy(2, True),
                            protocols='obm')

        self[3] = atom.Atom()
        self[3][1] = atom.Atom(domain=domain.BoundedFloat(
            0,
            120,
            hints=(T('inc', 1), T('biginc', 10), T('control', 'updown'))),
                               init=100,
                               names='volume',
                               policy=self.control_input.notify_policy(
                                   1,
                                   policy.LopassStreamPolicy(1000, 0.97),
                                   notify=main_agent.volume_changed),
                               protocols='bind input')
        self[3][2] = atom.Atom(domain=domain.BoundedFloat(
            -1,
            1,
            hints=(T('inc', 0.02), T('biginc', 0.2), T('control', 'updown'))),
                               init=0,
                               names='pan',
                               policy=self.control_input.notify_policy(
                                   2,
                                   policy.LopassStreamPolicy(1000, 0.97),
                                   notify=main_agent.volume_changed),
                               protocols='bind input')

        # fx send controls
        self[4] = atom.Atom()
Example #26
0
    def __init__(self, address, ordinal):
        # self[3] is the verb container
        agent.Agent.__init__(self,
                             signature=version,
                             names='console mixer',
                             protocols='inputlist has_subsys oldbrowse',
                             ordinal=ordinal)

        self.clk = piw.clockdomain_ctl()

        pan_function = pan_laws[default_pan]

        # make vol and pan tables
        self.vol = piw.make_f2f_table(
            -70, 14, 1000, picross.make_f2f_functor(volume_function))
        self.pan = piw.make_f2f_table(-1, 1, 1000,
                                      picross.make_f2f_functor(pan_function))

        self[1] = atom.Atom(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.clk, self[1][1], self[1][2])

        self.mixer = piw.consolemixer(self.vol, self.pan, self.clk,
                                      self.output.cookie())

        self[10] = atom.Atom(
            names='pan curve',
            domain=domain.StringEnum(*sorted(pan_laws.keys())),
            init=default_pan,
            policy=atom.default_policy(self.__set_pan))

        self.master_controls_input = bundles.ScalarInput(
            self.mixer.master_controls_cookie(), self.clk, signals=(1, 2))

        self[2] = atom.Atom(names='master')
        self[2][1] = 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='master volume',
                               policy=self.master_controls_input.notify_policy(
                                   1,
                                   policy.LopassStreamPolicy(100, 0.97),
                                   notify=self.changes_pending))
        self[2][2] = atom.Atom(domain=domain.BoundedFloat(
            -1,
            1,
            hints=(T('stageinc',
                     0.1), T('inc', 0.02), T('biginc',
                                             0.2), T('control', 'updown'))),
                               init=0,
                               names='master pan',
                               policy=self.master_controls_input.policy(
                                   2, policy.LopassStreamPolicy(100, 0.97)))

        self[3] = ChannelList(self)
        self[4] = FxChannelList(self)

        self.channels = self[3]
        self.fxchannels = self[4]

        # add channels numbered 1..24, which means effect channels cannot be called 1..24 ...
        for n in range(0, num_inputs):
            self.channels.create_channel(n + 1)

        # verbs
        # verb to create a named effect channel
        self.add_verb2(
            1,
            'create([],None,role(None,[abstract,matches([effect])]), option(called,[abstract]))',
            self.__create_fx_chan)
        self.add_verb2(
            2,
            'create([un],None,role(None,[concrete,singular,partof(~(a)#4)]))',
            self.__uncreate_fx_chan)

        self.__timestamp = piw.tsd_time()
        self.__selected = None

        self.__pending = True
        self.__thing = piw.thing()
        piw.tsd_thing(self.__thing)
        self.__thing.set_slow_timer_handler(utils.notify(self.update))
        self.__thing.timer_slow(500)
Example #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)
Example #28
0
    def __init__(self, address, ordinal):
        agent.Agent.__init__(self,
                             signature=version,
                             names='audio',
                             icon='plg_macosx/audio.png',
                             container=9,
                             ordinal=ordinal)

        self.domain = piw.clockdomain_ctl()
        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),
                                         threshold=0)
        self.__loading = False

        self[1] = atom.Atom(domain=domain.BoundedFloat(-1, 1),
                            names='left input',
                            policy=self.input.nodefault_policy(1, True))
        self[2] = atom.Atom(domain=domain.BoundedFloat(-1, 1),
                            names='right input',
                            policy=self.input.nodefault_policy(2, True))
        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[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.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()),
                             names='recorder running input')
Example #29
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())
Example #30
0
    def __init__(self, address, ordinal):
        #
        agent.Agent.__init__(self,
                             signature=version,
                             names='midi monitor',
                             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.monitor = midi_monitor(self.domain, self.output.cookie())

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

        self.midi_input = bundles.VectorInput(self.monitor.cookie(),
                                              self.domain,
                                              signals=(IN_MIDI, ))
        self[3] = atom.Atom(domain=domain.Aniso(),
                            policy=self.midi_input.vector_policy(
                                IN_MIDI, False),
                            names="midi input")

        self[4] = atom.Atom(names="inputs")
        self[4][1] = atom.Atom(domain=domain.Bool(),
                               init=True,
                               policy=atom.default_policy(self.__enable_notes),
                               names='enable notes')
        self[4][2] = atom.Atom(domain=domain.Bool(),
                               init=False,
                               policy=atom.default_policy(
                                   self.__enable_poly_pressure),
                               names='enable polyphonic pressure')
        self[4][3] = atom.Atom(domain=domain.Bool(),
                               init=False,
                               policy=atom.default_policy(
                                   self.__enable_cc_as_key),
                               names='enable control with key')
        self[4][4] = atom.Atom(domain=domain.Bool(),
                               init=False,
                               policy=atom.default_policy(
                                   self.__enable_cc_as_course),
                               names='enable control with course')

        self[4][5] = atom.Atom(domain=domain.BoundedInt(0, 16),
                               init=0,
                               policy=atom.default_policy(self.__channel),
                               names='channel')
        self[4][6] = atom.Atom(domain=domain.Bool(),
                               init=False,
                               policy=atom.default_policy(
                                   self.__nearest_match),
                               names='altered note')
        self[4][7] = atom.Atom(domain=domain.Bool(),
                               init=False,
                               policy=atom.default_policy(self.__first_match),
                               names='base note')

        self[4][8] = atom.Atom(domain=domain.Bool(),
                               init=True,
                               policy=atom.default_policy(
                                   self.__use_velocity_as_state),
                               names='velocity for status')
        self[4][9] = atom.Atom(domain=domain.Bool(),
                               init=False,
                               policy=atom.default_policy(
                                   self.__use_channel_as_state),
                               names='channel for status')

        self[4][10] = atom.Atom(domain=domain.Bool(),
                                init=False,
                                policy=atom.default_policy(
                                    self.__use_physical_mapping),
                                names='use physical mapping')

        self[4][11] = atom.Atom(domain=domain.BoundedInt(0, 127),
                                init=0,
                                policy=atom.default_policy(
                                    self.__control_offset),
                                names='control offset')