Example #1
0
    def __init__(self, agent, index):
        atom.Atom.__init__(self, names='audiocube', ordinal=index)

        self.__agent = agent
        self.__index = index
        self[4] = bundles.Output(1, False, names='sensor output 1')
        self[5] = bundles.Output(2, False, names='sensor output 2')
        self[6] = bundles.Output(3, False, names='sensor output 3')
        self[7] = bundles.Output(4, False, names='sensor output 4')

        self.__output = bundles.Splitter(self.__agent.domain, self[4], self[5],
                                         self[6], self[7])
        self.__inputcookie = self.__agent.audiocubes.create_audiocube(
            self.__index, self.__output.cookie())

        self.__input = bundles.VectorInput(self.__inputcookie,
                                           self.__agent.domain,
                                           signals=(1, 2, 3))

        self[1] = atom.Atom(domain=domain.BoundedFloat(0, 1),
                            init=1.0,
                            names='red input',
                            policy=self.__input.local_policy(1, False))
        self[2] = atom.Atom(domain=domain.BoundedFloat(0, 1),
                            init=1.0,
                            names='green input',
                            policy=self.__input.local_policy(2, False))
        self[3] = atom.Atom(domain=domain.BoundedFloat(0, 1),
                            init=1.0,
                            names='blue input',
                            policy=self.__input.local_policy(3, False))
Example #2
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 #3
0
    def __init__(self, address, ordinal):
        agent.Agent.__init__(self,
                             signature=version,
                             names='orb',
                             ordinal=ordinal)

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

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

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

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

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

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

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

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

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

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

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

        self.domain = piw.clockdomain_ctl()

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

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

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

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

        self.add_verb2(1, 'calibrate([],None)', callback=self.__calibrate)
    def __init__(self, address, ordinal):
        agent.Agent.__init__(self,
                             signature=version,
                             names='midi program chooser',
                             ordinal=ordinal)

        self.domain = piw.clockdomain_ctl()

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

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

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

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

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

        self.add_verb2(1, 'reset([],None)', callback=self.__reset)
        self.add_verb2(2, 'up([],None)', callback=self.__up)
        self.add_verb2(3, 'down([],None)', callback=self.__down)
Example #7
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 #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, 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 #10
0
    def __init__(self, agent, index):
        atom.Atom.__init__(self, names='hand', ordinal=index)

        self.__agent = agent
        self.__index = index

        self[1] = bundles.Output(1, False, names='palm x output')
        self[2] = bundles.Output(2, False, names='palm y output')
        self[3] = bundles.Output(3, False, names='palm z output')

        self.__output = bundles.Splitter(self.__agent.domain, self[1], self[2],
                                         self[3])
        self.__palmpoly = piw.polyctl(1, self.__output.cookie(), False, 1)
        self.__agent.eleap.create_hand(self.__index, self.__palmpoly.cookie())
Example #11
0
    def __init__(self, address, ordinal):
        agent.Agent.__init__(self,signature=version,names='sampler oscillator',container=8,ordinal=ordinal)
        self.domain = piw.clockdomain_ctl()

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

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

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

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

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

        self[2] = atom.Atom()
        self[2][1]=atom.Atom(domain=domain.BoundedFloat(0,96000,rest=440), names='frequency input',ordinal=1,policy=self.player_input.merge_policy(1,False))
        self[2][2]=atom.Atom(domain=domain.BoundedFloat(-1200,1200), names='detune input',policy=self.player_input.merge_policy(2,False))
        self[2][3]=atom.Atom(domain=domain.BoundedFloat(0,1), names='activation input',policy=self.player_input.vector_policy(3,False))

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

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

        self.add_verb2(1,'first([],None)',self.__first)
        self.add_verb2(2,'next([],None)',self.__next)
        self.add_verb2(3,'name([],None,role(None,[ideal([~server,sample]),singular]),role(to,[abstract]))',self.__name)
        self.add_verb2(4,'choose([],None,role(None,[ideal([~server,sample]),singular]))',self.__choose)
        self.add_verb2(5,'name([un],None,role(None,[ideal([~server,sample]),singular]))',self.__unname)

        self.synth_player.set_fade(True)
Example #12
0
    def __init__(self,ordinal,dom,remove,usbname=None,usbdev=None):
        self.type = 1
        self.usbname = usbname
        self.usbdev = usbdev
        Keyboard.__init__(self,'alpha keyboard',ordinal,dom,remove,132)

        self[6] = bundles.Output(1,False,names='strip position output',ordinal=2)
        self[11] = bundles.Output(2,False,names='absolute strip output',ordinal=2)
        self.s2output = bundles.Splitter(self.domain,self[6],self[11])
        self.kclone.set_filtered_output(4,self.s2output.cookie(),piw.first_filter(4))

        self.test_setup()
        self.nativekeyboard_setup()
        self.set_threshhold() #define in base class 
        self.setup_leds() #define in base class 
Example #13
0
    def set_channels(self, channels):
        c = self.__channels

        if channels == c:
            return

        while c < channels:
            o = bundles.Output(self.__base + c,
                               True,
                               names=self.__child_name,
                               ordinal=1 + c)
            self.__splitter.add_output(o)
            self[1 + c] = o
            c = c + 1

        while c > channels:
            o = self[c]
            del self[c]
            self.__splitter.remove_output(o)
            c = c - 1

        self.__channels = c
        for i in range(1, c + 1):
            self[i].set_ordinal(i)
            self[i].set_names(channel_name(c, i) + ' ' + self.__child_name)
Example #14
0
 def test_setup(self):
     self.add_verb2(2, 'record([],None,role(None,[mass([k])]))',
                    self.__record)
     self[16] = bundles.Output(4, False, names='test running output')
     self.toutput = bundles.Splitter(self.domain, self[16])
     self.kclone.set_filtered_output(3, self.toutput.cookie(),
                                     piw.first_filter(3))
Example #15
0
    def __init__(self, address, ordinal):
        agent.Agent.__init__(self,
                             signature=version,
                             names='rectangle oscillator',
                             ordinal=ordinal)
        self.domain = piw.clockdomain_ctl()

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

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

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

        self.domain = piw.clockdomain_ctl()

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

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

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

        self.domain = piw.clockdomain_ctl()

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

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

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

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

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

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

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

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

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

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

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

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

        self[1] = atom.Atom(names='controls')
        self[1][1] = atom.Atom(domain=domain.BoundedFloat(0, 1),
                               names="compression",
                               policy=atom.default_policy(self.__compression))
        self[1][2] = atom.Atom(domain=domain.BoundedFloat(0, 1),
                               names="sharpness",
                               policy=atom.default_policy(self.__sharpness))
Example #19
0
    def __init__(self, address, ordinal):
        agent.Agent.__init__(self,signature=version,names='talker',container=5,ordinal=ordinal)

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

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

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

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

        self[2] = atom.Atom(domain=domain.BoundedFloat(0,1), policy=self.activation_input.local_policy(1,False),names='activation input')
        self[3] = atom.Atom(creator=self.__create,wrecker=self.__wreck)
        self[4] = PhraseBrowser(self.__eventbykey,self.__keylist)
Example #20
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 #21
0
    def __init__(self, address, ordinal):
        agent.Agent.__init__(self, signature=version,names='clarinet oscillator',ordinal=ordinal)
        self.domain = piw.clockdomain_ctl()

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

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

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

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

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

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

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

        self[2] = atom.Atom(domain=domain.BoundedFloat(0, 1),
                            init=0,
                            names='volume input',
                            policy=self.input.local_policy(
                                1, policy.IsoStreamPolicy(1, 0, 0)))
        self[3] = atom.Atom(domain=domain.BoundedFloat(0, 96000, rest=440),
                            names='frequency input',
                            policy=self.input.merge_policy(2, False))
        self[4] = atom.Atom(init=0.0,
                            domain=domain.BoundedFloat(-1200, 1200),
                            names='detune input',
                            policy=self.input.merge_policy(4, False))
Example #23
0
    def __init__(self, address, ordinal):
        self.domain = piw.clockdomain_ctl()
        agent.Agent.__init__(self, signature=version, names='player', container=(const.verb_node,'player',atom.VerbContainer(clock_domain=self.domain)), ordinal=ordinal)

        self[2] = atom.Atom(names='outputs')
        self[2][1] = bundles.Output(1,False,names='pressure output', protocols='')
        self[2][2] = bundles.Output(2,False,names='key output', protocols='')
        self[2][3] = bundles.Output(3,False,names='controller output', protocols='')

        self.data_output = bundles.Splitter(self.domain,self[2][1],self[2][2])
        self.ctl_output = bundles.Splitter(self.domain,self[2][3])

        self.player = recorder_native.nplayer(self.data_output.cookie(),self.ctl_output.cookie(),16,100,self.domain)

        self[3] = atom.Atom(domain=domain.BoundedInt(1,10000,100), policy=atom.default_policy(self.player.set_size), names="size")

        self.add_verb2(1,'play([],None,role(None,[mass([note])]),role(with,[mass([velocity])]))',create_action=self.__playnv,clock=True)
        self.add_verb2(2,'play([],None,role(None,[mass([note])]),role(with,[mass([velocity])]),role(for,[mass([second])]))',create_action=self.__playnvl,clock=True)
