I am interested in making a sampler, by which I mean a processor that can
record and play back audio in response to trigger or gate signals.
rwtable is one primitive that might be useful for this. But if this isn't a
good way to make a sampler, please let me know if there is a better way.
The rwtable documentation shows the implementation of a looper. There is a
terse mathematical description, which matches my intuition of how rwtable would
work, although it leaves out certain details such as the table size and what
happens if the indices go out of bounds. I am having trouble understanding
exactly how rwtable works, even after studying the looper implementation and
exploring rwtable's behavior on my own. The documentation is a bit unclear on
rwtable's semantics.
My intuition is that rwtable is a mutable array of static size. The write index
controls which element in the table is assigned the value of the input signal.
That is to say, if the write index were a constant function of time, then a
particular element in the table would vary as a function of time identically
with rwtable's input signal. Likewise, my intuition about its read behavior is
that the output value of rwtable is the value of the element referred to by the
value of the read index. Thus, if the read index is constant, then the output
signal would be identical to the value of a particular element. When that
element is written to, then rwtable's output signal changes to the value
written.
More formally, the processor rwtable(s, i, n, _ n) for all s > 0, for all i,
and for all n in [0, s - 1] is the identity function.
It is easy to test this hypothesis.
process = os.osc(55) : rwtable(1024, 0.1, 42, _, 42);
The result, as demonstrated using faustide, is that the hypothesis is wrong.
The output signal is a constant 0.1, not a 55Hz sinusoid.
This implies that the table isn't being written to. One guess I have is that
the write index has to change in order for the table to be written. Indeed, the
looper's write index changes, and it works. So this seems like the next thing I
should investigate. But if I'm clearly making a mistake somewhere, please point
it out.
_______________________________________________
Faudiostream-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/faudiostream-users