[Csnd] change k-array to i-array and vice versa?

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Csnd] change k-array to i-array and vice versa?

joachim-3
we have i(kval) and k(ival) for numbers,
and we have strcpyk for strings.

is there a way that i could change a k-array to an i-array and vice versa?

thanks -
        joachim

Csound mailing list
[hidden email]
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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] change k-array to i-array and vice versa?

jpff
do you want a copy made, or the same object? Aggregate things are not like
single values


On Fri, 21 Jul 2017, joachim heintz wrote:

> we have i(kval) and k(ival) for numbers,
> and we have strcpyk for strings.
>
> is there a way that i could change a k-array to an i-array and vice versa?
>
> thanks -
> joachim
>
> Csound mailing list
> [hidden email]
> 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
[hidden email]
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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] change k-array to i-array and vice versa?

joachim-3
i mean a copy, like

  kArr[] fillarray 1, 2, 3, 4, 5
  iArr[] fillarray 6, 7, 8, 9, 0
and then either
  iArr = kArr ;copy kArr at i-time to iArr
or
  kArr = iArr ;copy iArr during performance to kArr

currently the = operator does only work for same type, like
  iArr1[] fillarray 1, 2, 3, 4, 5
  iArr2[] fillarray 6, 7, 8, 9, 0
  iArr2 = iArr1



On 21/07/17 20:48, jpff wrote:

> do you want a copy made, or the same object? Aggregate things are not
> like single values
>
>
> On Fri, 21 Jul 2017, joachim heintz wrote:
>
>> we have i(kval) and k(ival) for numbers,
>> and we have strcpyk for strings.
>>
>> is there a way that i could change a k-array to an i-array and vice
>> versa?
>>
>> thanks -
>>     joachim
>>
>> Csound mailing list
>> [hidden email]
>> 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
> [hidden email]
> 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
[hidden email]
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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] change k-array to i-array and vice versa?

jpff
I ave a version that does this but i think it opes up more bugs

i[] = k[]
is OK ad safe, but the other is not. Will think about it.....string arras....etc

On Fri, 21 Jul 2017, joachim heintz wrote:

> i mean a copy, like
>
> kArr[] fillarray 1, 2, 3, 4, 5
> iArr[] fillarray 6, 7, 8, 9, 0
> and then either
> iArr = kArr ;copy kArr at i-time to iArr
> or
> kArr = iArr ;copy iArr during performance to kArr
>
> currently the = operator does only work for same type, like
> iArr1[] fillarray 1, 2, 3, 4, 5
> iArr2[] fillarray 6, 7, 8, 9, 0
> iArr2 = iArr1
>
>
>
> On 21/07/17 20:48, jpff wrote:
>> do you want a copy made, or the same object? Aggregate things are not
>> like single values
>>
>>
>> On Fri, 21 Jul 2017, joachim heintz wrote:
>>
>>> we have i(kval) and k(ival) for numbers,
>>> and we have strcpyk for strings.
>>>
>>> is there a way that i could change a k-array to an i-array and vice
>>> versa?
>>>
>>> thanks -
>>>     joachim
>>>
>>> Csound mailing list
>>> [hidden email]
>>> 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
>> [hidden email]
>> 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
> [hidden email]
> 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
[hidden email]
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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] change k-array to i-array and vice versa?

joachim-3
In reply to this post by joachim-3
wonderful.  it works without any problems.

i have committed a test for all i-k-cases:
https://github.com/csound/csound/blob/develop/tests/commandline/arrays/array_copy.csd

maybe you can have a look whether this is ok for you.

thanks and best -
        joachim


On 21/07/17 22:42, jpff wrote:
> I ave a safer ersio wic I will commit for you to try
>
>
>

Csound mailing list
[hidden email]
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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] change k-array to i-array and vice versa?

jpff
I hope that cases like
Sarr = iarr
still fail


Sent from TypeApp
On 22 Jul 2017, at 08:44, joachim heintz <[hidden email]> wrote:
wonderful.  it works without any problems.

i have committed a test for all i-k-cases:
https://github.com/csound/csound/blob/develop/tests/commandline/arrays/array_copy.csd

maybe you can have a look whether this is ok for you.

thanks and best -
joachim


On 21/07/17 22:42, jpff wrote:
I ave a safer ersio wic I will commit for you to try




Csound mailing list
[hidden email]
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 [hidden email] 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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] change k-array to i-array and vice versa?

joachim-3
i did not think about it but i tried:

instr huu
  iArrSrc[] fillarray 1, 2, 3, 4, 5
  SArrCpy[] init 5
  SArrCpy = iArrSrc
endin

and the output looks good:

new alloc for instr huu:
INIT ERROR in instr 2: array-variable types do not match
SArrCpy =._ iArrSrc
          B  0.000 - note deleted.  i2 (huu) had 1 init errors


huuu -
        j



On 22/07/17 17:39, John ff wrote:

> I hope that cases like
> Sarr = iarr
> still fail
>
>
> Sent from TypeApp <http://www.typeapp.com/r?b=10189>
> On 22 Jul 2017, at 08:44, joachim heintz <[hidden email]
> <mailto:[hidden email]>> wrote:
>
>     wonderful.  it works without any problems.
>
>     i have committed a test for all i-k-cases:
>     https://github.com/csound/csound/blob/develop/tests/commandline/arrays/array_copy.csd
>
>     maybe you can have a look whether this is ok for you.
>
>     thanks and best -
>      joachim
>
>
>     On 21/07/17 22:42, jpff wrote:
>
>         I ave a safer ersio wic I will commit for you to try
>
>
>
>
>
>     Csound mailing list
>     [hidden email]
>     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 [hidden email]
> <mailto:[hidden email]>
> 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
[hidden email]
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
Loading...