예제 #1
0
    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))
예제 #2
0
 def __init__(self, agent):
     self.__agent = agent
     audio.AudioInput.__init__(self,
                               self.__agent.audio_input,
                               1,
                               2,
                               names='headphone')
     self[100] = toggle.Toggle(self.__enable,
                               self.__agent.domain,
                               container=(None, 'headphone',
                                          self.__agent.verb_container()),
                               names='enable')
     self[101] = atom.Atom(domain=domain.BoundedInt(
         0,
         127,
         hints=(T('stageinc',
                  1), T('inc', 1), T('biginc', 5), T('control', 'updown'))),
                           names='gain',
                           init=70,
                           policy=atom.default_policy(self.__gain))
     self[102] = atom.Atom(domain=domain.BoundedInt(0, 4),
                           names='quality',
                           init=0,
                           policy=atom.default_policy(self.__quality))
     self[103] = atom.Atom(domain=domain.Bool(),
                           names='limit',
                           init=True,
                           policy=atom.default_policy(self.__limit))
     self[103].set_property_string(
         'show_warning',
         'BY CHANGING THE PRESET HEADPHONE LIMIT YOU ABSOLVE EIGENLABS LTD OF ALL LIABILITY FOR ANY HEARING DAMAGE THAT MAY BE CAUSED AS A RESULT OF SUCH ACTIONS'
     )
예제 #3
0
 def __init__(self,agent):
     self.__agent = agent
     audio.AudioInput.__init__(self,self.__agent.audio_input,1,2,names='headphone')
     self[100] = toggle.Toggle(self.__enable,self.__agent.domain,container=(None,'headphone',self.__agent.verb_container()),names='enable')
     self[101] = atom.Atom(domain=domain.BoundedInt(0,127,hints=(T('inc',1),T('biginc',5),T('control','updown'))),names='gain',init=70,policy=atom.default_policy(self.__gain))
     self[102] = atom.Atom(domain=domain.BoundedInt(0,4),names='quality',init=0,policy=atom.default_policy(self.__quality))
     self[103] = atom.Atom(domain=domain.Bool(),names='limit',init=True,policy=atom.default_policy(self.__limit))
예제 #4
0
    def __init__(self, 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()