Csound Csound-dev Csound-tekno Search About

[Csnd] Some array issues

Date2023-10-09 18:58
FromBernt Isak Wærstad
Subject[Csnd] Some array issues
Helloo!

I'm having a couple of array issues that I think might be bugs, but wanted to check if I'm doing something wrong before filing an issue. I'm running Csound 6.18 from November 2022 (commit a1580f9cdf331c35dceb486f4231871ce0b00266). 

First is an issue with using the fillarray opcode in a functional way with 2d arrays:

This works:
giArr[][] init 2,3
giArr fillarray 1, 2, 3, -1, -2, -3

but this doesnt:
giArr[][] init 2,3
giArr = fillarray(1, 2, 3, -1, -2, -3)

producing the error: 
INIT ERROR in instr 0 (opcode =.J) line 14: array-variable dimensions do not match 

The other issue is that printarray doesn't work in i-time on string-arrays. Like Joachims example 03E04 from the Floss manual under arrays (https://flossmanual.csound.com/csound-language/arrays) - it prints the number of files, but not the name of the files (the array with the strings):

<CsoundSynthesizer>
<CsOptions>
-odac -d
</CsOptions>
<CsInstruments>

sr = 44100
ksmps = 32
nchnls = 2
0dbfs = 1

instr Files
 S_array[] directory "."
 iNumFiles lenarray S_array
 prints "Number of files in %s = %d\n", pwd(), iNumFiles
 printarray S_array
endin

</CsInstruments>
<CsScore>
i "Files" 0 0
</CsScore>
</CsoundSynthesizer>
;example by joachim heintz


 --
Mvh.

Bernt Isak Wærstad


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

Date2023-10-09 21:44
Fromjoachim heintz
SubjectRe: [Csnd] Some array issues
i can confirm that the floss manual example does not give any output for 
the string array for me either.  i think it did before.


On 09/10/2023 19:58, Bernt Isak Wærstad wrote:
> Helloo!
> 
> I'm having a couple of array issues that I think might be bugs, but 
> wanted to check if I'm doing something wrong before filing an issue. I'm 
> running Csound 6.18 from November 2022 (commit 
> a1580f9cdf331c35dceb486f4231871ce0b00266).
> 
> First is an issue with using the *fillarray* opcode in a functional way 
> with 2d arrays:
> 
> This works:
> giArr[][] init 2,3
> giArr fillarray 1, 2, 3, -1, -2, -3
> 
> but this doesnt:
> giArr[][] init 2,3
> giArr = fillarray(1, 2, 3, -1, -2, -3)
> 
> producing the error:
> INIT ERROR in instr 0 (opcode =.J) line 14: array-variable dimensions do 
> not match
> 
> The other issue is that *printarray* doesn't work in i-time on 
> string-arrays. Like Joachims example 03E04 from the Floss manual under 
> arrays (https://flossmanual.csound.com/csound-language/arrays 
> ) - it prints the 
> number of files, but not the name of the files (the array with the strings):
> 
> 
> 
> -odac -d
> 
> 
> 
> sr = 44100
> ksmps = 32
> nchnls = 2
> 0dbfs = 1
> 
> instr Files
>   S_array[] directory "."
>   iNumFiles lenarray S_array
>   prints "Number of files in %s = %d\n", pwd(), iNumFiles
>   printarray S_array
> endin
> 
> 
> 
> i "Files" 0 0
> 
> 
> ;example by joachim heintz
> 
> 
>   --
> Mvh.
> 
> Bernt Isak Wærstad
> 
> 
> 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

Date2023-10-10 12:20
FromVictor Lazzarini
SubjectRe: [Csnd] [EXTERNAL] [Csnd] Some array issues
I think the first issue is a limitation of the current parser, and as we are moving to a new parser in Csound 7, I don’t think we will do anything about it. No improvements to 6.x, only bugfixes.

The second seems to be a bona fide bug, can you open a ticket? We can look into it.
========================
Prof. Victor Lazzarini
Maynooth University
Ireland

