Hi Robin,
>Since the standard says that array references expressions (lvalue and
>ravalue) take the higher rate of their array variable and array index, my
>reading of the standard is that the following kinds of things are legal
too:
>
> ksig kIndex;
> asig aIndex;
> ivar iArray;
>
> iArray[aIndex] = aSomeSignal; // Write at A-rate
> kSomeVal = iArray[kIndex]; // Read at K-Rate.
>
>Any opinions on the legality of this?
That's a neat trick. Seems legal to me, but your way
is a little misleading since the semantics are the
same as
kSomeVal = iArray[kIndex];
iArray[aIndex] = aSomeSignal;
due to the mysteries of SAOL execution order. If
you do it my way, it is more clear that kSomeVal
gets the last value of iArray[kIndex] from the
a-rate assignment in the *previous* orchestra cycle.
(It's the previous orch cycle whether the k-rate line
precedes or follows the a-rate line).
Can't the same effect be acheived with the downsamp() core
opcode, though? That is,
kSomeVal = downsamp(aSomeSignal,t);
where t is the table [0 0 0 . . . 1] with length of the
k-period?
Can you do something different your way?
Best.
-- Eric
+-----------------+
| Eric Scheirer |A-7b5 D7b9|G-7 C7|Cb C-7b5 F7#9|Bb |B-7 E7|
|eds@media.mit.edu| < http://sound.media.mit.edu/~eds >
| 617 253 1750 |A A/G# F#-7 F#-/E|Eb-7b5 D7b5|Db|C7b5 B7b5|Bb|
+-----------------+
This archive was generated by hypermail 2b29 : Mon Jan 28 2002 - 12:03:54 EST