aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xrandom241osc.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/random241osc.py b/random241osc.py
index 3d95f69..1e06917 100755
--- a/random241osc.py
+++ b/random241osc.py
@@ -10,20 +10,21 @@ target = None
def connect_to_server(hostname, port):
global target
if (hostname or port) is None:
- target = osc.Adress('127.0.0.1', 57120, osc.TCP)
+ target = osc.Adress('127.0.0.1', 57121, osc.UDP)
else:
try:
- target = osc.Address(hostname, port, osc.TCP)
+ target = osc.Address(hostname, port, osc.UDP)
except osc.AddressError, err:
logging.error(err)
# Send a osc_message to the server
-def send_osc_msg_to_server(randomness):
+def send_msg(time_delta, randomness):
global target
# if the message is not empty and longer than 1
if randomness is not None and len(randomness) > 1:
msg = osc.Message("/random")
+ msg.add(time_delta)
msg.add(randomness[0], randomness[1])
try:
osc.send(target, msg)