| Hi Andres,
Regarding CS_VAR's and the bus, that's a good question. :) I'm not
sure what's a good solution. Right now, CS_VAR's essentially have the
name of the var, a reference to a CS_TYPE, a memBlock size, and a
memBlockIndex. With that information, you should be able to find the
address of a defined csound variable by name within an instrument
instance's memory block. I think at this point, the host would have
to then know that a CS_VAR maps to a type that then maps to an
underlying struct or MYFLT. So you could probably do something like:
CS_VAR* csvar = csGetVariable(instr, "variableName");
void* var = csGetVariableAddress(instr, csvar);
if(csvar->type == CS_TYPE_K) {
MYFLT* myVar = (MYFLT*) var;
}
CS_VAR* csvar2 = csGetVariable(csound, "myArray"); // GLOBAL
void* var2 = csGetVariableAddress(csound, csvar2);
if(csvar2->type == CS_TYPE_ARRAY) {
ARRAY_DAT* myVar = (ARRAY_DAT*) var2;
}
Thoughts?
steven
On Tue, Jan 8, 2013 at 6:37 AM, Andres Cabrera wrote:
> Hi,
>
> I'm trying to wrap my head around how the API would use CS_VARIABLES
> internally. I'm thinking specifically of the I/O callbacks for the
> software buses/channels.
>
> If I want the invalue opcode to accept a generic CS_VARIABLE, how
> would that be done? If I want it to accept just MYFLT, how would that
> be? And if I want to wrap a MYFLT into the more generic CS_VARIABLEto
> pass to the callback, how can that be done?
>
> Cheers,
> Andrés
>
> ------------------------------------------------------------------------------
> Master SQL Server Development, Administration, T-SQL, SSAS, SSIS, SSRS
> and more. Get SQL Server skills now (including 2012) with LearnDevNow -
> 200+ hours of step-by-step video tutorials by Microsoft MVPs and experts.
> SALE $99.99 this month only - learn more at:
> http://p.sf.net/sfu/learnmore_122512
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel
------------------------------------------------------------------------------
Master HTML5, CSS3, ASP.NET, MVC, AJAX, Knockout.js, Web API and
much more. Get web development skills now with LearnDevNow -
350+ hours of step-by-step video tutorials by Microsoft MVPs and experts.
SALE $99.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122812
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net |