My problem is that “channelname” is contained by a Svariable. The aim is to make a
chnset kVal, Svar
and I cannot make an explicit reference to “channelname”. The error is :
I receive invalid channel name:
SECTION 1:
INIT ERROR in instr 1: invalid channel name
chnset.k kValue SM
B 0.000 - note deleted. i2 had 1 init errors
Here is the full code… which is trivial
Python
import OSC
c = OSC.OSCClient()
c.connect(('127.0.0.1', 57290)) # localhost, port 57120
oscmsg = OSC.OSCMessage()
oscmsg.setAddress("/mysynth")
oscmsg.append("combobox")
oscmsg.append(5)
c.send(oscmsg)
and Cabbage Csound
<Cabbage>
form caption("Untitled") size(400, 300), colour(58, 110, 182), pluginID("def1")
combobox bounds(65, 18, 100, 30), channel("combobox"), identchannel("comboboxR"),items("Item 1", "Item 2", "Item 3","Item $", "Item5")
</Cabbage>
<CsoundSynthesizer>
<CsOptions>
-n -d -+rtmidi=NULL -M0 -m0d --midi-key-cps=4 --midi-velocity-amp=5
</CsOptions>
<CsInstruments>
; Initialize the global variables.
sr = 44100
ksmps = 32
nchnls = 2
0dbfs = 1
giOsc OSCinit 57290
instr 1
SMessage init ""
kValue init 0
kValue = 0
kFlag OSClisten giOsc,"/mysynth","si",SMessage,kValue
if (kFlag==0) goto ex
printf "%d %s \n",kFlag, kValue, SMessage
SM sprintf "%s",SMessage
chnset kValue,SM
ex:
endin
</CsInstruments>
<CsScore>
f 0 z
i1 0 3600
</CsScore>
</CsoundSynthesizer>