Example #24
0
    def __init__(self, address, ordinal):
        agent.Agent.__init__(self,
                             names='midi input',
                             signature=version,
                             container=6)
        self.set_property_long('cordinal', ordinal)

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

        self[1] = bundles.Output(1, False, names='activation output')
        self[2] = bundles.Output(2,
                                 False,
                                 names='continuous controller output')

        self.output = bundles.Splitter(self.domain, self[1], self[2])

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

        self[3] = VirtualKey()
        self[4] = VirtualCC()
        self[5] = MidiPort(self.output.cookie(), self.midi_output.cookie())

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

        self.set_ordinal(ordinal)
Example #25
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 #26
0
    def __init__(self, database, master_agent, ordinal):
        agent.Agent.__init__(self,
                             names='controller',
                             signature=version,
                             subsystem='controller',
                             container=2,
                             protocols='is_subsys',
                             ordinal=ordinal)
        self.database = database
        self.agent = master_agent
        self.domain = master_agent.domain

        self.add_verb2(1,
                       'control([],None,role(None,[concrete,singular]))',
                       callback=self.__control)
        self.add_verb2(
            2,
            'control([],None,role(None,[concrete,singular]),role(with,[numeric]))',
            callback=self.__controlwith)
        self.add_verb2(3, 'control([un],None)', callback=self.__uncontrol)

        self[4] = atom.Atom(creator=self.__create, wrecker=self.__wreck)

        self[3] = bundles.Output(1,
                                 False,
                                 names='light output',
                                 protocols='revconnect')
        self.lights = bundles.Splitter(self.domain, self[3])
        self.lightconvertor = piw.lightconvertor(self.lights.cookie())
        self.controller = Controller0(self, self.lightconvertor.cookie(),
                                      utils.pack_str(1, 2, 3, 4, 5))
        self.clone = piw.clone(True)
        self.clone.set_output(1, self.controller.cookie())
        self.input = bundles.VectorInput(self.clone.cookie(),
                                         self.domain,
                                         signals=(1, 2, 3, 4, 5))

        self[1] = atom.Atom()
        self[1][1] = atom.Atom(domain=domain.BoundedFloat(0, 1),
                               policy=self.input.vector_policy(1, False),
                               names='activation input')
        self[1][2] = atom.Atom(domain=domain.BoundedFloat(0, 1),
                               policy=self.input.vector_policy(2, False),
                               names='pressure input')
        self[1][3] = atom.Atom(domain=domain.BoundedFloat(-1, 1),
                               policy=self.input.vector_policy(3, False),
                               names='roll input')
        self[1][4] = atom.Atom(domain=domain.BoundedFloat(-1, 1),
                               policy=self.input.vector_policy(4, False),
                               names='yaw input')
        self[1][5] = atom.Atom(domain=domain.BoundedFloat(-1, 1),
                               policy=self.input.vector_policy(5, False),
                               names='strip position input')
Example #27
0
    def __init__(self, address, ordinal):
        
        agent.Agent.__init__(self,names='midi converter',signature=version,container=100,ordinal=ordinal)

        self.__domain = piw.clockdomain_ctl()

        self.__state = AgentState(self.__agent_state_loaded)
        self.set_private(self.__state)

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

        self.__observer = MappingObserver(self.__state,self)
        self.__channel_delegate = MidiChannelDelegate(self)
        self.__midi_from_belcanto = piw.midi_from_belcanto(self.__output.cookie(), self.__domain)
        self.__midi_converter = piw.midi_converter(self.__observer, self.__channel_delegate, self.__domain, self.__midi_from_belcanto, self.__get_title())
 
        self.parameter_list = inputparameter.List(self.__midi_converter,self.__midi_converter.clock_domain(),self.verb_container())

        # velocity detector, reads pressure input (signal 1) and generates a note on velocity (signal 4), passes thru all other signals in bundle
        self.__kvelo = piw.velocitydetect(self.__midi_from_belcanto.cookie(),1,4)

        # Inputs for generating keyboard driven MIDI signals
        # MIDI controllers are merged down with signals from keys (driven by pressure)
        self.__kinpt = bundles.VectorInput(self.__kvelo.cookie(),self.__domain,signals=(1,2,3,5,6,7,8,9,10,11,12,13))
        self[2] = atom.Atom()
        self[2][1] = atom.Atom(domain=domain.Aniso(),policy=self.__kinpt.vector_policy(1,False),names='pressure input')
        self[2][2] = atom.Atom(domain=domain.Aniso(),policy=self.__kinpt.merge_nodefault_policy(2,False),names='frequency input')

         # input to set the MIDI channel
        self[3] = atom.Atom(domain=domain.BoundedInt(0,16),init=0,names="midi channel",policy=atom.default_policy(self.set_midi_channel))

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

        # bank change
        self[5]=atom.Atom(domain=domain.BoundedFloat(1,128),init=1,names="midi bank", policy=atom.default_policy(self.__set_bank_change))
        # program change
        self[6]=atom.Atom(domain=domain.BoundedFloat(1,128),init=1,names="midi program", policy=atom.default_policy(self.__set_program_change))

        # inputs to set the minimum and maximum MIDI channel when in poly mode
        self[7] = atom.Atom(domain=domain.BoundedInt(1,16),init=1,names="minimum channel",policy=atom.default_policy(self.set_min_channel))
        self[8] = atom.Atom(domain=domain.BoundedInt(1,16),init=16,names="maximum channel",policy=atom.default_policy(self.set_max_channel))

        # parameter mapping
        self[12] = self.parameter_list

        self.set_midi_channel(0)
