Created
February 14, 2017 09:11
-
-
Save MarcScott/8e60bd71d25d524506b430745ee6f8cc 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
## 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