(recip sound) has a bug
The command "recip" is defined as follows:
(recip sound)
A generalized reciprocal function. If sound is a SOUND, compute 1/x for each
sample x. If sound is a number x, just compute 1/x. If sound is a
multichannel sound, return a multichannel sound with recip applied to each
element. The result has the type, sample rate, starting time, etc. of sound.
Note that the reciprocal of 0 is undefined (some implementations return
infinity), so use this function with care on sounds. Division of sounds is
accomplished by multiplying by the reciprocal. Again, be careful not to
divide by zero.
http://www.audacityforum.de/download/edgar/nyquist/nyquistdoc/manual/part6.html#index38
Test for (recipe sound):
1. Create a sine wave with Audacity.
2. Apply the Nyquist command:
(sum (mult s 0.05) 0.95)
The result is a sine wave between +0.9 and +1.0
3. Apply the Nyquist command:
(recip (mult s 2.0))
The result should be a wave between +0.5 and +0.55
But the result is a thin line at +1.0
It seems that "recip" produces wrong results, if the amplitude
of the sound is bigger than 1.
This means that you cannot create tanh(x) with "recip"
tanh(x) = sinh(x)/cosh(x)
cosh(1) = 1.543080634815244
CONCLUSION:
Instead of "recip", one may better use this function:
(defun shyperbolic (mysound)
(sexp (mult (slog mysound) 1.0))
)
