import settings from pointsons.server.memorize import MemorizeConfig from pointsons.server.osc import PointSonsOSCInterface from pointsons.server.scenes import ps_scenes from pointsons.server.control import ps_control # Filter out notes not in device range, and transpose (required for InterfaceZ cards) note_range_filter = KeyFilter(settings.BOWL_LOWER, settings.BOWL_UPPER) post = note_range_filter >> Transpose(-12) if settings.DEBUG: pre = Print('input', portnames='in') post = post >> Print('output', portnames='out') else: pre = post = None hook( PointSonsOSCInterface(port=settings.SERVER_OSC_PORT, notify_ports=[settings.KINECT_OSC_PORT, settings.UI_OSC_PORT]), MemorizeConfig('config.ps'), AutoRestart(), ) run(scenes=ps_scenes, control=ps_control, pre=pre, post=post)
for p in ps.values(): for op in range(0,6): p['slider_{}'.format(op)] = 'op{}_operator_output_level'.format(op+1) p['slider_6'] = 'feedback' p['slider_7'] = 'lfo_speed' return ps # controller mappings 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 #return md.Print('scene_input') >> control_scene #return control_scene scenes = create_scenes(fill_pages(), akai, yam, create_scene) #print(scenes) # enable OSC Interface for livedings md.hook(mdosc.OSCInterface(56418, 56419)) md.run(scenes, control=control, pre=pre, post=post)
control_port = "controls" # rest of keyboard keyboard_port = "keyboard" config( backend='jack-rt', client_name='example', out_ports=['synth', 'extra'], # in_ports = [(keyboard_port, 'system:midi_capture_1'), (control_port, 'system:midi_capture_4')], in_ports=[keyboard_port, control_port], ) hook( # auto-restart: edit and save this file in a text editor while it's # running, and mididings will automatically restart itself (!) #AutoRestart(), # memorize scene: every time this script is restarted, it automatically # comes back with the previously active scene #MemorizeScene('scene.txt') ) # give feedback to possible OSC ui guiOSC = remoteOSC.RemoteOSC() # connect to ardour OSC interface and its default OSC port ardourOSC = remoteOSC.RemoteOSC(client_port=3819) # same for custom zynthian wrapper zynthianOSC = remoteOSC.RemoteOSC(client_port=4567) # HOTFIX: these notes produce sounds, go through computer keyboard instead launch_state = state.State("launch", 3, note_toggle=0,