def create_scene(control_scene): return [ md.PortFilter('control_in') >> control_scene >> md.Port('synth_out'), md.PortFilter('keys_in') >> md.Print('keys') >> md.Port('synth_out'), md.PortFilter('synth_in') >> md.Print('synth') >> A3000_SysExFilter() >> SaveSysEx('a3000_patch') >> md.Discard() ]
def create_scene(control_scene): '''Create a complete scene from a control event list returned from map_events''' sc = [ md.PortFilter('control_in') >> ~md.KeyFilter(notes=[25, 26, 27]) >> control_scene >> md.Port('synth_out'), md.PortFilter('keys_in') >> md.Print('keys') >> md.Port('synth_out'), # md.PortFilter('synth_in') >> md.Print('synth') >> TX7_SysExFilter() >> SaveSysEx('dx7_patch') >> md.Discard()] ] return sc
control_port_pattern = r'a2j:MIDI Mix.*MIDI 1' md.config(backend='jack', client_name='control-map', in_ports=[('keys_in', keys_port_pattern), ('control_in', control_port_pattern), ('synth_in', synth_port_pattern)], out_ports=[('keys_out', keys_port_pattern), ('control_out', control_port_pattern), ('synth_out', synth_port_pattern)]) control_switches = [md.KeyFilter(notes=[27]) >> (TX7_DumpRequest(0) >> md.Port('synth_out')), md.KeyFilter(notes=[25]) >> md.SceneSwitch(offset=-1), md.KeyFilter(notes=[26]) >> md.SceneSwitch(offset=1)] control = md.PortFilter('control_in') >> md.Filter(md.NOTEON) >> control_switches #control = md.PortFilter('control_in') >> md.Print('control') pre = None #md.Print('input') # bank/page buttons, solo button post = None #md.Print('output') def fill_pages(): """returns a dict of page descriptions. These are dicts as well, that map input_controller_names to parameter_names""" ps = {'op[1-3]_eg': {}, 'op[4-6]_eg': {}, 'frequency': {}, 'pitch_eg/lfo': {}, 'op_mod_sensitivity': {}, 'keyboard_level_scaling_depth': {}, 'keyboard_level_scaling_curve': {}, 'name': {}, 'performance': {},
md.config(backend='jack', client_name='control-map', in_ports=[('keys_in', keys_port_pattern), ('control_in', control_port_pattern), ('synth_in', synth_port_pattern)], out_ports=[('keys_out', keys_port_pattern), ('control_out', control_port_pattern), ('synth_out', synth_port_pattern)]) control_switches = [ # md.KeyFilter(notes=[27]) >> (AlphaJuno_DumpRequest(0) >> md.Port('synth_out')), md.KeyFilter(notes=[25]) >> md.SceneSwitch(offset=-1), md.KeyFilter(notes=[26]) >> md.SceneSwitch(offset=1) ] control = md.PortFilter('control_in') >> md.Filter( md.NOTEON ) >> control_switches #control = md.PortFilter('control_in') >> md.Print('control') control = md.PortFilter('control_in') >> md.Filter( md.NOTEON ) >> control_switches #control = md.PortFilter('control_in') >> md.Print('control') pre = None #md.Print('input') # bank/page buttons, solo button post = None #md.Print('output') ps = { '1: voice': { 'pot_0_0': 'dco_range', 'pot_1_0': 'dco_waveform_pulse', 'pot_2_0': 'dco_waveform_sawtooth', 'pot_3_0': 'dco_waveform_sub',
pages = { 'remote': { 'mackie_encoder_0': 'knob1_encoder', 'mackie_encoder_1': 'knob2_encoder', 'mackie_encoder_2': 'knob3_encoder', 'mackie_encoder_3': 'knob4_encoder', 'mackie_encoder_4': 'knob5_encoder', } } def create_scene(control_scene): return [ md.PortFilter('control_in') >> control_scene >> md.Port('synth_out'), md.PortFilter('keys_in') >> md.Print('keys') >> md.Port('synth_out'), md.PortFilter('synth_in') >> md.Print('synth') >> A3000_SysExFilter() >> SaveSysEx('a3000_patch') >> md.Discard() ] scenes = create_scenes(pages, arturia, yam_rc, create_scene) control = md.PortFilter('control_in') pre = None #md.Print('input') post = None #md.Print('output') # enable OSC Interface for livedings md.hook(mdosc.OSCInterface(56418, 56419)) md.run(scenes, control=control, pre=pre, post=post)