1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-07-30 15:39:27 +02:00

new version from Steve

This commit is contained in:
v.audacity 2012-07-17 02:20:26 +00:00
parent cf0869ff85
commit 67b9e6bc2d

View File

@ -4,38 +4,45 @@
;categories "http://lv2plug.in/ns/lv2core#ModulatorPlugin"
;name "Tremolo..."
;action "Applying Tremolo..."
;info "by Dominic Mazzoni, modified by David R. Sky\nReleased under terms of the GNU General Public License Version 2\n'Starting phase' sets where to start tremolo in the waveform cycle.\n'Wetness level' sets depth of tremolo - 0 percent is no tremolo,\n100 percent sweeps between zero and maximum volume.\n'Frequency' controls the speed of the oscillation - use higher\nfrequencies for faster oscillation."
;info "by Steve Daulton. Released under GPL v2.\nBased on Tremolo by Dominic Mazzoni and David R. Sky.\n"
;; tremolo.ny by Steve Daulton (www.easyspacepro.com) July 2012.
;; Released under terms of the GNU General Public License version 2:
;; http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
;;
;; For information about writing and modifying Nyquist plug-ins:
;; http://wiki.audacityteam.org/wiki/Nyquist_Plug-ins_Reference
;control wave "Waveform type" choice "sine,triangle,sawtooth,inverse sawtooth,square" 0
;control phase " Starting phase [degrees]" int "" 0 -180 180
;control amount " Wetness level [percent]" int "" 40 0 100
;control lfo " Frequency [Hz]" real "" 4.0 0.1 10.0
;control phase "Starting phase (degrees)" int "" 0 -180 180
;control wet "Wet level (percent)" int "" 40 0 100
;control lfo "Frequency (Hz)" real "" 4 0 10
; set tremolo *waveform*
(setq *waveform* (cond
((= wave 0) ; sine
*sine-table*)
((= wave 1) ; triangle
*tri-table*)
((= wave 2) ; sawtooth
(abs-env (list (pwl 0 -1 .995 1 1 -1 1) (hz-to-step 1.0) t)))
((= wave 3) ; inverse sawtooth
(abs-env (list (pwl 0 1 .995 -1 1 1 1) (hz-to-step 1.0) t)))
(t ; square
(abs-env (list (pwl 0 1 .495 1 .5 -1 .995 -1 1 1 1) (hz-to-step 1.0) t)))))
; Limit to sensible range
(setq lfo (min 1000 (max lfo (/ (get-duration 1)))))
; Convert % to linear
(setq wet (/ wet 200.0))
; check for negative [invalid] frequency value
(cond ((<= lfo 0)
(format nil
"Error\n\nYou have entered an invalid frequency of ~a Hz.
Please enter a frequency above 0 Hz." lfo))
;
(t
; apply tremolo
(mult (sum (const (- 1.0 (/ amount 200.0))) (scale (/ amount 200.0)
(osc (hz-to-step lfo) 1.0 *waveform* phase))) s)))
; set tremolo waveform
(setq waveform
(abs-env
(case wave
(0 *sine-table*)
(1 *tri-table*)
; sawtooth
(2 (maketable (pwlv -1 0.995 1 1 -1)))
; inverse sawtooth
(3 (maketable (pwlv -1 0.005 1 1 -1)))
; square
(4 (maketable (pwlv -1 0.005 1 0.5 1 0.505 -1 1 -1))))))
; from previous commit
; arch-tag: 0ee3925a-8016-44db-91e8-8c4b7a9f3992
;;; Generate modulation wave
(defun mod-wave (level)
(when (= wave 0)
(setq phase (- phase 90)))
(sum (- 1 level)
(mult level
(osc (hz-to-step lfo) 1.0 waveform phase))))
(mult s (mod-wave wet))