Hey hey,
I also have issues reading a string value from a channel.
instrt 1
chn_S("Strings", 3)
chnset("Hello World", "Strings")
...
endin
instr 2
...
Sname = chnget("Strings")
endin
results in an error:
INIT ERROR in instr 2 (opcode chnget.i) line 21: channel already exists with incompatible type #i0 chnget.i "Strings"
When not using the functional form on the chnget it works.
I also tried chnget:i("Strings"), but no luck. What am I doing wrong?
It is good practice to always add the type after opcode in functional syntax - you never know what is the default type - if there are several output types for the opcode. Thus:
I get this too, again essentially cutting/[pasting your code (minus the typo “instrt”!)
Don’t see anyting wrong with your syntax!
– Pete –
Hey hey,
I also have issues reading a string value from a channel.
instrt 1
chn_S(“Strings”, 3)
chnset(“Hello World”, “Strings”)
…
endin
instr 2
…
Sname = chnget(“Strings”)
endin
results in an error:
INIT ERROR in instr 2 (opcode chnget.i) line 21: channel already exists
with incompatible type #i0 chnget.i “Strings”
When not using the functional form on the chnget it works.
I also tried chnget:i(“Strings”), but no luck. What am I doing wrong?
It is good practice to always add the type after opcode in functional
syntax - you never know what is the default type - if there are several
output types for the opcode. Thus:
^^^ That actually throws an error 'Unexpected ":"'... Seems that only opcodes
that return a value can be typed that way.
-- Pete --
...
chnget:S"Strings"
tarmo
Kontakt Pete Goodeve <pete\.goodeve@computer\.org> kirjutas kuupäeval K,
31. märts 2021 kell 05:02:
> I get this too, again essentially cutting/[pasting your code (minus the
> typo "instrt"!)
> Don't see anyting wrong with your syntax!
>
> -- Pete --
>
> > Hey hey,
> > I also have issues reading a string value from a channel.
> > instrt 1
> > chn_S"Strings", 3
> > chnset"Hello World", "Strings"
> > ...
> > endin
> >
> > instr 2
> > ...
> > Sname = chnget"Strings"
> > endin
> > results in an error:
> > INIT ERROR in instr 2 opcode chnget\.i line 21: channel already exists
> > with incompatible type
> > #i0 chnget.i "Strings"
> >
> > When not using the functional form on the chnget it works.
> >
> > I also tried chnget:i"Strings", but no luck. What am I doing wrong?
> >
> > Best wishes and many thanks,
> >
> > Jeanette
> >
> > --
> > * Website: http://juliencoder.de - for summer is a state of sound
> > * Youtube: https://www.youtube.com/channel/UCMS4rfGrTwz8W7jhC1Jnv7g
> > * Audiobombs: Jeanette C.
> > * GitHub: jeanette-c · GitHub
> >
> > Top down, on the strip
> > Lookin' in the mirror
> > I'm checkin' out my lipstick <3
> > Britney Spears
> >
> > Csound mailing list
> > Csound@listserv.heanet.ie
> > LISTSERV 16.5 - CSOUND List at LISTSERV.HEANET.IE
> > Send bugs reports to
> > Issues · csound/csound · GitHub
> > Discussions of bugs and features can be posted here
>
> Csound mailing list
> Csound@listserv.heanet.ie
> LISTSERV 16.5 - CSOUND List at LISTSERV.HEANET.IE
> Send bugs reports to
> Issues · csound/csound · GitHub
> Discussions of bugs and features can be posted here
>
* chnset:S() would mean "Use the version of chnset that outputs an
S-type variable" but there are no chnset opcodes that output values,
so the error is correct.
* chnget:S() would be appropriate as there are multiple chnget opcodes
and you are specifying the one that returns an S-type variable.