def __init__(self, address, ordinal): agent.Agent.__init__(self, signature=version, names='summer', ordinal=ordinal) self.domain = piw.clockdomain_ctl() self.output = bundles.Splitter(self.domain) self.mixer = piw.stereosummer(self.domain, self.output.cookie(), 1) self.input = bundles.VectorInput(self.mixer.cookie(), self.domain, signals=(1, 2, 3, 4, 5, 6, 7, 8, 9)) self[2] = audio.AudioOutput(self.output, 1, 1, names='outputs') self[1] = audio.AudioInput(self.input, 1, 1, names='inputs') self[4] = audio.AudioChannels(self[1], self[2], self.mixer)
def __init__(self, address, ordinal): agent.Agent.__init__(self, signature=version, names='gain', ordinal=ordinal) self.domain = piw.clockdomain_ctl() self.output = bundles.Splitter(self.domain) self.gain = piw.linear_gain(self.output.cookie(), self.domain) self.input = bundles.VectorInput(self.gain.cookie(), self.domain, signals=(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)) self[1] = audio.AudioOutput(self.output, 2, 1) self[2] = audio.AudioInput(self.input, 2, 1) self[4] = audio.AudioChannels(self[1], self[2]) self[3] = atom.Atom(domain=domain.BoundedFloat(0, 1), names="volume input", policy=self.input.merge_policy( 1, policy.IsoStreamPolicy(1, 0, 0)))
def __init__(self, address, ordinal): agent.Agent.__init__(self, signature=version, names='panner', ordinal=ordinal) self.pan = piw.make_f2f_table(-1, 1, 1000, picross.make_f2f_functor(pan_function)) self.domain = piw.clockdomain_ctl() self.output = bundles.Splitter(self.domain) self.panner = piw.panner(self.pan, self.output.cookie(), self.domain) self.input = bundles.VectorInput(self.panner.cookie(), self.domain, signals=(1, 2, 3)) self[1] = audio.AudioOutput(self.output, 1, 2) self[2] = audio.AudioInput(self.input, 2, 2) self[3] = atom.Atom(domain=domain.BoundedFloat(-1, 1), names="pan input", policy=self.input.merge_policy( 1, policy.IsoStreamPolicy(1, -1, 0)))
def __init__(self, address, ordinal): agent.Agent.__init__(self,signature=version,names='audio unit',container=100) self.set_property_long('cordinal',ordinal) self.__state = PluginState(self.__plugin_state_loaded) self.set_private(self.__state) self.__browser = PluginBrowser(self) self.__domain = piw.clockdomain_ctl() self.__audio_output = audio.AudioOutput(bundles.Splitter(self.__domain),1,2) self.__audio_output_channels = audio.AudioChannels(self.__audio_output) self.__midi_output = bundles.Splitter(self.__domain) self.__observer = PluginObserver(self.__state,self) self.__channel_delegate = MidiChannelDelegate(self) self.__host = host_native.plugin_instance( self.__observer, self.__channel_delegate, self.__domain,self.__audio_output.cookie(),self.__midi_output.cookie(), utils.statusify(self.__window_state_changed)) self.parameter_list = inputparameter.List(self.__host,self.__host.clock_domain(),self.verb_container()) self.__audio_input = audio.AudioInput(bundles.ScalarInput(self.__host.audio_input(),self.__domain,signals=range(1,65)),1,2) self.__audio_input_channels = audio.AudioChannels(self.__audio_input) self.__velocity_detector = piw.velocitydetect(self.__host.midi_from_belcanto(),1,4) self.__key_input = bundles.VectorInput(self.__velocity_detector.cookie(),self.__domain,signals=(1,2)) self.__midi_input = bundles.ScalarInput(self.__host.midi_aggregator(),self.__domain,signals=(1,)) self.__metronome_input = bundles.ScalarInput(self.__host.metronome_input(),self.__domain,signals=(1,2,3,4)) self.__host.set_bypassed(True) # plugin browser self[1] = self.__browser # audio output self[2] = atom.Atom() self[2][1] = self.__audio_output self[2][2] = self.__audio_output_channels # audio input self[3] = atom.Atom() self[3][1] = self.__audio_input self[3][2] = self.__audio_input_channels # parameter mapping self[4] = self.parameter_list # metronome input self[5] = atom.Atom() self[5][1] = atom.Atom(domain=domain.Aniso(),policy=self.__metronome_input.nodefault_policy(1,False),names='song beat input') self[5][2] = atom.Atom(domain=domain.Aniso(),policy=self.__metronome_input.nodefault_policy(2,False),names='running input') self[5][3] = atom.Atom(domain=domain.Aniso(),policy=self.__metronome_input.nodefault_policy(3,False),names='tempo input') self[5][4] = atom.Atom(domain=domain.Aniso(),policy=self.__metronome_input.nodefault_policy(4,False),names='bar beat input') # kbd/controller inputs self[6] = atom.Atom() self[6][1] = atom.Atom(domain=domain.Aniso(),policy=self.__key_input.vector_policy(1,False),names='pressure input') self[6][2] = atom.Atom(domain=domain.Aniso(),policy=self.__key_input.merge_nodefault_policy(2,False),names='frequency input') # midi channel self[7] = atom.Atom(domain=domain.BoundedInt(0,16),init=0,names='midi channel',policy=atom.default_policy(self.set_midi_channel)) # velocity curve control self[8] = atom.Atom() self[8][1] = atom.Atom(domain=domain.BoundedInt(1,1000),init=4,names='velocity sample',policy=atom.default_policy(self.__set_velocity_samples)) self[8][2] = atom.Atom(domain=domain.BoundedFloat(0.1,10),init=4,names='velocity curve',policy=atom.default_policy(self.__set_velocity_curve)) self[8][3] = atom.Atom(domain=domain.BoundedFloat(0.1,10),init=4,names='velocity scale',policy=atom.default_policy(self.__set_velocity_scale)) self[10] = atom.Atom(domain=domain.BoundedFloatOrNull(0,100000),init=None,names='tail time',policy=atom.default_policy(self.__set_tail_time)) self[11] = atom.Atom(domain=domain.BoundedInt(1,16),init=1,names='minimum channel',policy=atom.default_policy(self.set_min_channel)) self[12] = atom.Atom(domain=domain.BoundedInt(1,16),init=16,names='maximum channel',policy=atom.default_policy(self.set_max_channel)) # status output to drive the talker lights self[13] = bundles.Output(1,False,names='status output') self.light_output = bundles.Splitter(self.__domain,self[13]) self.lights = piw.lightsource(piw.change_nb(),0,self.light_output.cookie()) self.lights.set_size(2) self.set_light(1,True) self.set_light(2,False) # midi I/O # midi input self[14] = atom.Atom(domain=domain.Aniso(),policy=self.__midi_input.nodefault_policy(1,False),names='midi input') # midi output self[15] = self.__midi_output.add_output(bundles.Output(1,False,names='midi output')) self.add_verb2(1,'show([],None)',callback=self.__show) self.add_verb2(2,'show([un],None)',callback=self.__unshow) self.add_verb2(3,'close([],None)',callback=self.__close) self.add_verb2(4,'bypass([toggle],None)',callback=self.__tog_bypass,status_action=self.__status_bypass) self.add_verb2(5,'show([toggle],None)',callback=self.__tog_show,status_action=self.__status_show) self.add_verb2(6,'open([],None,role(None,[abstract]))',callback=self.__open) self.add_verb2(7,'scan([],None)',callback=self.__browser.refresh_plugin_list) self.add_verb2(8,'bypass([],None)',callback=self.__bypass) self.add_verb2(9,'bypass([un],None)',callback=self.__unbypass) self.set_ordinal(ordinal)
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)