Beispiel #1
0
 def _get_global_parameter(parameter):
     """ /get  s:param  s:return_url  s:retpath"""
     OSCClient.send_message(
         '/get',
         type=',sss',
         args=[parameter, return_url, f'/global/parameter/{parameter}'])
     SLClient.selection_evt.wait(timeout)
 def test_ping(self):
     OSCServer.start(port=8852)
     OSCClient.start(port=8852, client_name='test')
     OSCServer.register_handler('/test', self.handler)
     OSCClient.send_message('/test', type=',s', args=['hello'])
     time.sleep(0.5)
     self.assertEqual(self.ping, 'hello')
Beispiel #3
0
 def save_loop(file, loop_number=-3, format='wav', endian='big'):
     """/sl/#/save_loop   s:filename  s:format  s:endian  s:return_url  s:error_path
     saves current loop to given filename, may return error to error_path
     format and endian currently ignored, always uses 32 bit IEEE float WAV"""
     OSCClient.send_message(
         f'/sl/{loop_number}/save_loop',
         args=[file, format, endian, return_url, '/save_loop_error'])
Beispiel #4
0
    def ping():
        """"PING Engine
         /ping s:return_url s:return_path

         If engine is there, it will respond with to the given URL and PATH with an OSC message with arguments:
         s:hosturl  s:version  i:loopcount"""

        OSCClient.send_message('/ping', [return_url, '/pingrecieved'])
        SLClient.ping_evt.wait(timeout=timeout)
        return SLClient.loops
Beispiel #5
0
 def get_parameter(control, loop, return_path=None):
     """/sl/#/get s:control  s:return_url  s: return_path
     Which returns an OSC message to the given return url and path with the arguments:
     i: loop_index s: control f: value
     Where control is one of the above or: state::"""
     return_path = (f'/parameter/{loop}/{control}'
                    if return_path is None else return_path)
     OSCClient.send_message(f'/sl/{loop}/get',
                            [control, return_url, return_path])
     SLClient.parameter_evt.wait(timeout)
Beispiel #6
0
 def set_parameter(value, loop):
     OSCClient.send_message(f'/sl/{loop}/set', value)
     return SLClient.get_parameter(value[0], loop)
Beispiel #7
0
 def unregister_global_auto_update(control, return_path):
     """/unregister_auto_update  s:ctrl s:returl s:retpath"""
     OSCClient.send_message('/unregister_auto_update',
                            [control, return_url, return_path])
Beispiel #8
0
 def register_global_auto_update(control, return_path, interval=10):
     """ /register_auto_update  s:ctrl i:ms_interval s:returl s:retpath"""
     OSCClient.send_message('/register_auto_update',
                            [control, interval, return_url, return_path])
Beispiel #9
0
 def unregister_auto_update(control, return_path, loop):
     """/sl/#/unregister_auto_update  s:ctrl s:returl s:retpath"""
     OSCClient.send_message(f'/sl/{loop}/unregister_auto_update',
                            [control, return_url, return_path])
Beispiel #10
0
 def register_auto_update(control, return_path, loop, interval=10):
     """/sl/#/register_auto_update  s:ctrl i:ms_interval s:returl s:retpath"""
     OSCClient.send_message(f'/sl/{loop}/register_auto_update',
                            [control, interval, return_url, return_path])
Beispiel #11
0
 def quit():
     """/quit
     shutdown engine"""
     OSCClient.send_message('/quit')
Beispiel #12
0
 def loop_del(index=-3):
     """/loop_del  i:loopindex
     a value of -1 for loopindex removes last loop, and is the only
     value currently recommended."""
     OSCClient.send_message('/loop_del', type=',i', args=[index])
Beispiel #13
0
 def loop_add(channels=2, length=60):
     """/loop_add  i:#channels  f:min_length_seconds
     adds a new loop with # channels and a minimum loop memory"""
     OSCClient.send_message('/loop_add',
                            type=',if',
                            args=[channels, length])
Beispiel #14
0
 def _set_global_parameter(parameter, value):
     """/set  s:param  f:value"""
     OSCClient.send_message('/set',
                            type=',sf',
                            args=[parameter, float(value)])
     SLClient._get_global_parameter(parameter)
Beispiel #15
0
 def load_session(file):
     """/load_session   s:filename  s:return_url  s:error_path
     loads and replaces the current session from filename."""
     OSCClient.send_message('/load_session',
                            args=[file, return_url, '/load_session_error'])
Beispiel #16
0
 def save_session(file):
     """/save_session   s:filename  s:return_url  s:error_path
     saves current session description to filename."""
     OSCClient.send_message('/save_session',
                            args=[file, return_url, '/save_session_error'])
Beispiel #17
0
 def load_loop(loop_number, file):
     """/sl/#/load_loop   s:filename  s:return_url  s:error_path
     loads a given filename into loop, may return error to error_path"""
     OSCClient.send_message(f'/sl/{loop_number}/load_loop',
                            args=[file, return_url, '/load_loop_error'])
Beispiel #18
0
 def hit(command, loop):
     """""/sl/#/hit s:cmdname
     A single hit only, no press-release action"""
     OSCClient.send_message(f'/sl/{loop}/hit', [command])
     SLClient.state_change.wait(timeout=timeout)
     return SLClient.state