Last active
January 30, 2018 08:54
-
-
Save maciejjankowski/702e8e0d5ec1c1871fdda889ffb75460 to your computer and use it in GitHub Desktop.
python osc touchviz
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
import argparse | |
import random | |
import time | |
from itertools import chain | |
from pythonosc import osc_message_builder | |
from pythonosc import udp_client | |
# add easing iterators https://gist.github.com/th0ma5w/9883420 | |
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) | |
while 1: | |
for i in chain(range(0, 100, 2),range(100, 0, -2)): | |
client.send_message("/fx/m/param/2", i/100) | |
time.sleep(0.01) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment