Created
May 11, 2018 00:00
-
-
Save raganmd/aca7d9ba6ae5c43e16706fe7d61b87d1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Small example OSC client | |
This program sends 10 random values between 0.0 and 1.0 to the /filter address, | |
waiting for 1 seconds between each value. | |
""" | |
import argparse | |
import random | |
import time | |
from pythonosc import osc_message_builder | |
from pythonosc import udp_client | |
sendToAddress = "127.0.0.1" | |
sendToPort = 5005 | |
oscName = "/done" | |
if __name__ == "__main__": | |
parser = argparse.ArgumentParser() | |
parser.add_argument("--ip", default=sendToAddress, | |
help="The ip of the OSC server") | |
parser.add_argument("--port", type=int, default=5005, | |
help="The port the OSC server is listening on") | |
args = parser.parse_args() | |
client = udp_client.SimpleUDPClient(args.ip, args.port) | |
for x in range(10): | |
client.send_message(oscName, random.random()) | |
time.sleep(1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment