[Csnd-dev] instr0 non-globals affecting variable assignment in instruments

Richard Knight <[email protected]> Sun, 7 Dec 2025 23:54:23 +0000
Newsgroups gmane.comp.audio.csound.devel
Organization 1bpm
Message-ID <[email protected]>
I'm moving to Csound 7 and some of my collection of UDOs don't work - 
there are some patterns such as the one below in some files, which 
caused compilation to fail with the following error:

error: Array variable name 'Sresult' used before as a different type at 
line 14
SEMERR: Array variable name 'Sresult' used before as a different type at 
line 14

I can see why this is happening (conflicting types of Sresult) and how 
to work around, but is this expected behaviour?
Notably this seems to only occur only in opcodes and if arrays are 
involved - if I move the contents of the opcode into an instr then it 
works OK, and numeric/string primitives work OK in this pattern.


Sresult = "anything"

opcode test1, S[], 0
         Sresult[] fillarray "t1", "t2"
         xout Sresult
endop

instr 1
         Sresult[] test1
endin