Windows XP audio resample Nyquist script

Can someone give me the Nyquist script that converts the sample rate like in Windows XP?

Nyquist plug-ins run in Audacity, they are not stand-alone effects. For stand-alone Nyquist see:

Windows XP does not support current versions of Audacity. See here for the Windows compatibility table:

For current and recent versions of Audacity, the code for resamplng a track:

(resample *track* srate)

where “srate” is the numeric value of the new sample rate. For example, to resample to 48000 Hz:

(resample *track* 48000)

For very old versions of Audacity, use “S” rather than “track”:

(resample s 48000)

Note that resampling the audio does not change the track’s sample rate, so the processed track will be stretched by Audacity to the track’s sample rate. To change the track’s sample rate, use the “Rate” option in the track’s dropdown menu.

Resampling in Nyquist uses this function (Audacity 3.1.3 version):

(defun resample (snd rate)
  (ny:typecheck (not (or (soundp snd) (multichannel-soundp snd)))
    (ny:error "RESAMPLE" 1 '((SOUND) nil) snd t))
  (ny:typecheck (not (numberp rate))
    (ny:error "RESAMPLE" 2 '((NUMBER) "rate") rate))
  (cond ((arrayp snd)
         (let* ((len (length snd))
                (result (make-array len)))
           (dotimes (i len)
             (setf (aref result i)
                   (snd-resample (aref snd i) rate)))
         (snd-resample snd rate))))

which ultimately calls this C code:

Do I have to paste only (resample track 48000) or is there a full script?
Also, I’m looking for the script that makes the audio sound like bitcrushed, that’s how Windows XP’s audio resampling worked.

JB/ToneBooster’s free “Time Machine” plugin

Which version of Audacity are you using?

See this topic:


In Audacity 3.1.2 you can resample a track with Nyquist by:

  1. Select the track
  2. Open the “Nyquist Prompt” (in the “Tools” menu)
  3. Enter the code:
(resample *track* 48000)

(or whatever sample rate you want)
4. Click the “OK” button

However, I suspect what you really want is the “BitCrusher.ny” plug-in.
Instructions to install and enable Nyquist plug-ins on Windows:

I’d also suggest updating to the current Audacity 3.1.3.

I’ve updated to Audacity 3.1.3.
Also, no, I’m not looking for a bitcrusher, I just want to resample the sound how Windows XP resamples.

By the way, I’ve found a Nyquist script that makes what I want, but I don’t know if it’s compatible with 3.1.3.


Interesting, I recognise that code. I wrote it :smiley: :

Add this line at the top of the script, so that it is on the first line, on its own, and the script will work with Audacity 3.1.3

;version 3

I’ve did it, and it gave me the result I wanted. Thanks!

If you use the “debug” button to run it, you will see that it is not.

However, somebody provided a version that works: (assuming that’s what you want)