aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Runge <david.runge@frqrec.com>2014-02-03 14:59:27 +0100
committerDavid Runge <david.runge@frqrec.com>2014-02-03 14:59:27 +0100
commitc78bf8efe4e10886e6ce01ce26bf5d34c5e23450 (patch)
treeb779bd6ba8d03222defea0222cfd7ead27eb3102
parent09b639ec391fb15bfcf158b45d691938914c109f (diff)
downloadrandom241-c78bf8efe4e10886e6ce01ce26bf5d34c5e23450.tar.gz
random241-c78bf8efe4e10886e6ce01ce26bf5d34c5e23450.tar.bz2
random241-c78bf8efe4e10886e6ce01ce26bf5d34c5e23450.tar.xz
random241-c78bf8efe4e10886e6ce01ce26bf5d34c5e23450.zip
Changed to UDP port, added time_delta for length
-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)