I'm trying to create an art installation with generative audio. We want to use python to trigger different "scenes" within TidalCycles. I feel like I'm carefully following the instructions here, but am rather struggling to get TidalCycles to understand what's being sent.
First, I added this line to my BootTidal.hs file. The documentation said that TidalCycles listens on 6010 by default, but I did not find this to be the case.
tidal <- startTidal superdirtTarget (defaultConfig {cCtrlAddr = "127.0.0.1", cCtrlPort = 6010})
I'm running TidalCycles in Pulsar, and it shows that it receives the OSC message, but clearly my syntax in incorrect in some way. How should I be changing the format of my message so that TidalCycles understands what I'm saying?
Hopefully this post can serve as a minimal example for others in the future!
My TidalCycles code:
d1 $ sound "bd*2" # gain (cF 1 "amp")
My Python code:
import time
from pythonosc import udp_client
# Define the IP address and port number of the TidalCycles OSC server
# https://tidalcycles.org/docs/configuration/MIDIOSC/osc/#configuration
tidal_host = "127.0.0.1"
tidal_port = 6010
# Create an OSC client to send messages to TidalCycles
osc_client = udp_client.SimpleUDPClient(tidal_host, tidal_port)
while(1):
osc_client.send_message("/ctrl/amp", 0.1)
time.sleep(1)
osc_client.send_message("/ctrl/amp", 0.8)
time.sleep(1)
Error message:
Unhandled OSC: Message {messageAddress = "/ctrl/amp", messageDatum = [Float {d_float = 0.1}]}