コード例 #1
0
ファイル: controller_plg.py プロジェクト: shamharoth/EigenD
    def __init__(self, controller, index, tag):
        atom.Atom.__init__(self,
                           names="connector",
                           ordinal=index,
                           protocols='remove')

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

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

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

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

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

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

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

        self[6] = atom.Atom(domain=domain.BoundedFloat(0.5,20,hints=(T('stageinc',0.1),T('inc',0.1),T('biginc',1),T('control','updown'))),init=0.5,names='doubletap',policy=atom.default_policy(self.__doubletap_change))
        self.__agent.view.doubletap_set(piw.make_change_nb(utils.slowchange(self.__doubletap_set)))
コード例 #5
0
    def __init__(self, address, ordinal):
        agent.Agent.__init__(self,
                             signature=version,
                             names='midi program chooser',
                             ordinal=ordinal)

        self.domain = piw.clockdomain_ctl()

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

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

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

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

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

        self.add_verb2(1, 'reset([],None)', callback=self.__reset)
        self.add_verb2(2, 'up([],None)', callback=self.__up)
        self.add_verb2(3, 'down([],None)', callback=self.__down)
コード例 #6
0
ファイル: keyboard_X.py プロジェクト: shamharoth/EigenD
    def __init__(self, agent):
        self.__agent = agent
        audio.AudioOutput.__init__(self,
                                   self.__agent.audio_output,
                                   1,
                                   1,
                                   names='microphone')

        self[100] = toggle.Toggle(self.__enable,
                                  self.__agent.domain,
                                  container=(None, 'microphone enable',
                                             self.__agent.verb_container()),
                                  names='enable',
                                  transient=True)
        self[101] = atom.Atom(
            domain=domain.StringEnum(*sorted(self.mic_types.keys())),
            init='electret',
            names='type',
            policy=atom.default_policy(self.__type))
        self[102] = atom.Atom(domain=domain.BoundedInt(
            0,
            50,
            hints=(T('stageinc',
                     1), T('inc', 1), T('biginc', 5), T('control', 'updown'))),
                              names='gain',
                              init=30,
                              policy=atom.default_policy(self.__gain))
        self[103] = toggle.Toggle(self.__pad,
                                  self.__agent.domain,
                                  container=(None, 'microphone pad',
                                             self.__agent.verb_container()),
                                  names='pad')
        self[104] = toggle.Toggle(self.__loop_enable,
                                  self.__agent.domain,
                                  container=(None, 'microphone loop',
                                             self.__agent.verb_container()),
                                  names='loop')
        self[105] = atom.Atom(domain=domain.BoundedInt(
            0,
            120,
            hints=(T('stageinc',
                     1), T('inc', 1), T('biginc', 5), T('control', 'updown'))),
                              names='loop gain',
                              init=100,
                              policy=atom.default_policy(self.__loop_gain))
        self[106] = toggle.Toggle(self.__mute_enable,
                                  self.__agent.domain,
                                  container=(None, 'microphone mute',
                                             self.__agent.verb_container()),
                                  names='automute')
        self[109] = atom.Atom(domain=domain.BoundedInt(0, 4),
                              names='quality',
                              init=2,
                              policy=atom.default_policy(self.__quality))
コード例 #7
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)
コード例 #8
0
ファイル: envelope_plg.py プロジェクト: tylerwood/EigenD
    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))
コード例 #9
0
    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')
コード例 #10
0
ファイル: audio.py プロジェクト: shamharoth/EigenD
 def __init__(self, *clients):
     self.__clients = clients
     atom.Atom.__init__(self,
                        domain=domain.BoundedInt(0, 128),
                        names='channel count',
                        init=1,
                        policy=atom.default_policy(self.__set_channels))
     self.__set_channels(1)
コード例 #11
0
ファイル: scaler_plg.py プロジェクト: jschpmn/EigenD
    def __init__(self, address, ordinal):
        agent.Agent.__init__(self, signature=version, names='scaler',protocols='bind set',icon='plg_simple/scaler.png',container=5,ordinal=ordinal)
        self.domain = piw.clockdomain_ctl()
        self.domain.set_source(piw.makestring('*',0))

        self.__fixed = False
        self.set_private(node.Server(value=piw.makebool(False,0),change=self.__changefix))

        self[1] = atom.Atom()
        self[1][1] = bundles.Output(1,False,names='activation output', protocols='')
        self[1][2] = bundles.Output(2,False,names='pressure output', protocols='')
        self[1][3] = bundles.Output(3,False,names='roll output', protocols='')
        self[1][4] = bundles.Output(4,False,names='yaw output', protocols='')
        self[1][5] = bundles.Output(5,False,names='scale note output', protocols='')
        self[1][6] = bundles.Output(6,False,names='frequency output', protocols='')

        self.ctl = piw.scaler_controller()
        self.ctl_input = bundles.VectorInput(self.ctl.cookie(),self.domain,signals=(1,))

        self.output = bundles.Splitter(self.domain,*self[1].values())
        self.filter = piw.scaler(self.ctl,self.output.cookie(),cubic())
        self.input = bundles.VectorInput(self.filter.cookie(), self.domain,signals=(1,2,3,4,5,6,7,9,10,11,12,13,14,15,16,17))
        self.input.correlator.clocksink().add_upstream(self.ctl_input.correlator.clocksink())

        self[4]=atom.Atom()

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

        th=(T('inc',1),T('biginc',1),T('control','updown'))
        bh=(T('inc',1),T('biginc',1),T('control','updown'))
        sh=(T('choices','[0,2,4,5,7,9,11,12]','[0,1,2,3,4,5,6,7,8,9,10,11,12]','[0,2,4,6,8,10,12]','[0,2,3,5,7,8,10,12]','[0,3,5,6,7,10,12]', '[0,2,3,6,7,8,11,12]','[0,3,5,7,10,12]','[0,2,4,7,9,12]'), T('control','selector'))
        self[4][5]=atom.Atom(domain=domain.BoundedFloat(0,12,hints=th),policy=self.input.merge_policy(5,False),names='tonic input',protocols='bind set',container=(None,'tonic',self.verb_container()))
        self[4][6]=atom.Atom(domain=domain.BoundedFloat(-20,20,hints=bh),policy=self.input.merge_policy(6,False),names='base note input',protocols='bind')


        self[4][7]=atom.Atom(domain=domain.String(hints=sh),init='[0,2,4,5,7,9,11,12]',policy=self.input.merge_policy(7,False),names='scale input',protocols='bind set',container=(None,'scale',self.verb_container()))
        self[4][8]=atom.Atom(domain=domain.BoundedFloat(-1,1),policy=self.input.merge_policy(9,policy.LopassStreamPolicy(200,0.6)),names='k pitch bend input')
        self[4][9]=atom.Atom(domain=domain.BoundedFloat(-1,1),policy=self.input.merge_policy(10,False),names='global pitch bend input')
        self[4][10]=atom.Atom(domain=domain.BoundedFloat(0,72),init=1,policy=self.input.merge_policy(11,False),names='k bend range input',protocols='bind')
        self[4][11]=atom.Atom(domain=domain.BoundedFloat(0,72),init=12,policy=self.input.merge_policy(12,False),names='global bend range input',protocols='bind')
        self[4][12]=atom.Atom(domain=domain.Aniso(),policy=self.ctl_input.vector_policy(1,False),names='controller input')
        self[4][13]=atom.Atom(domain=domain.Bool(),policy=self.input.merge_policy(14,False),names='override',protocols='bind')
        self[4][14]=atom.Atom(domain=domain.BoundedFloat(-1,9,hints=th),init=3,policy=self.input.merge_policy(15,False),names='octave input',protocols='bind',container=(None,'octave',self.verb_container()))
        self[4][15]=atom.Atom(domain=domain.BoundedInt(1,4),init=2,policy=atom.default_policy(self.__set_curve),names='curve',protocols='bind')
        self[4][16]=atom.Atom(domain=domain.BoundedFloat(0,1000),policy=self.input.merge_nodefault_policy(16,False),names='key input')
        self[4][17]=atom.Atom(domain=domain.BoundedFloat(-10,10,hints=th),init=0,policy=self.input.merge_policy(17,False),names='relative octave input',protocols='bind')

        self.add_verb2(3,'choose([],None,role(none,[ideal([None,scale]),singular]))',callback=self.__tune_scale)
        self.add_verb2(5,'fix([],None)',callback=self.__fix)
        self.add_verb2(6,'fix([un],None)',callback=self.__unfix)

        self[4][5].add_verb2(1,'set([],~a,role(None,[instance(~self)]),role(to,[ideal([None,note]),singular]))',callback=self.__tune_tonic)
        self[4][7].add_verb2(2,'set([],~a,role(None,[instance(~self)]),role(to,[ideal([None,scale]),singular]))',callback=self.__tune_scale)
