Here’s a code snippet for a “scratch” type effect:
(setq depth 2.5)
(defun scratch (s-in)
(fmosc 0.0 (mult depth (hzosc (/ (get-duration 0.5)))) (list s-in 0 nil) 0))
(multichan-expand #'scratch s)
The depth (how much the speed is changed) can be adjusted by changing the number in the first line (currently 2.5)
This should work well on selections of about 1/4 to 1/2 second duration.
It’s just a simple form of “always open” “forward” scratch that speeds up the audio, slows it down, and speeds it back up again. “depth” settings higher than 10 will cause a more rapid scratch type effect as the frequency attempts (but fails) to go negative.
Here’s a simple “Scratch effect” plug-in based on the code from the previous post.
scratch.ny (1.11 KB)
It’s too bad there’s no “reverse” audio function in Nyquist, probably would
make scratch effect plug-in(s) easier and fun(er) to make.
“Itchin’ for a scratch…it’s the itch that you got to catch…”
“Nyquist” has a “reverse” function, but it is not implemented in Audacity: http://www.cs.cmu.edu/~rbd/doc/nyquist/part15.html#index1181
One way that it is possible to reverse a sound in Audacity Nyquist is to read the samples into an array, reverse the array then turn it back into a sound.
Note that this example uses rather a lot of memory so it is only really suitable for short tracks.
(defun simple-reverse (sig)
(setf myarray (snd-fetch-array sig (truncate len) (truncate len)))
(let* ((samples (length myarray))
(loops (truncate (/ samples 2.0))))
(dotimes (i loops)
(setq temp (aref myarray (- samples i 1)))
(setf (aref myarray (- samples i 1)) (aref myarray i))
(setf (aref myarray i) temp)))
(snd-from-array 0 *sound-srate* myarray))
(multichan-expand #'simple-reverse s)
Please, could You rewrite scratching effect?
I have encountered one strange bug, something like %F, or something, like this.
Maybe this effect doesn’t work in new versions of Audacity.
Yes, it was a very old plug-in (10 years ago )
Here’s an updated version:
scratch.ny (1.12 KB)