Skip to content

Instantly share code, notes, and snippets.

@kn1kn1
Last active July 25, 2017 02:16
Show Gist options
  • Save kn1kn1/03b6735a43c115c02adc92bd00a017ab to your computer and use it in GitHub Desktop.
Save kn1kn1/03b6735a43c115c02adc92bd00a017ab to your computer and use it in GitHub Desktop.
# Petal bangs osc message at the start of every cycle. #Sonic Pi 2.11.1
load "~/petal/petal.rb"
d1 "bd"
client = SonicPi::OSC::UDPClient.new("127.0.0.1", 7770, use_encoder_cache: true)
i = 0
live_loop :bang do
sync :d0
address = "/bang"
message = "message" + i.to_s
client.send(address, message) # send message to the osc server(127.0.0.1:7770).
i = i + 1
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment