Steven Curtin wrote:
>
> Thanks for the info- a lot of that is just translation problems from csound
> to SAOL on my part.
>
> >I always thought that reinit was confusing. Can you (or someone)
> >give me an example of something that's really hard to do without it?
> >I can propose its addition if it's sorely needed.
>
> Reinit is kind of ugly- basically the csound equivalent of goto().
It's worse than that! It's goto plus a whole bunch of hidden
changes to variables and hidden state!
> The main thing that reinit() (at least for me) is good for is looping a
> linseg. This is nice for using looping envelope generators/function
> generators, or for parametrically changing a waveform from for instance a
> sawtooth to a triangle wave.
You could do this with a non-interpolating koscil().
> A clearer way to do this would be to specify a repeat stage in the linseg.
> This is how the Buchla MARF did this- a multistage envelope where stage N
> could be programmed to jump back to stage 0 or to any other stage, given a
> control conditional.
Again, you could write a version of koscil() (or oscil() if you
want it at the a-rate) that takes additional parameters with
loop points.
kopcode koscil_loop(table ft, ksig cps, ksig loop, ksig loopend) {
// loop and loopend given in sec
ksig ph,ret;
ret = tableread(ft,floor(ph * ftlen(ft)));
ph = ph + cps/k_rate;
if (ph >= loopend/ (ftlen(ft)/k_rate)) { ph = loop / (ftlen(ft) / k_rate); }
return ret;
}
I haven't tested that, but something like it would work. Put your
step-function in the table.
> The various oscils have ways to specify different numbers of loops, so this
> would be a logical addition to linseg. There may be ways to create
> something like this using a procedure, I can't think of it right now.
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 0112 |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 - 11:46:32 EST