| Hi,
Now it makes sense, thanks for your answer.
Cheers,
Andrés
On Mon, Mar 18, 2013 at 6:02 AM, Steven Yi wrote:
> Hi Andres,
>
> CS_VAR's are currently used during compilation to keep track of
> variables and types, but particularly, the size of memory required for
> a var. Previously in CS5, the size of mem required for a variable was
> tracked using counters, one for each type (i.e. kcount, acount,
> Scount, etc.). When compilation was done, we'd gather up the total
> size of memory required for all vars and opcode structs into a single
> block of mem, then on instance, allocate that block all at once and
> then divide it up amongst the opcodes and vars.
>
> In CS6, the CS_VAR's are used to count up the total size of memory, as
> well as index into the memory for what is used for an opcode struct,
> or a variable space. The CS_VAR then does not actually hold memory
> for use at runtime, but instead describes how to map the memory.
>
> So, for instance, our opcodes all have dsblksize to describe what size
> mem is required to use with the opcode. That block has an expected
> layout of data:
>
> [OPDS] (i.e. standard stuff like pfields, relesing, etc.)
> [OUTARGS] (i.e. MYFLT* out1, MYFLT* out2)
> [INARGS] (i.e. MYFLT* in1, MYFLT* in2)
> [LOCAL OPCODE DATA] (i.e. MYFLT temp)
>
>
> A CS_VAR for an array will say it is sizeof(ARRAYDAT), and, let's say,
> a memory index of 1. So for our giant block of memory for the
> instrument instance, we might get:
>
> [ BIG BLOCK OF MEMORY ]
>
> that gets divided up as:
>
> [ [ARRAYINIT] [ARRAYDAT] ]
>
> that ARRAYINIT struct has a place for an ARRAYDAT* in it's OUTARGS. So
> the CS_VAR is used to say "the memory here in the big block is for an
> ARRAYDAT" with a variable name of "[k;myVar". And if that var is used
> with ARRAYINIT, then we can assign the address of the var to the
> pointer in ARRAYINIT.
>
> Currently, we have no untyped variables in Csound. We could
> eventually, say, introduce CS_VAR as something to use at runtime. I
> think though for that to be done, we'd have to then update the layout
> of opcode structs to something like:
>
> [OPDS] (i.e. standard stuff like pfields, relesing, etc.)
> [OUTARGS] (CS_VAR**, maybe a null terminated list)
> [INARGS] (CS_VAR**, maybe a null terminated list)
> [LOCAL OPCODE DATA] (i.e. MYFLT temp)
>
> That'd add another level of indirection. It might not have any
> noticeable performance penalty, as the mem addresses within the
> CS_VAR's could be cached to typed pointers (i.e. MYFLT*). Also, it
> would allow runtime type identification and allow heterogenous lists
> (our next step to recreating LISP :)). On the other hand, we'd have
> to update all 1500+ opcodes...
>
> Anyways, just some rambings. Hope that clarifies more than it
> obfuscates what's going on!
>
> steven
>
> On Sun, Mar 17, 2013 at 4:24 AM, Andres Cabrera wrote:
>> Hi Steven,
>>
>> I'm wondering, why did you need to use an ARRAYDAT structure? Wouldn't
>> this be served directly with CS_VAR?
>>
>> Cheers,
>> Andrés
>>
>> On Mon, Mar 4, 2013 at 4:22 AM, Steven Yi wrote:
>>> Hi Joachim,
>>>
>>> Sorry for the late reply! The arrays code is mixed in a few place, but
>>> the opcodes that do the actual array init and access are in
>>> csound6/Opcodes/arrays.c.
>>>
>>> Thanks!
>>> steven
>>>
>>> On Wed, Feb 27, 2013 at 7:07 AM, joachim heintz wrote:
>>>> hi steven -
>>>>
>>>> thanks; and sorry for my impatience. i am just so curious ...
>>>>
>>>> i would still love to have a look in the sources to see what i can do
>>>> (and then test) with arrays right now. in which source file can i find
>>>> something?
>>>>
>>>> best -
>>>>
>>>> joachim
>>>>
>>>>
>>>> Am 26.02.2013 22:24, schrieb Steven Yi:
>>>>> Hi Joachim,
>>>>>
>>>>> Sorry I'm behind with emails. I would say, try testing arrays of
>>>>> different sizes and dimensions. I think also try things like index out
>>>>> of bounds as we need to test that things fail correctly. k[] are
>>>>> pretty much the same as t-vars in that they are both vectors of
>>>>> k-vars. I would also try testing arrays of different types, such as
>>>>> Strings, a-rate vars (i.e. using gaMixer[] init 32 as a 32 channel
>>>>> mixer), gfSigs[] (a global pvs bus), etc. Also testing with global
>>>>> arrays vs. local arrays would be good.
>>>>>
>>>>> I'd say, if you could put in positive test cases that are meant to
>>>>> succeed in one CSD, and if you could create any failure cases in
>>>>> individual CSD's, that would be a huge help as they can go straight
>>>>> into the CSD test suite.
>>>>>
>>>>> Thanks!
>>>>> steven
>>>>>
>>>>>
>>>>> On Tue, Feb 26, 2013 at 7:47 PM, joachim heintz wrote:
>>>>>> may i repeat this and ask for some advice how to test arrays?
>>>>>> thanks -
>>>>>> j
>>>>>>
>>>>>>
>>>>>> Am 26.02.2013 12:05, schrieb joachim heintz:
>>>>>>> hi -
>>>>>>>
>>>>>>> i have built cs6 alpha and i am happy to test. one question about
>>>>>>> arrays, no two:
>>>>>>>
>>>>>>> 1. i saw in test_arrays.csd that an array uses kArr[] as variable name.
>>>>>>> how is this related to the t-variables?
>>>>>>> and can someone point me to any source files in which i can find some
>>>>>>> methods about how to work with arrays?
>>>>>>>
>>>>>>> 2. is it possible to fill an array with something like
>>>>>>> kArr[] = [1, 2, 3, 4] ?
>>>>>>>
>>>>>>> thanks -
>>>>>>>
>>>>>>> joachim
>>>>>>>
>>>>>>> ------------------------------------------------------------------------------
>>>>>>> Everyone hates slow websites. So do we.
>>>>>>> Make your web apps faster with AppDynamics
>>>>>>> Download AppDynamics Lite for free today:
>>>>>>> http://p.sf.net/sfu/appdyn_d2d_feb
>>>>>>> _______________________________________________
>>>>>>> Csound-devel mailing list
>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>>
>>>>>>
>>>>>> ------------------------------------------------------------------------------
>>>>>> Everyone hates slow websites. So do we.
>>>>>> Make your web apps faster with AppDynamics
>>>>>> Download AppDynamics Lite for free today:
>>>>>> http://p.sf.net/sfu/appdyn_d2d_feb
>>>>>> _______________________________________________
>>>>>> Csound-devel mailing list
>>>>>> Csound-devel@lists.sourceforge.net
>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>
>>>>> ------------------------------------------------------------------------------
>>>>> Everyone hates slow websites. So do we.
>>>>> Make your web apps faster with AppDynamics
>>>>> Download AppDynamics Lite for free today:
>>>>> http://p.sf.net/sfu/appdyn_d2d_feb
>>>>> _______________________________________________
>>>>> Csound-devel mailing list
>>>>> Csound-devel@lists.sourceforge.net
>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>
>>>>
>>>> ------------------------------------------------------------------------------
>>>> Everyone hates slow websites. So do we.
>>>> Make your web apps faster with AppDynamics
>>>> Download AppDynamics Lite for free today:
>>>> http://p.sf.net/sfu/appdyn_d2d_feb
>>>> _______________________________________________
>>>> Csound-devel mailing list
>>>> Csound-devel@lists.sourceforge.net
>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>
>>> ------------------------------------------------------------------------------
>>> Everyone hates slow websites. So do we.
>>> Make your web apps faster with AppDynamics
>>> Download AppDynamics Lite for free today:
>>> http://p.sf.net/sfu/appdyn_d2d_feb
>>> _______________________________________________
>>> Csound-devel mailing list
>>> Csound-devel@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>
>> ------------------------------------------------------------------------------
>> Everyone hates slow websites. So do we.
>> Make your web apps faster with AppDynamics
>> Download AppDynamics Lite for free today:
>> http://p.sf.net/sfu/appdyn_d2d_mar
>> _______________________________________________
>> Csound-devel mailing list
>> Csound-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>
> ------------------------------------------------------------------------------
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_d2d_mar
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://list |