.SH NAME
lab 4 - signalfs; generalize wavefs to a family of file servers
that support a variety of sound sources and filters.
.SH SETUP
Inferno 4th edition release 20040830.
Using
.I wavefs
and the
Synthesis Toolkit in C++.
.SH DESCRIPTION
I started with the wavefs source and abstracted
out an interface for modules that the fileserver
can call. The signal processor implements
this interface. The compiled dis module that implements
a specific dsp is passed as parameter to the signalfs
which exports the standard files
.IP
.EX
/signal
/signalctl
.EE
.PP
The interface is quite simple
.IP
.EX
Signal: module {
configstr: string;
init: fn(args: list of string);
config: fn(s: string);
tickFrame: fn(): array of real;
};
.EE
.PP
Messages written to
.B /signalctl
are passed to
.IR config ,
and reads return the contents of
.IR Signal.configstr .
Reads from
.BR /signal ,
which is readonly, are sent data generated by
.IR tickFrame .
I rewrote the wave loop module using this interface.
wave.b
The server is now mounted as
.IP
.EX
% mount {signalfs wave.dis sinewave.raw} /mnt/dsp/wave
% lc /mnt/dsp/wave
signal signalctl
.EE
.PP
I implemented a few other DSPs.
noise.b
envelope.b
filter.b
The original source for all of these is from the STK.
Each signal has it's own config options. Here's an example using the filter
.IP
.EX
% mount {signalfs filter.dis} dsp/filter
% echo acoef 1.0 0.1 0.5 > dsp/filter/signalctl
% echo bcoef 0.5 0.5 > dsp/filter/signalctl
% echo source dsp/wave/signal
% cat dsp/filter/signalctl
rate 22050
chans 1
gain 1
source dsp/wave/signal
acoef 1 .1 .5
bcoef .5 .5
% read 40000 < dsp/filter/signal > /dev/audio
.EE
.PP
.SH CONCLUSION
It is too slow. We need another iteration to read
vectors of ticks
instead of single ticks.
I like the layout. It is simple to add new filters and sources.
A filter can be applied to another signal file by just
writing to the control file.
We'll need a mixerfs or voicefs to combine many voices and
something to do the sequencing. It's nice generating
sounds from the shell.
.SH REFERENCES
Cook, Perry and Scavone, Gary P.
.I "Synthesis Toolkit in C++ "
.B http://www-ccrma.stanford.edu/software/stk/