コード例 #12
0
ファイル: keyboard_X.py プロジェクト: tylerwood/EigenD
    def set_threshhold(self):
        self[241] = atom.Atom(domain=domain.BoundedInt(0,4095), init=self.keyboard.get_pedal_min(1), protocols='input output explicit', names='pedal minimum threshold', ordinal=1, policy=atom.default_policy(lambda v: self.__set_min(1,v)))
        self[242] = atom.Atom(domain=domain.BoundedInt(0,4095), init=self.keyboard.get_pedal_max(1), protocols='input output explicit', names='pedal maximum threshold', ordinal=1, policy=atom.default_policy(lambda v: self.__set_max(1,v)))
        self[243] = atom.Atom(domain=domain.BoundedInt(0,4095), init=self.keyboard.get_pedal_min(2), protocols='input output explicit', names='pedal minimum threshold', ordinal=2, policy=atom.default_policy(lambda v: self.__set_min(2,v)))
        self[244] = atom.Atom(domain=domain.BoundedInt(0,4095), init=self.keyboard.get_pedal_max(2), protocols='input output explicit', names='pedal maximum threshold', ordinal=2, policy=atom.default_policy(lambda v: self.__set_max(2,v)))
        self[245] = atom.Atom(domain=domain.BoundedInt(0,4095), init=self.keyboard.get_pedal_min(3), protocols='input output explicit', names='pedal minimum threshold', ordinal=3, policy=atom.default_policy(lambda v: self.__set_min(3,v)))
        self[246] = atom.Atom(domain=domain.BoundedInt(0,4095), init=self.keyboard.get_pedal_max(3), protocols='input output explicit', names='pedal maximum threshold', ordinal=3, policy=atom.default_policy(lambda v: self.__set_max(3,v)))
        self[247] = atom.Atom(domain=domain.BoundedInt(0,4095), init=self.keyboard.get_pedal_min(4), protocols='input output explicit', names='pedal minimum threshold', ordinal=4, policy=atom.default_policy(lambda v: self.__set_min(4,v)))
        self[248] = atom.Atom(domain=domain.BoundedInt(0,4095), init=self.keyboard.get_pedal_max(4), protocols='input output explicit', names='pedal maximum threshold', ordinal=4, policy=atom.default_policy(lambda v: self.__set_max(4,v)))

        self[251] = atom.Atom(domain=domain.BoundedFloat(0,1), init=self.keyboard.get_threshold1(), protocols='input output', names='soft threshold', policy=atom.default_policy(self.keyboard.set_threshold1))
        self[249] = atom.Atom(domain=domain.BoundedFloat(0,1), init=self.keyboard.get_threshold2(), protocols='input output', names='hard threshold', policy=atom.default_policy(self.keyboard.set_threshold2))
        self[252] = atom.Atom(domain=domain.BoundedFloat(0,1), init=self.keyboard.get_roll_axis_window(), protocols='input output', names='roll axis window', policy=atom.default_policy(self.keyboard.set_roll_axis_window))
        self[253] = atom.Atom(domain=domain.BoundedFloat(0,1), init=self.keyboard.get_yaw_axis_window(), protocols='input output', names='yaw axis window', policy=atom.default_policy(self.keyboard.set_yaw_axis_window))
コード例 #13
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()
コード例 #14
0
    def __init__(self, callback, *args, **kwds):
        self.__scroller = piw.scroller2(utils.changify(callback))
        atom.Atom.__init__(self, *args, **kwds)

        self[1] = atom.Atom(domain=domain.BoundedInt(-32767, 32767),
                            names='column',
                            init=None,
                            policy=atom.default_policy(self.__change_column))
        self[2] = atom.Atom(domain=domain.BoundedInt(-32767, 32767),
                            names='row',
                            init=None,
                            policy=atom.default_policy(self.__change_row))
        self[3] = atom.Atom(domain=domain.Bool(),
                            names='column end relative',
                            init=False,
                            policy=atom.default_policy(
                                self.__change_column_endrel))
        self[4] = atom.Atom(domain=domain.Bool(),
                            names='row end relative',
                            init=False,
                            policy=atom.default_policy(
                                self.__change_row_endrel))
        self.__key_changed()
コード例 #15
0
    def __init__(self, address, ordinal):
        agent.Agent.__init__(self,signature=version,names='sampler oscillator',container=8,ordinal=ordinal)
        self.domain = piw.clockdomain_ctl()

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

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

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

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

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

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

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

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

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

        self.synth_player.set_fade(True)
コード例 #16
0
    def __init__(self, func1, func2, *args, **kwds):
        self.__delegate = ScrollerDelegate(func1, func2)
        self.__scroller = piw.scroller(self.__delegate, 0.5, 0.5, 100)
        atom.Atom.__init__(self, *args, **kwds)

        self[1] = atom.Atom(domain=domain.BoundedInt(-32767, 32767),
                            names='column',
                            init=None,
                            policy=atom.default_policy(self.__change_column))
        self[2] = atom.Atom(domain=domain.BoundedInt(-32767, 32767),
                            names='row',
                            init=None,
                            policy=atom.default_policy(self.__change_row))
        self[3] = atom.Atom(domain=domain.Bool(),
                            names='column end relative',
                            init=False,
                            policy=atom.default_policy(
                                self.__change_column_endrel))
        self[4] = atom.Atom(domain=domain.Bool(),
                            names='row end relative',
                            init=False,
                            policy=atom.default_policy(
                                self.__change_row_endrel))
        self.__key_changed()
コード例 #17
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)
コード例 #18
0
    def __init__(self, agent, index):
        atom.Atom.__init__(self,
                           names='key press',
                           ordinal=index,
                           protocols='remove')

        self.__agent = agent
        self.__index = index

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

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

        self[2] = atom.Atom(domain=domain.BoundedInt(0, 127),
                            names='key code',
                            policy=atom.default_policy(self.__set_code))
        self[3] = atom.Atom(domain=domain.String(),
                            names='character',
                            init='',
                            policy=atom.default_policy(self.__set_character))
        self[4] = atom.Atom(domain=domain.Bool(),
                            names='hold',
                            init=True,
                            policy=atom.default_policy(self.__set_hold))
        self[5] = atom.Atom(domain=domain.BoundedFloat(-1, 1),
                            names='threshold',
                            init=0.0,
                            policy=atom.default_policy(self.__set_threshold))
        self[6] = atom.Atom(domain=domain.Bool(),
                            names='velocity',
                            init=False,
                            policy=atom.default_policy(self.__set_velocity))
        self[7] = atom.Atom(domain=domain.String(),
                            names='description',
                            init='',
                            policy=atom.default_policy(self.__set_description))
コード例 #19
0
ファイル: ahdsr_plg.py プロジェクト: shamharoth/EigenD
    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)
コード例 #20
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)
コード例 #21
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())
コード例 #22
0
ファイル: t3d_device_plg.py プロジェクト: shamharoth/EigenD
    def __init__(self, address, ordinal):
        #
        agent.Agent.__init__(self,
                             signature=version,
                             names='t3d device',
                             ordinal=ordinal)

        self.domain = piw.clockdomain_ctl()

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

        self[1] = atom.Atom(names='outputs')
        self[1][1] = bundles.Output(1, False, names='key output')
        self[1][2] = bundles.Output(2, False, names='pressure output')
        self[1][3] = bundles.Output(3, False, names='roll output')
        self[1][4] = bundles.Output(4, False, names='yaw output')
        self[1][5] = bundles.Output(5, False, names='frequency')

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

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

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

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

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

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

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

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

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

        print "t3d device connect ", self[7], ",", self[8]
        self.device.connect(self[7].get_value(), self[8].get_value())
コード例 #23
0
ファイル: atom.py プロジェクト: shamharoth/EigenD
 def __init__(self, min, max, init, **kwd):
     Atom.__init__(self,
                   init=init,
                   domain=domain.BoundedInt(min, max),
                   **kwd)
