Cabbage Logo
Back to Cabbage Site

Texteditor can't get string into instr

Hi, I’m trying to create a little instrument that sends OSC messages (to be used as an AU plugin in Logic). I want the address of the message (and perhaps more) to be user-configurable, but for some reason can’t seem to get my text from the texteditor widget. I can’t really figure out how to get it working from the docs. Here’s my code (adapted from OSC sending example):

<Cabbage>

form caption("OSCSend_test"), size(270, 180), pluginId("OSCx"), guiRefresh(10), guiMode("queue")
rslider bounds(10, 10, 110, 110), channel("rslider1"), range(0, 1, 0, 1, 0.01)
rslider bounds(140, 10, 110, 110), channel("rslider2"), range(0, 1, 0, 1, 0.01)
texteditor bounds(12, 150, 100, 20) channel("addrTxt"), text("/foo"), readOnly(0), wrap(0), scrollbars(0)

</Cabbage>
<CsoundSynthesizer>
<CsOptions>
-n -d
</CsOptions>
<CsInstruments>
; Initialize the global variables. 
ksmps = 32
nchnls = 1
0dbfs = 1

instr 1

kData1 chnget "rslider1"
kData2 chnget "rslider2"
kTxt chnget "addrTxt"

OSCsend   kData1+kData2, "localhost", 7770,  kTxt, "ff", kData1, kData2

a1 inch 1

out a1
endin

</CsInstruments>
<CsScore>
;causes Csound to run for about 7000 years...
f0 z
;starts instrument 1 and runs it for a week
i1 0 [60*60*24*7] 
</CsScore>
</CsoundSynthesizer>

It renders:

error: Unable to find opcode entry for ‘OSCsend’ with matching argument types:

Found: (null) OSCsend kSckSkk
Line: 25
from file /Users/woutersnoei/Documents/Cabbage/test_osc.csd (1),Parsing failed due to syntax errors
Stopping on parser failure
cannot compile orchestra

cheers & thanks!
Wouter

Ok, so it had to be an “S” variable, replaced kTxt with STxt and now it works. Never mind :wink:

thanks!

I’m glad you found a solution :slight_smile: I have never really used the OSC opcodes.