Re: Question on Oparray's

From: Robin Davies (rerdavies@hotmail.com)
Date: Thu Mar 15 2001 - 18:23:20 EST


Eesh. Looks like our first serious test of the new oparray semantics. I'm
going to venture a few opinions here.

1) The rate of array references is rate of the array or the rate of the
index, whichever is larger (for both L- and R-values). You are correct:
array semantics allow arrays to be read and written at differnt rates.

2) I'm not sure if there are precise rules on how the oparray initialization
works here, if you use one pass to initialize the kline oparray, and another
to use it; however, I'm going to break it out into a separate message. The
problem is deeply technical, and may be more confusing/discouraging than it
needs to be.

3) That aside, there are a few problems with this piece of code, at first
glance, that might make it difficult to do what you want, anyway.

For instance:

> if (itime >= expire) { <-- krate.
> stage = stage + 1; <-- irate.
> }

isn't legal. stage=stage+1 is (I think) an illegal assignment taking place
at less than the rate of the guard expression. Even if it were legal, it
wouldn't do what you think, since the statement stage=stage+1 gets executed
only once at i-time.

Unfortunately, changing stage to k-rate moots the question since in

> eg = (kline[stage](1, r[stage], 0) *

r[stage] is now k-rate, and is an illegal argument to kline.

There are some fairly extraordinary things you could do to get this approach
to work. However, truthfully, I don't think this is really a great
application for oparrays. Just bite the bullet and do the line segments
yourself.

Try something along these lines:

  asig aSegment, aLevel, aDeltaLevel;
  asig aSegmentLength;
   /// initialize the tables.
     ...
  // ramp between successive values in the table.
  while (aSegmentLength <= 0) {
    aSegmentLength = aSegmentLength + length[aSegment];
    aDeltaLevel =
      ( levels[aSegment]
      - aLevel
      ) / aSegmentLength;
  }
  aLevel = aLevel + aDeltaLevel;
  aSegmentLength = aSegmentLength-(1/s_rate);
  return (aLevel);

  // you can figure out how to handle the releases, &c.

Regards,

Robin Davies.
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.



This archive was generated by hypermail 2b29 : Mon Jan 28 2002 - 12:11:07 EST