> On 9 Oct 2023, at 18:58, Bernt Isak Wærstad  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.
> Helloo! 
> 
> I'm having a couple of array issues that I think might be bugs, but wanted to check if I'm doing something wrong before filing an issue. I'm running Csound 6.18 from November 2022 (commit a1580f9cdf331c35dceb486f4231871ce0b00266). 
> 
> First is an issue with using the fillarray opcode in a functional way with 2d arrays:
> 
> This works:
> giArr[][] init 2,3
> giArr fillarray 1, 2, 3, -1, -2, -3
> 
> but this doesnt:
> giArr[][] init 2,3
> giArr = fillarray(1, 2, 3, -1, -2, -3)
> 
> producing the error: 
> INIT ERROR in instr 0 (opcode =.J) line 14: array-variable dimensions do not match  
> The other issue is that printarray doesn't work in i-time on string-arrays. Like Joachims example 03E04 from the Floss manual under arrays (https://flossmanual.csound.com/csound-language/arrays) - it prints the number of files, but not the name of the files (the array with the strings):
> 
> 
> 
> -odac -d
> 
> 
> 
> sr = 44100
> ksmps = 32
> nchnls = 2
> 0dbfs = 1
> 
> instr Files
>  S_array[] directory "."
>  iNumFiles lenarray S_array
>  prints "Number of files in %s = %d\n", pwd(), iNumFiles
>  printarray S_array
> endin
> 
> 
> 
> i "Files" 0 0
> 
> 
> ;example by joachim heintz
> 
> 
>  -- 
> Mvh. 
> 
> Bernt Isak Wærstad
> 
> 
> 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

Date2023-10-10 16:54
FromST Music
SubjectRe: [Csnd] [EXTERNAL] [Csnd] Some array issues
printarray using strings works fine for me provided the score duration is not 0

Try changing that.

On Tue, Oct 10, 2023, 7:21 a.m. Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
I think the first issue is a limitation of the current parser, and as we are moving to a new parser in Csound 7, I don’t think we will do anything about it. No improvements to 6.x, only bugfixes.

The second seems to be a bona fide bug, can you open a ticket? We can look into it.
========================
Prof. Victor Lazzarini
Maynooth University
Ireland

> On 9 Oct 2023, at 18:58, Bernt Isak Wærstad <berntisak@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.
> Helloo!
>
> I'm having a couple of array issues that I think might be bugs, but wanted to check if I'm doing something wrong before filing an issue. I'm running Csound 6.18 from November 2022 (commit a1580f9cdf331c35dceb486f4231871ce0b00266).
>
> First is an issue with using the fillarray opcode in a functional way with 2d arrays:
>
> This works:
> giArr[][] init 2,3
> giArr fillarray 1, 2, 3, -1, -2, -3
>
> but this doesnt:
> giArr[][] init 2,3
> giArr = fillarray(1, 2, 3, -1, -2, -3)
>
> producing the error:
> INIT ERROR in instr 0 (opcode =.J) line 14: array-variable dimensions do not match 
> The other issue is that printarray doesn't work in i-time on string-arrays. Like Joachims example 03E04 from the Floss manual under arrays (https://flossmanual.csound.com/csound-language/arrays) - it prints the number of files, but not the name of the files (the array with the strings):
>
> <CsoundSynthesizer>
> <CsOptions>
> -odac -d
> </CsOptions>
> <CsInstruments>
>
> sr = 44100
> ksmps = 32
> nchnls = 2
> 0dbfs = 1
>
> instr Files
>  S_array[] directory "."
>  iNumFiles lenarray S_array
>  prints "Number of files in %s = %d\n", pwd(), iNumFiles
>  printarray S_array
> endin
>
> </CsInstruments>
> <CsScore>
> i "Files" 0 0
> </CsScore>
> </CsoundSynthesizer>
> ;example by joachim heintz
>
>
>  --
> Mvh.
>
> Bernt Isak Wærstad
>
>
> 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

Date2023-10-10 17:17
Fromjohn
SubjectRe: [Csnd] [EXTERNAL] [Csnd] Some array issues
There sno code to prinrt a styring array at i-time sas far as ~I can tell. 
This is Eduaro's problem.  The ony case of printarray that matches the 
line in 03E04.csd  (" printarray S_array") is

     { "printarray", S(ARRAYPRINTK), 0, 3, "", "S[]J",
       (SUBR)arrayprint_init, (SUBR)arrayprint_perf},
and arrayprint_init prepares for a k-rate call.