コード例 #24
0
    def __init__(self, name):
        agent.Agent.__init__(self,
                             signature=upgrade.Signature(),
                             names='eigenbrowser',
                             volatile=True)

        self.name = name
        self.node = random.randrange(0, 1 << 48L) | 0x010000000000L

        self.langModel = gui.call_bg_sync(self.__create_lang)
        self.historyModel = history.HistoryModel(self.langModel)
        self.cdomain = piw.clockdomain_ctl()
        self.cdomain.set_source(piw.makestring('*', 0))

        self.scroller1 = Scroller2(
            self.__scroll1)  # scrolls the left hand pane
        self.scroller2 = Scroller(
            self.__scroll2, self.__tap2)  # scrolls the right hand (dinfo) pane
        self.scroller3 = Scroller(self.__scroll3,
                                  self.__tap3)  # scrolls the path pane

        self.scroller_in1 = bundles.VectorInput(self.scroller1.cookie(),
                                                self.cdomain,
                                                signals=(1, 2, 3))
        self.scroller_in2 = bundles.VectorInput(self.scroller2.cookie(),
                                                self.cdomain,
                                                signals=(1, 2, 3))
        self.scroller_in3 = bundles.VectorInput(self.scroller3.cookie(),
                                                self.cdomain,
                                                signals=(1, 2, 3))

        nudge = (T('inc', 0.1), )
        self[1] = atom.Atom(domain=domain.BoundedFloat(-1, 1, hints=nudge),
                            init=0,
                            names='sideways nudger',
                            ordinal=1,
                            policy=self.scroller_in1.vector_policy(1, False))
        #self[2] = atom.Atom(domain=domain.BoundedFloat(-1,1,hints=nudge), init=0, names='vertical nudger', ordinal=1, policy=self.scroller_in1.vector_policy(2,False),rtransient=True)
        self[2] = atom.Atom(domain=domain.BoundedFloat(-1, 1, hints=nudge),
                            init=0,
                            names='vertical nudger',
                            ordinal=1,
                            policy=self.scroller_in1.vector_policy(2, False))

        self[3] = atom.Atom(domain=domain.BoundedFloat(-1, 1, hints=nudge),
                            init=0,
                            names='sideways nudger',
                            ordinal=2,
                            policy=self.scroller_in2.vector_policy(1, False))
        self[4] = atom.Atom(domain=domain.BoundedFloat(-1, 1, hints=nudge),
                            init=0,
                            names='vertical nudger',
                            ordinal=2,
                            policy=self.scroller_in2.vector_policy(2, False))

        self[8] = browse.BrowseAgent(self, browse.getName())

        self.add_verb2(1,
                       'browse([],None,role(None,[proto(browse),singular]))',
                       callback=self.__do_browse)
        self.add_verb2(2, 'minimise([],None)', callback=self.__minimise)
        self.add_verb2(3, 'maximise([],None)', callback=self.__maximise)

        self.font = wx.SystemSettings_GetFont(wx.SYS_DEFAULT_GUI_FONT)
        self.font.SetPointSize(fonts.DEFAULT_PTS)

        self[12] = atom.Atom(domain=domain.BoundedInt(5, 20, rest=11),
                             names='text',
                             policy=atom.default_policy(self.__set_fontsize))
        self[15] = atom.Atom(domain=domain.BoundedFloat(-1, 1, hints=nudge),
                             init=-1,
                             names='sideways nudger',
                             ordinal=3,
                             policy=self.scroller_in3.vector_policy(1, False))
        self[16] = atom.Atom(domain=domain.BoundedFloat(-1, 1, hints=nudge),
                             init=-1,
                             names='vertical nudger',
                             ordinal=3,
                             policy=self.scroller_in3.vector_policy(2, False))
        self[17] = atom.Atom(domain=domain.BoundedFloat(0, 1),
                             init=0,
                             names='tapper',
                             ordinal=1,
                             policy=self.scroller_in1.vector_policy(3, False))
        self[18] = atom.Atom(domain=domain.BoundedFloat(0, 1),
                             init=0,
                             names='tapper',
                             ordinal=2,
                             policy=self.scroller_in2.vector_policy(3, False))
        self[19] = atom.Atom(domain=domain.BoundedFloat(0, 1),
                             init=0,
                             names='tapper',
                             ordinal=3,
                             policy=self.scroller_in3.vector_policy(3, False))

        self.__size = node.Server(change=self.__size_changed)
        self.set_private(node.Server())
        self.get_private()[1] = self.__size
        self.__x = 100
        self.__y = 100
        self.__setup_size()

        self.__minX = 60
        self.__minY = 80
        self.__maxX = 100
        self.__maxY = 100

        self.__rootFrame = None
        self.__createRootFrame()

        #        self.scroller2.reset(-1,-1)
        self.scroller3.reset(-1, 1)
        self.scroller1.set_scheme(1)

        self.scroller1.enable()
        self.scroller2.enable()
        self.scroller3.enable()
コード例 #25
0
ファイル: host_plg.py プロジェクト: jschpmn/EigenD
    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)
