Nyquist and SAL

Hi all,

New member, just joined today.

Been a long time user of Audacity and would like to start learning Nyquist using SAL.
Decided to start with baby steps but getting stuck with the following:

I have included spatial.lsp in myinit.lsp and want to use “pl-doppler” in the Nyquist prompt just as a quick test.
Pl-doppler expects two arguments, namely s and r, where r is the distance from the listener.
This is where the problem comes in, no matter what I try, Nyquist Prompt always complains about the second argument.

This is what I type in:

return pl-doppler(s, 100)

I have tried things like initializing the variable first, using a function and even “begin” and “end”
In all cases, it returns an error:

error: bad argument type - 100
Call traceback:
    MAIN() at line 1

I’m obviously overlooking something.
I have tried to look at example plug-ins and other threads on this forum, but they are mostly using lisp, I far prefer
SAL as it simply makes more sense to me and is easier to read.

Any help/pointers greatly appreciated.

Running Audacity 2.1.3 on MacOS 10.12.4


I can’t help much with SAL, though looking at the Lisp code for pl-doppler:

(defun pl-doppler (snd r)
  (let* ( (v (mult -1 (slope r)))
          (ratio (recip (sum 1 (mult v (recip 344.31)))))
          (map (integrate ratio)) )

    (sound-warp map snd) ))

the “slope” function requires a signal (sound or control signal) (https://www.cs.cmu.edu/~rbd/doc/nyquist/part8.html#index377), therefore “r” must be a signal, not a number.

Hi Steve,

Many thanks for the prompt reply.

…the “slope” function requires a signal (sound or control signal)…therefore “r” must be a signal, not a number.

That makes perfect sense, knew I was doing something wrong.