This could be a manual issie but a printarray for strings at i-time would 
brre useful.

==John ff

On Tue, 10 Oct 2023, Victor Lazzarini wrote:

> I think the first issue is a limitation of the current parser, and as we are moving to a new parser in Csound 7, I don’t think we will do anything about it. No improvements to 6.x, only bugfixes.
>
> The second seems to be a bona fide bug, can you open a ticket? We can look into it.
> ========================
> Prof. Victor Lazzarini
> Maynooth University
> Ireland
>
>> On 9 Oct 2023, at 18:58, Bernt Isak Wærstad  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.
>> Helloo!
>>
>> I'm having a couple of array issues that I think might be bugs, but wanted to check if I'm doing something wrong before filing an issue. I'm running Csound 6.18 from November 2022 (commit a1580f9cdf331c35dceb486f4231871ce0b00266).
>>
>> First is an issue with using the fillarray opcode in a functional way with 2d arrays:
>>
>> This works:
>> giArr[][] init 2,3
>> giArr fillarray 1, 2, 3, -1, -2, -3
>>
>> but this doesnt:
>> giArr[][] init 2,3
>> giArr = fillarray(1, 2, 3, -1, -2, -3)
>>
>> producing the error:
>> INIT ERROR in instr 0 (opcode =.J) line 14: array-variable dimensions do not match
>> The other issue is that printarray doesn't work in i-time on string-arrays. Like Joachims example 03E04 from the Floss manual under arrays (https://flossmanual.csound.com/csound-language/arrays) - it prints the number of files, but not the name of the files (the array with the strings):
>>
>> 
>> 
>> -odac -d
>> 
>> 
>>
>> sr = 44100
>> ksmps = 32
>> nchnls = 2
>> 0dbfs = 1
>>
>> instr Files
>>  S_array[] directory "."
>>  iNumFiles lenarray S_array
>>  prints "Number of files in %s = %d\n", pwd(), iNumFiles
>>  printarray S_array
>> endin
>>
>> 
>> 
>> i "Files" 0 0
>> 
>> 
>> ;example by joachim heintz
>>
>>
>>  --
>> Mvh.
>>
>> Bernt Isak Wærstad
>>
>>
>> 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

Date2023-10-11 23:22
FromBernt Isak Wærstad
SubjectRe: [Csnd] [EXTERNAL] [Csnd] Some array issues
First issue is not a big problem, but maybe fillarray should have a note in the manual regarding its limitation in functional syntax?  

I have opened a ticket for the second issue. I guess it must have been working before somehow since Joachim has used it in his example.

ST: yes, but the problem is that its not running in init time. When the score is bigger than 0, it can run in perf time.  

On Tue, Oct 10, 2023 at 6:17 PM john <jpff@codemist.co.uk> wrote:
There sno code to prinrt a styring array at i-time sas far as ~I can tell.
This is Eduaro's problem.  The ony case of printarray that matches the
line in 03E04.csd  (" printarray S_array") is

     { "printarray", S(ARRAYPRINTK), 0, 3, "", "S[]J",
       (SUBR)arrayprint_init, (SUBR)arrayprint_perf},
and arrayprint_init prepares for a k-rate call.

This could be a manual issie but a printarray for strings at i-time would
brre useful.

==John ff

On Tue, 10 Oct 2023, Victor Lazzarini wrote:

