[compare-shape]

Hello.
My question concerns the optional parameter of the function (osc-pulse .
Is there a document on the Internet which explains how we use this parameter (R B Dannenberg: …but other shapes may be used to achieve non-square pulses…)?
Beforehand, thank you for your help.

The only other “documentation” that I’m aware of is the code:

; bias is [-1, 1] pulse width.  sound or scalar.
; hz is a sound or scalar
(defun osc-pulse (hz bias &optional (compare-shape *step-shape*))
  (compare bias (osc-tri hz) compare-shape))

and

; compare-shape is a shape table -- origin 1.
(defun compare (x y &optional (compare-shape *step-shape*))
  (let ((xydiff (diff x y)))
    (shape xydiff compare-shape 1)))

So in the function: (osc-pulse hz bias [compare-shape])
the optional parameter compare-shape is a sound that shapes the pulse with the shape function (http://www.cs.cmu.edu/~rbd/doc/nyquist/part8.html#index453)

Example: If you want pulses with sloped sides, you could do it like this:

(setf trapezium  (abs-env (pwlv -1 0.7 -1 1.3 1)))
(osc-pulse 100 0 trapezium)