Cabbage Logo
Back to Cabbage Site

Using Identity channels

Hi Rory,

To put this post in perspective, I was following the youtube tutorials and this question relates to video 10

My initial comment on youtube:
"
This code is not working for me. Have no idea why. I am using Cabbage(64bit) v1.1.05 on MacOSX

image bounds(10, 10, 300, 300), corners(“20”), identchannel(“image”)
button bounds(32, 212, 60, 25), channel(“but1”), text(“Push”, “PushOff”)

. . . .

instr 1
kBut chnget “but1”

if changed(kBut)==1 then
if kBut==1 then
chnset “colour(255, 0, 0)”, “image”
else
chnset “colour(255, 255, 0)”, “image”
endif
endif

endin
"
(Please note: I added endin in the quote above as I missed it on youtube)

May I add that I started with “New Instrument” and removed what was in the instrument 1 and removed the keyboard.
Other instruments work, so I suppose that the system, including sound card, is OK.

I found what I was missing.
Unless the instrument is not called from the score, it will not work.
The default score has
f0 z ; which should cause Csound to run

but unless I specifically call the instrument, it will not work, so I had to add the following.
i1 0 100

Ah yes, you started with the ‘New Instrument’ template. When I checked I use the ‘New Effect’ template, which automatically starts the instrument playing. Sorry, I should have thought of that. Anyhow, I’m glad you got it sorted.