On Friday 19 July 2013 at 23:03, Steven Yi wrote:
Hi Ed,Having reusable array utility functions sounds handy. Maybe it'sworth prototyping API functions here on the list?As for the dimensions, yeah, that's what my other email from a fewdays ago was all about. I think right now the semantic analyzerallows for any dimension array to match against an array argspecifier. My proposal was to make k[] only match one dimensionk-arrays, and k[][] to only match against two-dimension k-arrays, etc.No one has really replied to that other email and I've beenpre-occupied with other work; I'll probably go and implement theproposal once I'm finished with the other work.Thanks!stevenOn Fri, Jul 19, 2013 at 8:07 AM, Edward Costello<edwardcostello@gmail.com> wrote:Thanks Steven,Yeah on closer inspection I noticed those functions were static, so yeahI'll have a look and just emulate what is being done in those functions.So am I right in thinking that generally, as it is supported now, all arraysneed to be initialised using the init opcode before usage? It would be niceto have an array initialiser built in to the api, for things like writingopcodes like diskin opening samples to an array output, without having toquery how many samples are in the file etc. or things like matrix to matrixmultiplication where an output with the correct dimensions is automaticallygenerated.Another thing I am confused about is the opcode arguments for array opcodes,does "k[]" mean a one dimensional argument and "k[][]" mean a 2 dimensional?You can use a one dimensional array on an argument that takes a "k[][]" andvice-versa and no error is reported.--Edward CostelloOn Thursday 18 July 2013 at 18:45, Steven Yi wrote:Hi Ed,I think the ARRAYDAT should already be created by the compiler by thetime you see it in your opcode. However, it's dimensions and data maynot be initialized, which you may need to then modify yourself. I'mnot sure about needing a deinit callback. I don't know what thestandard practice is for freeing up memory for variables; perhaps weneed to add a var_free function to CS_TYPE to automatically handlethat...Otherwise, I'd look at Opcodes/arrays.c and use the functions Johnwrote as a model.Good luck!stevenOn Wed, Jul 17, 2013 at 10:06 AM, Edward Costello<edwardcostello@gmail.com> wrote:Hi,When creating a custom array opcode, for instance one that takes 2 arrays asinput and give 1 array as output, in the initialisation function for theopcode, when creating the output array does one create an ARRAYINIT structand pass that to the array_init function? Conversely is there a need to callthe array_del function from a RegisterDeinitCallback?Thanks--Edward Costello------------------------------------------------------------------------------See everything from the browser to the database with AppDynamicsGet end-to-end visibility with application monitoring from AppDynamicsIsolate 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 AppDynamicsGet end-to-end visibility with application monitoring from AppDynamicsIsolate 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 AppDynamicsGet end-to-end visibility with application monitoring from AppDynamicsIsolate 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 AppDynamicsGet end-to-end visibility with application monitoring from AppDynamicsIsolate bottlenecks and diagnose root cause in seconds.Start your free trial of AppDynamics Pro today!_______________________________________________Csound-devel mailing list