コード例 #26
0
    def __init__(self, address, ordinal):
        #
        # Agents are constructed with the address and ordinal.  Each
        # agent will have a unique address and an ordinal unique for
        # that type of agent.
        #
        # We also pass in the automatically generated version to go into
        # the metadata.
        #
        agent.Agent.__init__(self,
                             signature=version,
                             names='osc output',
                             ordinal=ordinal)

        #
        # Create a clock domain.  A clock domain is a collection of clock
        # sinks all of which share common properties.  Domains can be isochronous
        # or anisochronous.  Currently, sinks in iso domains can be connected
        # only to other iso domains using the same source.
        #
        self.domain = piw.clockdomain_ctl()

        #
        # Make our domain anisochronous (aniso is used for everything except audio)
        #
        self.domain.set_source(piw.makestring('*', 0))

        #
        # Create an OSC server, implemented in our C++ library, imported through
        # the osc_plg_native module.
        #
        self.osc = osc_server(self.domain, "keyboard_%d" % ordinal)

        #
        # Create an OSC output within the OSC server, which will correlate 4
        # streams.  These will be used for keyboard data.  We group like this
        # so that we can send all the keyboard parameters together.
        # these will be under the /key OSC path
        #
        # The return value from create_output is a piw.cookie, which represents
        # a connection endpoint. This can be used by another component to send
        # events for OSC output. The OSC output will place the first 4 signals
        # into each OSC output packet.
        #
        self.key_output = self.osc.create_output("key", True, 4)

        #
        # Create an input.  An input does the work of correlating the events on a
        # number of signals, grouping them together.
        #
        # A Vector input is a proper multiple channel input. This one is being
        # constructed to handle 4 signals, numbered 1,2,3 and 4. The events will
        # be sent to the OSC output stage through the use of the key_output cookie.
        #
        self.key_input = bundles.VectorInput(self.key_output,
                                             self.domain,
                                             signals=(1, 2, 3, 4))

        #
        # Create a null atom just to group our inputs. We still name this atom so that it
        # shows up with a meaningful name through introspection by tools like Workbench.
        #
        self[1] = atom.Atom(names="inputs")

        #
        # Now create our inputs. The data policy for the atom is created by our vector input.
        # There are lots of corner cases when we invert our model from signal-contains-events
        # to event-contains-signals. In particular, this happens when events on individual
        # signals dont start and and stop together.
        #
        # Any input with a vector_policy will create or join an existing event.
        # merge_policy will never create events, just join onto existing events created by
        # a vector policy.
        #
        # We create 4 inputs, with vector policies routing them to signals 1,2,3 and 4 on
        # our bundle. These are all non-iso inputs.
        #
        self[1][1] = atom.Atom(domain=domain.BoundedFloat(0, 1),
                               policy=self.key_input.vector_policy(1, False),
                               names='activation input')
        self[1][2] = atom.Atom(domain=domain.BoundedFloat(0, 1),
                               policy=self.key_input.vector_policy(2, False),
                               names='pressure input')
        self[1][3] = atom.Atom(domain=domain.BoundedFloat(-1, 1),
                               policy=self.key_input.vector_policy(3, False),
                               names='roll input')
        self[1][4] = atom.Atom(domain=domain.BoundedFloat(-1, 1),
                               policy=self.key_input.vector_policy(4, False),
                               names='yaw input')

        #
        # Create another OSC output for the breath pipe.
        #
        self.breath_output = self.osc.create_output("breath", False, 1)

        #
        # And another input. We use separate inputs for breath and keys, because we want
        # all the key signals to be correlated together (so we can output pressure roll and
        # yaw as 1 packet), the breath pipe is completely independent from the keys though.
        #
        # Using the breath_output cookie, the input data will be send to the breath output created
        # in the native OSC transport.
        #
        self.breath_input = bundles.VectorInput(self.breath_output,
                                                self.domain,
                                                signals=(1, ))
        self[1][5] = atom.Atom(domain=domain.BoundedFloat(0, 1),
                               policy=self.breath_input.vector_policy(
                                   1, False),
                               names='breath input')

        #
        # Lastly, create an atom called 'decimation' to store our current decimation rate.
        # This will appear in Stage and can be set using Belcanto. When it changes, our
        # __decimation method will be called with a Python numeric argument (because its a
        # numeric domain).
        #
        self[3] = atom.Atom(domain=domain.BoundedInt(0, 100),
                            policy=atom.default_policy(self.__decimation),
                            names='decimation')
