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))
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)
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)
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)
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)