| Hi All,
I did some work on the type system code and wanted to share to let
others know where I'm heading in terms of code. I have done it as a
separate stand-alone project for now, with the intent of using a
main.c as a testing file. I'm using Netbeans to do the C code
locally, and have placed a zip of it at:
http://www.kunstmusik.com/CsoundTypeSystem.zip
It's a start. With it I can define a type, add types to a TYPE_POOL,
find a type by its typeName, and create variables for a type.
Currently it shows an a-sig type (uses a hardcoded 64 ksmps but would
be modified to use value from CSOUND* or new CS_CONTEXT* struct).
Currently the CS_TYPE_INSTANCE holds a ref to CS_TYPE and a
createVariable function pointer. A destroyVariable function pointer
would likely be added.
I think, even with this, it would be enough to start some experiments
with integrating it with Csound's parser/instrument allocation code.
I'll be continuing to explore this tomorrow. I can imagine with this,
we'll be able to do something like:
instr = csoundCreateInstrument()
var1 = instr.addVar("var1", "a")
var2 = instr.addVar("var2", "k")
var3 = instr.addVar("var3", "k")
op1 = Opcodes["init"](var2, 440)
op2 = Opcodes["init"](var3, .5)
op = Opcodes["vco2"](var1, (var2, var3))
instr.addOpcode(op1)
instr.addOpcode(op2)
instr.addOpcode(op3)
which would be what the Csound compiler could be modified to do using
API calls internally. The same methods the compiler uses to create a
graph would then be exposed to host languages. Convenience
methods/functions/classes/etc. could be made to ease all this.
Thanks!
steven
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net |