Skip to content

Instantly share code, notes, and snippets.

@MarcScott
Created February 14, 2017 09:11
Show Gist options
  • Save MarcScott/8e60bd71d25d524506b430745ee6f8cc to your computer and use it in GitHub Desktop.
Save MarcScott/8e60bd71d25d524506b430745ee6f8cc to your computer and use it in GitHub Desktop.
## Requires pythonosc - sudo pip3 install python-osc
## PYTHON FILE
from pythonosc import osc_message_builder
from pythonosc import udp_client
sender = udp_client.SimpleUDPClient('127.0.0.1', 4559)
sender.send_message('/play_this', 60) ##play note 60
## SONIC PI FILE
set_sched_ahead_time! 0
live_loop :listen do
message = sync "/play_this"
note = message[:args][0]
play note
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment