Csound Csound-dev Csound-tekno Search About

[Csnd] Can an UDO use an optionsl array (issues)

Date2024-04-22 01:08
FromScott Daughtrey
Subject[Csnd] Can an UDO use an optionsl array (issues)
I'm trying to use an array input as an optional parameter. Take for example:

opcode test, 0, i[]
  iArr[] xin
  printarray iArr
endop

instr 1
  iArr[] fillarray 1, 2, 3, 4
  test iArr
endin

If o[] or j[] are used, Csound freezes (Android app). If p[] is used Csound runs but gives the following error:

invalid xin statement for UDO: defined 'p[]', found 'i[]'

Best,
Scott

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

Date2024-04-22 01:28
Fromthorin kerr
SubjectRe: [Csnd] Can an UDO use an optionsl array (issues)
Write two UDO's with the same name: One udo with an array input in the argument definition, and one without. Csound should select the one to use when given the matching arguments.



On Mon, 22 Apr 2024, 10:08 am Scott Daughtrey, <stunes6556@gmail.com> wrote:
I'm trying to use an array input as an optional parameter. Take for example:

opcode test, 0, i[]
  iArr[] xin
  printarray iArr
endop

instr 1
  iArr[] fillarray 1, 2, 3, 4
  test iArr
endin

If o[] or j[] are used, Csound freezes (Android app). If p[] is used Csound runs but gives the following error:

invalid xin statement for UDO: defined 'p[]', found 'i[]'

Best,
Scott

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

Date2024-04-22 01:38
FromST Music
SubjectRe: [Csnd] Can an UDO use an optionsl array (issues)
Thanks Thorin.Now I recall hearing that before, should do the trick.

Best,
Scott

On Sun, Apr 21, 2024, 8:28 p.m. thorin kerr <thorin.kerr@gmail.com> wrote:
Write two UDO's with the same name: One udo with an array input in the argument definition, and one without. Csound should select the one to use when given the matching arguments.



On Mon, 22 Apr 2024, 10:08 am Scott Daughtrey, <stunes6556@gmail.com> wrote:
I'm trying to use an array input as an optional parameter. Take for example:

opcode test, 0, i[]
  iArr[] xin
  printarray iArr
endop

instr 1
  iArr[] fillarray 1, 2, 3, 4
  test iArr
endin

If o[] or j[] are used, Csound freezes (Android app). If p[] is used Csound runs but gives the following error:

invalid xin statement for UDO: defined 'p[]', found 'i[]'

Best,
Scott

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