# Can somebody please convert the following macro to a clean Nyquist only script?

**URL:** <https://forum.audacityteam.org/t/can-somebody-please-convert-the-following-macro-to-a-clean-nyquist-only-script/150481>\
**Category:** Nyquist\
**Created:** [December 15, 2025, 6:36am UTC](https://forum.audacityteam.org/t/can-somebody-please-convert-the-following-macro-to-a-clean-nyquist-only-script/150481 "2025-12-15T06:36:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![heavensprominence](https://forum.audacityteam.org/user_avatar/forum.audacityteam.org/heavensprominence/32/40692_2.png) [@heavensprominence](https://forum.audacityteam.org/u/heavensprominence)\
**Post date:** [December 15, 2025, 6:36am UTC](https://forum.audacityteam.org/t/can-somebody-please-convert-the-following-macro-to-a-clean-nyquist-only-script/150481/1 "2025-12-15T06:36:00Z")

</div>

```auto
NyquistPrompt:Command="(setf repeats 10000) ; Number of repeats\n(setf delay 0.0001)\n\n(defun normalize (sig)\n (setf max-samples 100000000)\n (if (soundp sig)\n (setf factor (/ 1.0 (peak sig max-samples)))\n (setf factor (vector (/ 1.0 (peak (aref sig 0) max-samples))\n (/ 1.0 (peak (aref sig 1) max-samples)))))\n (mult sig factor))\n\n(defun make-impulse ()\n (setf impulse-array (make-array (truncate (* *sound-srate* delay))))\n (dotimes (i (length impulse-array))\n (setf (aref impulse-array i) 0))\n (setf (aref impulse-array 0) 1)\n (snd-from-array 0 *sound-srate* impulse-array))\n\n(defun do-repeats (sig impulse)\n (let* ((convolved (convolve sig impulse))\n (tail (extract 1 2 convolved)))\n (extract 0 1 (sim convolved tail))))\n\n(defun process ()\n (let ((impulse-train (seqrep (i repeats) (cue (make-impulse)))))\n (setf repeated (multichan-expand #'do-repeats *track* impulse-train))\n (normalize repeated)))\n\n\n(process)"
Amplify:Ratio="0.0079432823"
NyquistPrompt:Command="(setf repeats 10000) ; Number of repeats\n(setf delay 0.0001)\n\n(defun normalize (sig)\n (setf max-samples 100000000)\n (if (soundp sig)\n (setf factor (/ 1.0 (peak sig max-samples)))\n (setf factor (vector (/ 1.0 (peak (aref sig 0) max-samples))\n (/ 1.0 (peak (aref sig 1) max-samples)))))\n (mult sig factor))\n\n(defun make-impulse ()\n (setf impulse-array (make-array (truncate (* *sound-srate* delay))))\n (dotimes (i (length impulse-array))\n (setf (aref impulse-array i) 0))\n (setf (aref impulse-array 0) 1)\n (snd-from-array 0 *sound-srate* impulse-array))\n\n(defun do-repeats (sig impulse)\n (let* ((convolved (convolve sig impulse))\n (tail (extract 1 2 convolved)))\n (extract 0 1 (sim convolved tail))))\n\n(defun process ()\n (let ((impulse-train (seqrep (i repeats) (cue (make-impulse)))))\n (setf repeated (multichan-expand #'do-repeats *track* impulse-train))\n (normalize repeated)))\n\n\n(process)"
Amplify:Ratio="0.0079432823"
NyquistPrompt:Command="(setf repeats 10000) ; Number of repeats\n(setf delay 0.0001)\n\n(defun normalize (sig)\n (setf max-samples 100000000)\n (if (soundp sig)\n (setf factor (/ 1.0 (peak sig max-samples)))\n (setf factor (vector (/ 1.0 (peak (aref sig 0) max-samples))\n (/ 1.0 (peak (aref sig 1) max-samples)))))\n (mult sig factor))\n\n(defun make-impulse ()\n (setf impulse-array (make-array (truncate (* *sound-srate* delay))))\n (dotimes (i (length impulse-array))\n (setf (aref impulse-array i) 0))\n (setf (aref impulse-array 0) 1)\n (snd-from-array 0 *sound-srate* impulse-array))\n\n(defun do-repeats (sig impulse)\n (let* ((convolved (convolve sig impulse))\n (tail (extract 1 2 convolved)))\n (extract 0 1 (sim convolved tail))))\n\n(defun process ()\n (let ((impulse-train (seqrep (i repeats) (cue (make-impulse)))))\n (setf repeated (multichan-expand #'do-repeats *track* impulse-train))\n (normalize repeated)))\n\n\n(process)"
Amplify:Ratio="0.0079432823"
NyquistPrompt:Command="(setf repeats 10000) ; Number of repeats\n(setf delay 0.0001)\n\n(defun normalize (sig)\n (setf max-samples 100000000)\n (if (soundp sig)\n (setf factor (/ 1.0 (peak sig max-samples)))\n (setf factor (vector (/ 1.0 (peak (aref sig 0) max-samples))\n (/ 1.0 (peak (aref sig 1) max-samples)))))\n (mult sig factor))\n\n(defun make-impulse ()\n (setf impulse-array (make-array (truncate (* *sound-srate* delay))))\n (dotimes (i (length impulse-array))\n (setf (aref impulse-array i) 0))\n (setf (aref impulse-array 0) 1)\n (snd-from-array 0 *sound-srate* impulse-array))\n\n(defun do-repeats (sig impulse)\n (let* ((convolved (convolve sig impulse))\n (tail (extract 1 2 convolved)))\n (extract 0 1 (sim convolved tail))))\n\n(defun process ()\n (let ((impulse-train (seqrep (i repeats) (cue (make-impulse)))))\n (setf repeated (multichan-expand #'do-repeats *track* impulse-train))\n (normalize repeated)))\n\n\n(process)"
Amplify:Ratio="0.0079432823"
NyquistPrompt:Command="(setf repeats 10000) ; Number of repeats\n(setf delay 0.0001)\n\n(defun normalize (sig)\n (setf max-samples 100000000)\n (if (soundp sig)\n (setf factor (/ 1.0 (peak sig max-samples)))\n (setf factor (vector (/ 1.0 (peak (aref sig 0) max-samples))\n (/ 1.0 (peak (aref sig 1) max-samples)))))\n (mult sig factor))\n\n(defun make-impulse ()\n (setf impulse-array (make-array (truncate (* *sound-srate* delay))))\n (dotimes (i (length impulse-array))\n (setf (aref impulse-array i) 0))\n (setf (aref impulse-array 0) 1)\n (snd-from-array 0 *sound-srate* impulse-array))\n\n(defun do-repeats (sig impulse)\n (let* ((convolved (convolve sig impulse))\n (tail (extract 1 2 convolved)))\n (extract 0 1 (sim convolved tail))))\n\n(defun process ()\n (let ((impulse-train (seqrep (i repeats) (cue (make-impulse)))))\n (setf repeated (multichan-expand #'do-repeats *track* impulse-train))\n (normalize repeated)))\n\n\n(process)"
Amplify:Ratio="0.79432823"

```

I am on an Arch Linux PC, running the Appimage version 3.7.6 of Audacity.

Many thanks,  
Bryan