> I think the first issue is a limitation of the current parser, and as we are moving to a new parser in Csound 7, I don’t think we will do anything about it. No improvements to 6.x, only bugfixes.
>
> The second seems to be a bona fide bug, can you open a ticket? We can look into it.
> ========================
> Prof. Victor Lazzarini
> Maynooth University
> Ireland
>
>> On 9 Oct 2023, at 18:58, Bernt Isak Wærstad <berntisak@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.
>> Helloo!
>>
>> I'm having a couple of array issues that I think might be bugs, but wanted to check if I'm doing something wrong before filing an issue. I'm running Csound 6.18 from November 2022 (commit a1580f9cdf331c35dceb486f4231871ce0b00266).
>>
>> First is an issue with using the fillarray opcode in a functional way with 2d arrays:
>>
>> This works:
>> giArr[][] init 2,3
>> giArr fillarray 1, 2, 3, -1, -2, -3
>>
>> but this doesnt:
>> giArr[][] init 2,3
>> giArr = fillarray(1, 2, 3, -1, -2, -3)
>>
>> producing the error:
>> INIT ERROR in instr 0 (opcode =.J) line 14: array-variable dimensions do not match
>> The other issue is that printarray doesn't work in i-time on string-arrays. Like Joachims example 03E04 from the Floss manual under arrays (https://flossmanual.csound.com/csound-language/arrays) - it prints the number of files, but not the name of the files (the array with the strings):
>>
>> <CsoundSynthesizer>
>> <CsOptions>
>> -odac -d
>> </CsOptions>
>> <CsInstruments>
>>
>> sr = 44100
>> ksmps = 32
>> nchnls = 2
>> 0dbfs = 1
>>
>> instr Files
>>  S_array[] directory "."
>>  iNumFiles lenarray S_array
>>  prints "Number of files in %s = %d\n", pwd(), iNumFiles
>>  printarray S_array
>> endin
>>
>> </CsInstruments>
>> <CsScore>
>> i "Files" 0 0
>> </CsScore>
>> </CsoundSynthesizer>
>> ;example by joachim heintz
>>
>>
>>  --
>> Mvh.
>>
>> Bernt Isak Wærstad
>>
>>
>> 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


--
Mvh.

Bernt Isak Wærstad


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

Date2023-10-12 01:52
FromST Music
SubjectRe: [Csnd] [EXTERNAL] [Csnd] Some array issues
I getcha, thanks for the clarification Bernt. I'm sure there are legitimate reasons for one wanting printarray S at init time that elude me; as the array itself is functional at init I guess I've never had an issue with waiting 1 k-cycle for it to print.

On Wed, Oct 11, 2023, 6:23 p.m. Bernt Isak Wærstad <berntisak@gmail.com> wrote:
First issue is not a big problem, but maybe fillarray should have a note in the manual regarding its limitation in functional syntax?  

I have opened a ticket for the second issue. I guess it must have been working before somehow since Joachim has used it in his example.

ST: yes, but the problem is that its not running in init time. When the score is bigger than 0, it can run in perf time.  

On Tue, Oct 10, 2023 at 6:17 PM john <jpff@codemist.co.uk> wrote:
There sno code to prinrt a styring array at i-time sas far as ~I can tell.
This is Eduaro's problem.  The ony case of printarray that matches the
line in 03E04.csd  (" printarray S_array") is

     { "printarray", S(ARRAYPRINTK), 0, 3, "", "S[]J",
       (SUBR)arrayprint_init, (SUBR)arrayprint_perf},
and arrayprint_init prepares for a k-rate call.

This could be a manual issie but a printarray for strings at i-time would
brre useful.

==John ff

On Tue, 10 Oct 2023, Victor Lazzarini wrote:

> I think the first issue is a limitation of the current parser, and as we are moving to a new parser in Csound 7, I don’t think we will do anything about it. No improvements to 6.x, only bugfixes.
>
> The second seems to be a bona fide bug, can you open a ticket? We can look into it.
> ========================
> Prof. Victor Lazzarini
> Maynooth University
> Ireland
>
>> On 9 Oct 2023, at 18:58, Bernt Isak Wærstad <berntisak@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.
>> Helloo!
>>
>> I'm having a couple of array issues that I think might be bugs, but wanted to check if I'm doing something wrong before filing an issue. I'm running Csound 6.18 from November 2022 (commit a1580f9cdf331c35dceb486f4231871ce0b00266).
>>
>> First is an issue with using the fillarray opcode in a functional way with 2d arrays:
>>
>> This works:
>> giArr[][] init 2,3
>> giArr fillarray 1, 2, 3, -1, -2, -3
>>
>> but this doesnt:
>> giArr[][] init 2,3
>> giArr = fillarray(1, 2, 3, -1, -2, -3)
>>
>> producing the error:
>> INIT ERROR in instr 0 (opcode =.J) line 14: array-variable dimensions do not match
>> The other issue is that printarray doesn't work in i-time on string-arrays. Like Joachims example 03E04 from the Floss manual under arrays (https://flossmanual.csound.com/csound-language/arrays) - it prints the number of files, but not the name of the files (the array with the strings):
>>
>> <CsoundSynthesizer>
>> <CsOptions>
>> -odac -d
>> </CsOptions>
>> <CsInstruments>
>>
>> sr = 44100
>> ksmps = 32
>> nchnls = 2
>> 0dbfs = 1
>>
>> instr Files
>>  S_array[] directory "."
>>  iNumFiles lenarray S_array
>>  prints "Number of files in %s = %d\n", pwd(), iNumFiles
>>  printarray S_array
>> endin
>>
>> </CsInstruments>
>> <CsScore>
>> i "Files" 0 0
>> </CsScore>
>> </CsoundSynthesizer>
>> ;example by joachim heintz
>>
>>
>>  --
>> Mvh.
>>
>> Bernt Isak Wærstad
>>
>>
>> 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


