Jul-23-2018, 04:54 PM
I'm trying to send some values to a csound instrument using the following code
its from an example found here: https://pypi.org/project/python-osc/
I'm getting an error for:
args = parser.parse_args()
im not sure what this means. But i am aware that i'm confused about the strings in the double quotes. for example where the code says "The ip of the osc server" is it meant to be what it is ? OR do I replace the text with the ip of the osc server if so, how do I get the ip of the osc server?
its from an example found here: https://pypi.org/project/python-osc/
I'm getting an error for:
args = parser.parse_args()
im not sure what this means. But i am aware that i'm confused about the strings in the double quotes. for example where the code says "The ip of the osc server" is it meant to be what it is ? OR do I replace the text with the ip of the osc server if so, how do I get the ip of the osc server?
"""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 if __name__ == "__main__": parser = argparse.ArgumentParser() parser.add_argument("--ip", default="127.0.0.1", 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("/filter", random.random()) time.sleep(1)