Hello again! cabbageCreate breaks somehow when activated via UDP. Let me explain.
—port option, Csound opens a UDP connection to listen for commands. Using
nc or similar UDP client, you can send orc code to be live-compiled, trigger i-events, and send values to channels. It works with Cabbage, and I created a cabbage file that is a blank canvas for livecoding.
I created this instrument:
cabbageCreate “rslider”, “bounds(10,10,40,40)”
ares oscil ampdbfs(-12), 440
outs ares, ares
Which as you can see creates a knob widget. I also include a 440Hz tone to indicate when the instrument is playing for debugging purposes.
It works fine when I activate it from a regular score i-statement:
i 127 0 1
Although for some reason it doesn’t work if p3 is 0 (initialization pass only). The knob is created and visible. Edit: actually I take it back, it works fine from the score when p3 is 0.
However if I use the same orchestra code and try to activate it from the UDP client with this command
&i127 0 1
I hear the tone but no knob is created.
You can imagine the cool things you could do with livecoding if widgets could be created on the fly.
However, working around this issue by simply generating a large number of invisible widgets at the beginning of performance and then using identifiers to marshal them as needed, seems to be an acceptable solution for my purposes. Still I thought it was odd.
Update: The same problem also appears when activating instr 127 using real-time MIDI input. The tone is heard, meaning instr 127 is being turned on, but the knob doesn’t appear. So it must be a problem that doesn’t have anything directly to do with UDP, but rather whenever the instrument containing cabbageCreate is activated in real-time.
I did download the latest build off the Azure page.