> I've been finding tablereads kinda oppressive when trying to write realtime
> instruments with Sfx. Tablereads are a *lot* slower than array references,
> since either interpolation has to be performed, or an explicit test has to
> be made for the integer-ness of the index.
The third, fast way to do this is to statically analyze the variables, and
figure out which variables live their lives as integral values, during
compile time. Then, generate code that interpolates or not depending on
the integral status of the index variable for the tableread (these same
issues come up in tablewrite, except the optimization issue is avoiding
the rounding operation).
Sfront only does this for a few simple cases today, but the hooks are in
the code generation to do it more generally eventually ...
> It's soooo close to being legal. I suspect that its close enough that it
> probably does work on most compilers.
Won't work on sfront -- sfront actually implements copy-in and copy-out right
now, and when this gets upgraded to do references, it will be done in a
fully compliant way, so that this explicitly won't work.
Also ...
> iLastNoteInstance[iMidiNote] = iLastNoteInstance[iMidiNote]+1;
> iNoteInstance = iLastNoteInstance[iMidiNote];
As i-rate statements in a kopcode, these lines will never execute in
sfront, and produce a warning message -- in compliance with the standard
as I read it currently, as we discussed off-line.
----------
Basically, these sorts of copying and rate-semantic issues are going to
be the ones on which the whole "write once play anywhere" promise of
Structured Audio is going to rise or fall. It's one thing to have special
non-standard statements (like saolc's idump/kdump or sfront's printf) that
get dropped or converted during .mp4 file encoding. But when the actual
semantics of the language changes from implementation to implementation,
things are much worse ....
--jl
-------------------------------------------------------------------------
John Lazzaro -- Research Specialist -- CS Division -- EECS -- UC Berkeley
lazzaro [at] cs [dot] berkeley [dot] edu www.cs.berkeley.edu/~lazzaro
-------------------------------------------------------------------------
This archive was generated by hypermail 2b29 : Mon Jan 28 2002 - 12:03:55 EST