Csound Csound-dev Csound-tekno Search About

[Csnd] Passing arrays to UDO

Date2021-07-08 19:09
FromMike McGonagle
Subject[Csnd] Passing arrays to UDO
Attachmentstest5.csd  
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.

SECTION 1:

[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

Date2021-07-08 20:02
FromVictor Lazzarini
SubjectRe: [Csnd] [EXTERNAL] [Csnd] Passing arrays to UDO
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
Ireland

On Jul 8, 2021, at 7:10 PM, Mike McGonagle <mjmogo@gmail.com> wrote:



*Warning*

This email originated from outside of Maynooth University's Mail System. Do not reply, click links or open attachments unless you recognise the sender and know the content is safe.

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.

SECTION 1:

[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>

Date2021-07-08 20:23
FromMike McGonagle
SubjectRe: [Csnd] [EXTERNAL] [Csnd] Passing arrays to UDO
Hope this was the right place...


On Thu, Jul 8, 2021 at 2:02 PM Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
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
Ireland

On Jul 8, 2021, at 7:10 PM, Mike McGonagle <mjmogo@gmail.com> wrote:



*Warning*

This email originated from outside of Maynooth University's Mail System. Do not reply, click links or open attachments unless you recognise the sender and know the content is safe.

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.

SECTION 1:

[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>
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
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

Date2021-07-08 20:58
FromVictor Lazzarini
SubjectRe: [Csnd] [EXTERNAL] [Csnd] Passing arrays to UDO
yes, thanks.

Prof. Victor Lazzarini
Maynooth University
Ireland

On Jul 8, 2021, at 8:23 PM, Mike McGonagle <mjmogo@gmail.com> wrote:


Hope this was the right place...


On Thu, Jul 8, 2021 at 2:02 PM Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
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
Ireland

On Jul 8, 2021, at 7:10 PM, Mike McGonagle <mjmogo@gmail.com> wrote:



*Warning*

This email originated from outside of Maynooth University's Mail System. Do not reply, click links or open attachments unless you recognise the sender and know the content is safe.

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.

SECTION 1:

[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>
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
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

Date2021-07-08 21:06
Fromjoachim heintz
SubjectRe: [Csnd] [EXTERNAL] [Csnd] Passing arrays to UDO
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
endin
schedule(2,0,0)

outputs "on"

	joachim




On 08/07/2021 21:23, Mike McGonagle wrote:
> Hope this was the right place...
> 
> https://github.com/csound/csound/issues/1500 
> 
> 
> On Thu, Jul 8, 2021 at 2:02 PM Victor Lazzarini  > wrote:
> 
>     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
>     Ireland
> 
>>     On Jul 8, 2021, at 7:10 PM, Mike McGonagle >     > wrote:
>>
>>     
>>
>>
>>       *Warning*
>>
>>     This email originated from outside of Maynooth University's Mail
>>     System. Do not reply, click links or open attachments unless you
>>     recognise the sender and know the content is safe.
>>
>>     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.
>>
>>     SECTION 1:
>>
>>     [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
>>     
>     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 
> 
> 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

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

Date2021-07-08 21:21
FromMike McGonagle
SubjectRe: [Csnd] [EXTERNAL] [Csnd] Passing arrays to UDO
Thanks, Joachim!

On Thu, Jul 8, 2021 at 3:06 PM joachim heintz <jh@joachimheintz.de> wrote:
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
endin
schedule(2,0,0)

outputs "on"

        joachim




On 08/07/2021 21:23, Mike McGonagle wrote:
> Hope this was the right place...
>
> https://github.com/csound/csound/issues/1500
> <https://github.com/csound/csound/issues/1500>
>
> On Thu, Jul 8, 2021 at 2:02 PM Victor Lazzarini <Victor.Lazzarini@mu.ie
> <mailto:Victor.Lazzarini@mu.ie>> wrote:
>
>     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
>     Ireland
>
>>     On Jul 8, 2021, at 7:10 PM, Mike McGonagle <mjmogo@gmail.com
>>     <mailto:mjmogo@gmail.com>> wrote:
>>
>>     
>>
>>
>>       *Warning*
>>
>>     This email originated from outside of Maynooth University's Mail
>>     System. Do not reply, click links or open attachments unless you
>>     recognise the sender and know the content is safe.
>>
>>     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.
>>
>>     SECTION 1:
>>
>>     [0] 'one'
>>
>>     [1] 'two'
>>
>>     [2] 'three'
>>
>>     'ontwthree' 'one, two, three'
>>
>>
>>
>>     Csound mailing list Csound@listserv.heanet.ie
>>     <mailto:Csound@listserv.heanet.ie>
>>     https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>     <https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Flistserv.heanet.ie%2Fcgi-bin%2Fwa%3FA0%3DCSOUND&data=04%7C01%7CVictor.Lazzarini%40mu.ie%7C22103c2781a243bbcf9e08d9423ba4ec%7C1454f5ccbb354685bbd98621fd8055c9%7C1%7C1%7C637613646226978241%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=BZ0Y1nBfQ%2Fs0DRm6j5ksuIJ7s1c4RA9dN2YqykbDYoM%3D&reserved=0>
>>     Send bugs reports to https://github.com/csound/csound/issues
>>     <https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcsound%2Fcsound%2Fissues&data=04%7C01%7CVictor.Lazzarini%40mu.ie%7C22103c2781a243bbcf9e08d9423ba4ec%7C1454f5ccbb354685bbd98621fd8055c9%7C1%7C1%7C637613646226988236%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=yPK97vfvQedi3Kv9EpMUq5M1bYxzarL4gHRYPKL5R78%3D&reserved=0>
>>     Discussions of bugs and features can be posted here
>>     <test5.csd>
>     Csound mailing list Csound@listserv.heanet.ie
>     <mailto:Csound@listserv.heanet.ie>
>     https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>     <https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND> Send bugs reports
>     to https://github.com/csound/csound/issues
>     <https://github.com/csound/csound/issues> Discussions of bugs and
>     features can be posted here
>
> Csound mailing list Csound@listserv.heanet.ie
> <mailto:Csound@listserv.heanet.ie>
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> <https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND> Send bugs reports to
> https://github.com/csound/csound/issues
> <https://github.com/csound/csound/issues> Discussions of bugs and
> features can be posted here

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
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