コード例 #27
0
ファイル: latch_plg.py プロジェクト: tylerwood/EigenD
    def __init__(self, address, ordinal):
        #
        # Agents are constructed with the address and ordinal.  Each
        # agent will have a unique address and an ordinal unique for
        # that type of agent.
        #
        # We also pass in the automatically generated version to go into
        # the metadata.
        #
        agent.Agent.__init__(self, signature=version, names='latch', ordinal=ordinal)

        #
        # Create a clock domain.  A clock domain is a collection of clock
        # sinks all of which share common properties.  Domains can be isochronous
        # or anisochronous.  Currently, sinks in iso domains can be connected
        # only to other iso domains using the same source.
        #
        self.domain = piw.clockdomain_ctl()

        #
        # Make our domain anisochronous (aniso is used for everything except audio)
        #
        self.domain.set_source(piw.makestring('*',0))

		#
		# Create an atom to bundle the outputs also create sub-atoms that correspond to
		# each of the input streams.
        # An output is created on each sub-atom with a dedicated signal number and name.
        # Setting the second argument to false means that they're not isochronous data streams.
		#
        self[2] = atom.Atom(names="outputs")
        self[2][1] = bundles.Output(1, False, names='activation output')
        self[2][2] = bundles.Output(2, False, names='pressure output')
        self[2][3] = bundles.Output(3, False, names='roll output')
        self[2][4] = bundles.Output(4, False, names='yaw output')

        #
        # bundles.Splitter is a bundle component which demultiplexes the events onto separate
        # Outputs, 1 output per signal.  The bundle, which carries events containing signals,
        # is represented on the output as signals containing events.
		#
        self.output = bundles.Splitter(self.domain,*self[2].values())
        
        #
        # Create an instance of the native Latch implementation and pass it the clock domain
        # and the upstream cookie for the output data.
        #
        self.native = latch(self.domain, self.output.cookie())

        #
        # Create an input.  An input does the work of correlating the events on a 
        # number of signals, grouping them together.
        # 
        # A Vector input is a proper multiple channel input. This one is being
        # constructed to handle 4 signals, numbered 1,2,3 and 4. The events will
        # be sent to the output stage through the use of the native implementation's cookie.
        #
        self.key_input = bundles.VectorInput(self.native.cookie(), self.domain, signals=(1,2,3,4))

		#
        # Create a null atom just to group our inputs. We still name this atom so that it
        # shows up with a meaningful name through introspection by tools like Workbench.
        #
        self[1] = atom.Atom(names="inputs")

        #
        # Now create our inputs. The data policy for the atom is created by our vector input.
        # There are lots of corner cases when we invert our model from signal-contains-events
        # to event-contains-signals. In particular, this happens when events on individual
        # signals dont start and and stop together.
        #
        # Any input with a vector_policy will create or join an existing event.
        # merge_policy will never create events, just join onto existing events created by
        # a vector policy.
        #
        # We create 4 inputs, with vector policies routing them to signals 1,2,3 and 4 on
        # our bundle. These are all non-iso inputs.
        #
        self[1][1] = atom.Atom(domain=domain.BoundedFloat(0,1), policy=self.key_input.vector_policy(1,False), names='activation input')
        self[1][2] = atom.Atom(domain=domain.BoundedFloat(0,1), policy=self.key_input.vector_policy(2,False), names='pressure input')
        self[1][3] = atom.Atom(domain=domain.BoundedFloat(-1,1), policy=self.key_input.vector_policy(3,False), names='roll input')
        self[1][4] = atom.Atom(domain=domain.BoundedFloat(-1,1), policy=self.key_input.vector_policy(4,False), names='yaw input')

        #
        # Lastly, create atoms called 'minimum' and 'controller' to store values for those.
        # These will appear in Stage and can be set using Belcanto. When they changes, the 
        # methods __minimum and __controller will be called with a Python numeric argument
        # (because its a numeric domain).
        #
        self[3] = atom.Atom(domain=domain.BoundedFloat(0,1), init=0.5, policy=atom.default_policy(self.__minimum), names='minimum')
        self[4] = atom.Atom(domain=domain.BoundedInt(2,4), init=2, policy=atom.default_policy(self.__controller), names='controller')
コード例 #28
0
ファイル: metronome_plg.py プロジェクト: shamharoth/EigenD
    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()
