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:
Windows
Mac OS X
GNU/Linux and Unix-like
Paul2
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)))
    (cond
      (fp (close fp)
          (s-read filename))
      (t  (format nil "Error.~%~s~%cannot be opened."
             fname)))))

(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."
              filename)
      (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 687 times
Samples used:
(All wav, mono)
Attachments
SampleSounds.zip
(123.54 KiB) Downloaded 29 times

Post Reply