[Stk] Indexing Table

Carlos Pita carlosjosepita@yahoo.com.ar
Wed, 11 May 2005 08:01:06 -0300


Hi!
A common practice in pd is to index
tables by the output of a phasor
or envelope. For example you get an
exponential envelope indexing an
exponential precalculated table by the
(scaled) output of an adsr, or a sawtooth
oscillator indexing a sawtooth table
by (scaled) output of a phasor (looping [0,1])
with properly setted frequency.
I can easily implement the envelope->table
thing with stk, ticking an ADSR into a Table.
For the second (phasor->table), I could
use a WaveLoop, but it assumes (for raw input)
16 bit ints, which I guess is due to its
orientation to loop audio data (instead
of tabulated functions). For this task,
I would prefer using doubles (or whatever
StkFloat is #defined to be) as Table does.
But I can't find a Phasor generator to
index Table. I know it's not so difficult
to implement this by myself or that I could
implement the phasor as a WaveLoop looping
a proper rawwave. I'm just asking if there
is a more or less established way of
doing such a common thing in stk. If not,
I will just do it my way.
Ahhh, is there a way to do 4-point interpolation?
If not, I will patch Table.h/.cpp with an option
to choose between interpolation schemes (truncate/
round/2-point/4-point/(?)). I could send you the
diffs if you want them.

Tank you.
Regards,
Carlos