--
Mvh.

Bernt Isak Wærstad


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

Date2023-10-12 06:48
FromVictor Lazzarini
SubjectRe: [Csnd] [EXTERNAL] [Csnd] Some array issues
I agree it should be documented, but I also note that this is not limited to one opcode. I don't think there is a way to add type annotations to indicate a multidimensional array in Csound 6. 

Steven might be able to clarify this.

Prof. Victor Lazzarini
Maynooth University
Ireland

On 11 Oct 2023, at 23:23, Bernt Isak Wærstad <berntisak@gmail.com> wrote:


First issue is not a big problem, but maybe fillarray should have a note in the manual regarding its limitation in functional syntax?  

I have opened a ticket for the second issue. I guess it must have been working before somehow since Joachim has used it in his example.

ST: yes, but the problem is that its not running in init time. When the score is bigger than 0, it can run in perf time.  

On Tue, Oct 10, 2023 at 6:17 PM john <jpff@codemist.co.uk> wrote:
There sno code to prinrt a styring array at i-time sas far as ~I can tell.
This is Eduaro's problem.  The ony case of printarray that matches the
line in 03E04.csd  (" printarray S_array") is

     { "printarray", S(ARRAYPRINTK), 0, 3, "", "S[]J",
       (SUBR)arrayprint_init, (SUBR)arrayprint_perf},
and arrayprint_init prepares for a k-rate call.

This could be a manual issie but a printarray for strings at i-time would
brre useful.

==John ff

On Tue, 10 Oct 2023, Victor Lazzarini wrote:

> I think the first issue is a limitation of the current parser, and as we are moving to a new parser in Csound 7, I don’t think we will do anything about it. No improvements to 6.x, only bugfixes.
>
> The second seems to be a bona fide bug, can you open a ticket? We can look into it.
> ========================
> Prof. Victor Lazzarini
> Maynooth University
> Ireland
>
>> On 9 Oct 2023, at 18:58, Bernt Isak Wærstad <berntisak@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.
>> Helloo!
>>
>> I'm having a couple of array issues that I think might be bugs, but wanted to check if I'm doing something wrong before filing an issue. I'm running Csound 6.18 from November 2022 (commit a1580f9cdf331c35dceb486f4231871ce0b00266).
>>
>> First is an issue with using the fillarray opcode in a functional way with 2d arrays:
>>
>> This works:
>> giArr[][] init 2,3
>> giArr fillarray 1, 2, 3, -1, -2, -3
>>
>> but this doesnt:
>> giArr[][] init 2,3
>> giArr = fillarray(1, 2, 3, -1, -2, -3)
>>
>> producing the error:
>> INIT ERROR in instr 0 (opcode =.J) line 14: array-variable dimensions do not match
>> The other issue is that printarray doesn't work in i-time on string-arrays. Like Joachims example 03E04 from the Floss manual under arrays (https://flossmanual.csound.com/csound-language/arrays) - it prints the number of files, but not the name of the files (the array with the strings):
>>
>> <CsoundSynthesizer>
>> <CsOptions>
>> -odac -d
>> </CsOptions>
>> <CsInstruments>
>>
>> sr = 44100
>> ksmps = 32
>> nchnls = 2
>> 0dbfs = 1
>>
>> instr Files
>>  S_array[] directory "."
>>  iNumFiles lenarray S_array
>>  prints "Number of files in %s = %d\n", pwd(), iNumFiles
>>  printarray S_array
>> endin
>>
>> </CsInstruments>
>> <CsScore>
>> i "Files" 0 0
>> </CsScore>
>> </CsoundSynthesizer>
>> ;example by joachim heintz
>>
>>
>>  --
>> Mvh.
>>
>> Bernt Isak Wærstad
>>
>>
>> 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


