Nyquist Drum Replacer

Using Nyquist scripts in Audacity.
Post and download new plug-ins.
Forum rules
If you require help using Audacity, please post on the forum board relevant to your operating system:
Mac OS X
GNU/Linux and Unix-like
Posts: 225
Joined: Wed Sep 04, 2019 1:17 pm
Operating System: macOS 10.15 Catalina or later

Re: Nyquist Drum Replacer

Post by Paul2 » Wed Jun 09, 2021 7:45 pm

Modified your drum machine code a bit...

Code: Select all

;type generate
;name "Simple Sequencer"

;control filename "Select a mono WAV file" file "" "*default*/drum.wav" "WAV file|*.wav;*.WAV" "open,exists"
;control number "Number of beats" int "" 8 1 31
;control tempo "Tempo" int "bpm" 120 30 300
;control pat "Place every" choice "1 beat, 2 beats, 3 beats, 4 beats" 3

(setf pat (+ pat 1))

(defun get-sound (fname)
  (let ((fp (open fname)))
      (fp (close fp)
          (s-read filename))
      (t  (format nil "Error.~%~s~%cannot be opened."

(defun do-sequence (d-snd)
  (let ((delay (* (/ 60.0 tempo) pat))
        (out (s-rest 0)))
    (dotimes (i number out)
      (setf out
          (sim out
              (at (* i delay) (cue d-snd)))))))

(let ((drum-snd (get-sound filename)))
  (if (arrayp drum-snd)
      (format nil "Error.~%~s~%is stereo."
      (do-sequence drum-snd)))
Really quick and simple to add samples now.
Screen Shot 2021-06-09 at 9.56.57 PM.png
Screen Shot 2021-06-09 at 9.56.57 PM.png (21.04 KiB) Viewed 668 times
Samples used:
(All wav, mono)
(123.54 KiB) Downloaded 27 times

Post Reply