| This is interesting. I'm trying to imagine if there are any backwards
incompatibilities. A side effect of this is that it would seem then
that one wouldn't need to to use 'init' for k- and a-vars and could
use 'kval = 0' and have it be valid in the initial i-pass.
I'm wondering though, the init pass is a curious thing, especially
with if-then's. I'm wondering about something like:
kstate init 0
if (kstate == 0) then
...do something...
kstate = 1
else
kstate = 2
endif
if there is a change to do i-time assignment and expression changes,
wouldn't kstate = 2 after the init-pass? I'm thinking that k-rate
if-then's would have their opcodes still initialized in init pass.
On Sat, Jan 28, 2012 at 9:26 AM, Tito Latini wrote:
> I have found a solution for the i() problem in csound list.
> This is worth for the general case
>
> ivar = FN(k1 OP k2)
>
> This is what currently happens:
>
> i(k1 `op` k2)
>
> -> k0 op.kk k1 k2
> i(k0)
>
> but in entry.c, all OP.kk don't have a init function. For example:
>
> { "add.kk", S(AOP), 2, "k", "kk", NULL, addkk }
>
> therefore k0 is 0 during the first init pass and fn(k0) fails.
> The simplest solution is
>
> { "add.kk", S(AOP), 3, "k", "kk", addkk, addkk }
>
> Idem for FN.k
>
> In this way we can write
>
> i(k1 + k3 * abs(k4 / k6) OP FN(k7 ...) ...)
>
> This solution costs an operation during the init pass with the normal
> k-rate operations.
>
> Besides, after the changes, it'is simple to add this syntax
>
> ivar = k1 OP k2 OP .. FN(...) ...
>
> The alternative is to change `create_expression` in
> csound_orc_expression.c, OP.ii and FN.i if the function is i(), or if
> the left side of `=' is an i-variable, but it requires more changes.
>
> tito
>
> ------------------------------------------------------------------------------
> Try before you buy = See our experts in action!
> The most comprehensive online learning library for Microsoft developers
> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
> Metro Style Apps, more. Free future releases when you subscribe now!
> http://p.sf.net/sfu/learndevnow-dev2
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel
------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net |