--
Mvh.

Bernt Isak Wærstad


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

Date2023-10-14 19:58
FromSteven Yi
SubjectRe: [Csnd] [EXTERNAL] [Csnd] Some array issues
I think there's a problem with type annotation for arrays and function return types in CS6. I want to say Hlodver had worked on something like this in a PR on CS7 but he'd have to chime in. 

On Thu, Oct 12, 2023 at 1:48 AM Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
I agree it should be documented, but I also note that this is not limited to one opcode. I don't think there is a way to add type annotations to indicate a multidimensional array in Csound 6. 

Steven might be able to clarify this.

Prof. Victor Lazzarini
Maynooth University
Ireland

On 11 Oct 2023, at 23:23, Bernt Isak Wærstad <berntisak@gmail.com> wrote:


First issue is not a big problem, but maybe fillarray should have a note in the manual regarding its limitation in functional syntax?  

I have opened a ticket for the second issue. I guess it must have been working before somehow since Joachim has used it in his example.

ST: yes, but the problem is that its not running in init time. When the score is bigger than 0, it can run in perf time.  

On Tue, Oct 10, 2023 at 6:17 PM john <jpff@codemist.co.uk> wrote:
There sno code to prinrt a styring array at i-time sas far as ~I can tell.
This is Eduaro's problem.  The ony case of printarray that matches the
line in 03E04.csd  (" printarray S_array") is

     { "printarray", S(ARRAYPRINTK), 0, 3, "", "S[]J",
       (SUBR)arrayprint_init, (SUBR)arrayprint_perf},
and arrayprint_init prepares for a k-rate call.

This could be a manual issie but a printarray for strings at i-time would
brre useful.

==John ff

On Tue, 10 Oct 2023, Victor Lazzarini wrote:

> I think the first issue is a limitation of the current parser, and as we are moving to a new parser in Csound 7, I don’t think we will do anything about it. No improvements to 6.x, only bugfixes.
>
> The second seems to be a bona fide bug, can you open a ticket? We can look into it.
> ========================
> Prof. Victor Lazzarini
> Maynooth University
> Ireland
>
>> On 9 Oct 2023, at 18:58, Bernt Isak Wærstad <berntisak@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.
>> Helloo!
>>
>> I'm having a couple of array issues that I think might be bugs, but wanted to check if I'm doing something wrong before filing an issue. I'm running Csound 6.18 from November 2022 (commit a1580f9cdf331c35dceb486f4231871ce0b00266).
>>
>> First is an issue with using the fillarray opcode in a functional way with 2d arrays:
>>
>> This works:
>> giArr[][] init 2,3
>> giArr fillarray 1, 2, 3, -1, -2, -3
>>
>> but this doesnt:
>> giArr[][] init 2,3
>> giArr = fillarray(1, 2, 3, -1, -2, -3)
>>
>> producing the error:
>> INIT ERROR in instr 0 (opcode =.J) line 14: array-variable dimensions do not match
>> The other issue is that printarray doesn't work in i-time on string-arrays. Like Joachims example 03E04 from the Floss manual under arrays (https://flossmanual.csound.com/csound-language/arrays) - it prints the number of files, but not the name of the files (the array with the strings):
>>
>> <CsoundSynthesizer>
>> <CsOptions>
>> -odac -d
>> </CsOptions>
>> <CsInstruments>
>>
>> sr = 44100
>> ksmps = 32
>> nchnls = 2
>> 0dbfs = 1
>>
>> instr Files
>>  S_array[] directory "."
>>  iNumFiles lenarray S_array
>>  prints "Number of files in %s = %d\n", pwd(), iNumFiles
>>  printarray S_array
>> endin
>>
>> </CsInstruments>
>> <CsScore>
>> i "Files" 0 0
>> </CsScore>
>> </CsoundSynthesizer>
>> ;example by joachim heintz
>>
>>
>>  --
>> Mvh.
>>
>> Bernt Isak Wærstad
>>
>>
>> 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


--
Mvh.

Bernt Isak Wærstad


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