For the OENTRY of a 2D array opcode, should you be using [[k] to specify the argument as a 2D array?


-- 
Edward Costello

On Thursday 11 July 2013 at 10:35, Edward Costello wrote:

Hmmm, the opcode I had written that was working doesn't work anymore now, I get a :

csound(6990) malloc: *** error for object 0x7fc5934c1020: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug

Every time I use it now, that wasn't present in earlier builds. I commented every line of code out from my the functions used in the opcode and just left them as skeletons without any processing whatsoever and I still get the same error.

Also I tried doing this:

instr 1, Init

    kArr1[][] init 10, 2
    kArr2[][] init 10, 2
    kArr3[][] init 10, 2


    kArr3 = kArr2 + kArr1
    turnoff
endin

And you get the error:

INIT ERROR in instr 1: Dimensions do not match in array arithmetic
#k0[] ##add.[] kArr2 kArr1

-- 
Edward Costello

On Thursday 11 July 2013 at 01:36, Steven Yi wrote:

Hey Ed,

Thanks for reporting that. The test CSD used during development used the same sizes for the different dimensions so that issue wasn't caught. I committed a fix we the an updated test. Could you try building from git and seeing if it's working now there?

Thanks!
Steven

P.s. - I think you get the prize for the first bug reported for Csound 6.0. :)

On Jul 10, 2013 5:13 PM, "Edward Costello" <edwardcostello@gmail.com> wrote:
Yeah I thought that was ok. It seems though that both dimensions are being set to the value in the first dimension. This code for instance gives an error:


instr 1, Init

    kArr1[][] init 5,10

    kIndx = 0

    until kIndx == 10 do
        
        kArr1[4][kIndx] = kIndx

        kIndx += 1
    od
    

    turnoff
endin


-- 
Edward Costello

On Wednesday 10 July 2013 at 22:30, Steven Yi wrote:

Hi Ed,

That's mostly right. The int dimensions is the number of dimensions,
and the sizes are essentially an int array that marks the sizes of
each dimension. So if you had an array of:

karray1[][][] init 3, 4, 5

that'd have 3 dimensions, with sizes 3, 4, and 5, and you could index
into the last element using:

karray1[2][3][4]

If you wanted a 2d array with 10 rows, and 3 columns, you could do:

karray1[][] init 10, 3

which would have 2 dimensions, with sizes[0] == 10, and sizes[1] == 3.

So you can use the dimensions member of the struct to check how much
you can index into the sizes array.

Hope that helps!
steven

On Wed, Jul 10, 2013 at 3:45 PM, Edward Costello
Hi,

I am testing out making some opcodes using arrays and I was just wondering
if I understand the ARRAYDAT structure correctly. Does the sizes pointer
give the row and column dimensions? i.e. array->sizes[0] is the rows and
array->sizes[1] the columns?

If I make a score that has kArr[][] init 10,11 in it I get 10 for both
sizes[0] and sizes[1].


--
Edward Costello


------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
_______________________________________________
Csound-devel mailing list

------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
_______________________________________________
Csound-devel mailing list


------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-devel

------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
_______________________________________________
Csound-devel mailing list