コード例 #29
0
    def __init__(self, address, ordinal):
        self.domain = piw.clockdomain_ctl()
        self.domain.set_source(piw.makestring('*', 0))

        agent.Agent.__init__(self,
                             signature=version,
                             names='strummer',
                             protocols='',
                             ordinal=ordinal)

        self[1] = atom.Atom()
        self[1][1] = bundles.Output(1,
                                    False,
                                    names='pressure output',
                                    protocols='')

        self.output = bundles.Splitter(self.domain, *self[1].values())
        self.strummer = piw.strummer(self.output.cookie(), self.domain)
        self.ctl_input = bundles.VectorInput(self.strummer.ctl_cookie(),
                                             self.domain,
                                             signals=(1, ))
        self.data_input = bundles.VectorInput(self.strummer.data_cookie(),
                                              self.domain,
                                              signals=(1, ))

        self[4] = atom.Atom()
        self[4][1] = atom.Atom(domain=domain.BoundedFloat(-1, 1),
                               policy=self.ctl_input.vector_policy(1, False),
                               names='controller input')
        self[4][2] = atom.Atom(domain=domain.BoundedFloat(0, 1),
                               policy=self.data_input.vector_policy(1, False),
                               names='pressure input')

        self[2] = atom.Atom()
        self[2][1] = atom.Atom(domain=domain.Bool(),
                               init=False,
                               names='enable',
                               policy=atom.default_policy(
                                   self.strummer.enable))
        self[2][2] = atom.Atom(domain=domain.BoundedFloat(0, 1),
                               init=0.01,
                               names='on threshold',
                               policy=atom.default_policy(
                                   self.strummer.set_on_threshold))
        self[2][3] = atom.Atom(domain=domain.BoundedFloat(0, 1),
                               init=0.08,
                               names='off threshold',
                               policy=atom.default_policy(
                                   self.strummer.set_off_threshold))
        self[2][4] = atom.Atom(domain=domain.BoundedFloat(0, 1),
                               init=0.0,
                               names='k mix',
                               policy=atom.default_policy(
                                   self.strummer.set_key_mix))
        self[2][5] = atom.Atom(domain=domain.BoundedInt(0, 2000),
                               init=400,
                               names='trigger window',
                               policy=atom.default_policy(
                                   self.strummer.set_trigger_window))

        self.strummer.enable(False)
        self.strummer.set_on_threshold(0.2)
        self.strummer.set_off_threshold(0.1)
        self.strummer.set_key_mix(0.0)
        self.strummer.set_trigger_window(400)
コード例 #30
0
ファイル: commander_cli.py プロジェクト: shamharoth/EigenD
    def __init__(self, name):
        agent.Agent.__init__(self,
                             signature=upgrade.Signature(),
                             volatile=True,
                             names='eigencommander',
                             ordinal=1)

        self.name = name
        self.node = random.randrange(0, 1 << 48L) | 0x010000000000L

        self.langModel = gui.call_bg_sync(self.__create_lang)
        self.historyModel = history.HistoryModel(self.langModel)
        self.commandModel = command.CommandModel(self.langModel)
        self.dictionaryModel = dictionary.DictionaryModel(self.langModel)

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

        self[25] = scroller.Scroller(self.__scroll1,
                                     self.__tap1,
                                     names="scroller",
                                     ordinal=1)  # scrolls the dictionary pane
        self[26] = scroller.Scroller(self.__scroll2,
                                     self.__tap2,
                                     names="scroller",
                                     ordinal=2)  # scrolls the history pane

        self.scroller_clone = piw.clone(True)
        self.scroller_clone.set_output(1, self[25].cookie())
        self.scroller_clone.set_output(2, self[26].cookie())

        self.scroller_in = bundles.VectorInput(self.scroller_clone.cookie(),
                                               self.cdomain,
                                               signals=(1, 2, 3, 4))

        self[28] = atom.Atom(domain=domain.BoundedFloat(-1, 1),
                             init=0,
                             names='roll',
                             policy=self.scroller_in.merge_policy(2, False))
        self[29] = atom.Atom(domain=domain.BoundedFloat(-1, 1),
                             init=0,
                             names='yaw',
                             policy=self.scroller_in.merge_policy(1, False))
        self[30] = atom.Atom(domain=domain.BoundedFloat(-1, 1),
                             init=0,
                             names='key',
                             policy=self.scroller_in.vector_policy(3, False))
        self[31] = atom.Atom(domain=domain.Aniso(),
                             names='controller',
                             policy=self.scroller_in.merge_policy(4, False))

        self[9] = dictionary.DictionaryAgent(self, dictionary.getName())

        self.add_verb2(2, 'minimise([],None)', callback=self.__minimise)
        self.add_verb2(3, 'maximise([],None)', callback=self.__maximise)

        self.font = wx.SystemSettings_GetFont(wx.SYS_DEFAULT_GUI_FONT)
        self.font.SetPointSize(fonts.DEFAULT_PTS)

        self[12] = atom.Atom(domain=domain.BoundedInt(5, 20, rest=11),
                             names='text',
                             protocols='nostage',
                             policy=atom.default_policy(self.__set_fontsize))

        self.__size = node.Server(change=self.__size_changed)
        self.set_private(node.Server())
        self.get_private()[1] = self.__size
        self.__x = 100
        self.__y = 100
        self.__setup_size()

        self.__minX = 60
        self.__minY = 80
        self.__maxX = 100
        self.__maxY = 100

        self.__rootFrame = None
        self.__createRootFrame()

        self[25].reset(1, -1)
        self[26].reset(-1, 1)

        self[25].enable()
        self[26].enable()