From his code, it looks like David Sky figured out how to solve the
"error: maximum table size (100000) exceeded - NIL"
problem. Since Nyquist tends to compute sounds according to the current
environment which has information about duration, the recommended way to
compute waveforms is to locally restore the environment to the default
If you create a waveform with PWL or LFO and make the duration 1, then
you'll have *CONTROL-SRATE* samples in the waveform. If you use OSC or
any other "audio" function, you'll have *SOUND-SRATE* samples in the
waveform. Either way, that's going to be pretty big. You can be more
efficient by specifying a shorter duration or a lower sample rate. I
prefer the lower sample rate method:
or if BUILD-MY-WAVEFORM is using OSC or something that runs at the
default audio rate, you should use SOUND-SRATE-ABS instead of
CONTROL-SRATE-ABS. (Also, you should nest both CONTROL-RATE-ABS and
SOUND-SRATE-ABS if you're mixing control rate and audio rate functions.)
Do NOT set *CONTROL-SRATE* or *SOUND-SRATE* directly! These are meant to
Since I specified 1024 as the rate, the table length for a one second
sound will be 1024.
Tables are interpolated with linear interpolation. In the case of a
pulse wave and panning, a small table will cause some intermediate
values to be generated, making for a smooth transition from 1 to 0 and 0
to 1. This could be useful. Example: To suppress clicks, suppose you
want a 5ms linear pan from left to right or right to left, and the
panning is running at 2Hz. That means we're running through the table
samples every 500ms. If each table sample represents 5ms, the table
should have 500/5 = 100 samples.
I didn't hear clipping on headphones using the pulse table I set up, but I
assume it's probably better to use the 5ms transition you mentioned.
Also, I'd been trying to figure out how to create a random waveform for
another plug-in I've been working on, using filtered white noise as the
source. Without using *sound-srate* signal. It looks like your code will
help me do this.