[Csnd] Passing arrays to UDO

I’ve written a UDO to concatenate an array of strings into a single string, with a seperator character. But when I pass an empty string, for some reason when you pass a zero length string, it removes one character from the string.

This is the output from the attached program.


[0] ‘one’

[1] ‘two’

[2] ‘three’

‘ontwthree’ ‘one, two, three’

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

test5.csd (1.09 KB)

Could be a bug. Would you be able to open a ticket with your example and we’ll look into it.

Prof. Victor Lazzarini
Maynooth University

Hope this was the right place…


yes, thanks.

Prof. Victor Lazzarini
Maynooth University

the reason is not in the udo and not in the array, but in strcat:

instr 2
  Sout = "one"
  Sout strcat Sout, ""
  puts Sout, 1

outputs "on"


Thanks, Joachim!