Example #28
0
    def __init__(self, address, ordinal):
        agent.Agent.__init__(self,
                             signature=version,
                             names='vu meter',
                             ordinal=ordinal)

        self.domain = piw.clockdomain_ctl()

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

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

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

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

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

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

        self.__send_parameters()
Example #29
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 #30
0
    def __init__(self, address, ordinal):
        agent.Agent.__init__(self, signature=version,names='ahdsr',ordinal=ordinal)

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

        self.domain = piw.clockdomain_ctl()
        self.output = bundles.Splitter(self.domain,self[2][1],self[2][2],self[2][3])
        self.adsr = synth_native.adsr2(self.output.cookie(),self.domain)
        self.vdetect = piw.velocitydetect(self.adsr.cookie(),8,1)

        vel=(T('stageinc',0.1),T('inc',0.1),T('biginc',1),T('control','updown'))
        self[3] = atom.Atom(domain=domain.BoundedInt(1,1000),init=4,names="velocity sample",policy=atom.default_policy(self.__set_samples))
        self[4] = atom.Atom(domain=domain.BoundedFloat(0.1,10,hints=vel),init=4,names="velocity curve",policy=atom.default_policy(self.__set_curve))
        self[5] = atom.Atom(domain=domain.BoundedFloat(0.1,10,hints=vel),init=4,names="velocity scale",policy=atom.default_policy(self.__set_scale))
        self.input = bundles.VectorInput(self.vdetect.cookie(), self.domain,signals=(2,3,4,5,6,7,8,9,10,11,12,13,14),threshold=5)

        time=(T('stageinc',0.01),T('inc',0.01),T('biginc',0.2),T('control','updown'))
        self[1] = atom.Atom(names='inputs')
        self[1][1]=atom.Atom(domain=domain.BoundedFloat(0,1), init=1.0, names="activation input", policy=self.input.merge_policy(13,False), protocols="nostage")
        self[1][2]=atom.Atom(domain=domain.BoundedFloat(0,60,hints=time),init=0, names="delay input", policy=self.input.merge_policy(2,False))
        self[1][3]=atom.Atom(domain=domain.BoundedFloat(0,60,hints=time),init=0.01, names="attack input", policy=self.input.merge_policy(3,False))
        self[1][4]=atom.Atom(domain=domain.BoundedFloat(0,60,hints=time),init=0, names="hold input", policy=self.input.merge_policy(4,False))
        self[1][5]=atom.Atom(domain=domain.BoundedFloat(0,60,hints=time),init=0.05, names="decay input", policy=self.input.merge_policy(5,False))
        self[1][6]=atom.Atom(domain=domain.BoundedFloat(0,1), init=1.0, names="sustain input", policy=self.input.merge_policy(6,False))
        self[1][7]=atom.Atom(domain=domain.BoundedFloat(0,60,hints=time),init=0.5, names="release input", policy=self.input.merge_policy(7,False))
        self[1][8]=atom.Atom(domain=domain.BoundedFloat(0,1), init=0, names="pressure input", ordinal=1, policy=self.input.vector_policy(8,False))
        self[1][9]=atom.Atom(domain=domain.BoundedFloat(0,1), init=0, names="pressure input", ordinal=2, policy=self.input.vector_policy(9,policy.IsoStreamPolicy(1,0,0)))
        self[1][10]=atom.Atom(domain=domain.BoundedFloat(0,1), init=0, names="velocity sensitivity input", policy=self.input.merge_policy(10,False))
        self[1][11]=atom.Atom(domain=domain.BoundedFloat(0,1), init=0, names="aftertouch input", policy=self.input.merge_policy(11,False))
        self[1][12]=atom.Atom(domain=domain.BoundedFloat(0,1), init=0, names="pedal input", policy=self.input.latch_policy(12,False))
        self[1][13]=atom.Atom(domain=domain.BoundedFloat(0,1), init=0.5, names="damper input", policy=self.input.linger_policy(14,False))

        self.__set_samples(4)
        self.__set_curve(4)
        self.__set_scale(4)