Tremolo with frequency sweep

Hi, I need a Tremolo effect that begin in one determinate frequency and ending in other frequency while increases or decreases for one time specified.

I know programing but not Nyquist.

Someone can help me to merge these two codes to develop my goal?

Frequency Sweep

;nyquist plug-in
;version 1
;type generate
;name "Frequency Sweep..."
;action "Producing frequency sweep..."
;info "by Adam Pope and Paul Schimmel"
;control startf "Start Frequency (Hz)" real "" 20 20 20000
;control endf "End Frequency (Hz)" real "" 20000 20 20000
;control duration "Duration (secs)" real "" 30 1 300
;control level "Level (dBFS)" real " " 0 -40 0
;control type "Sweep scale [1=Linear, 2=Exponential]" int "" 2 1 2
(if (= type 2)
(scale-db level (fmosc 0 (pwev startf duration endf))) (scale-db level (fmosc 0 (pwlv startf duration endf))) )


;nyquist plug-in
;version 3
;type process
;categories ""
;name "Tremolo..."
;action "Applying Tremolo..."
;info "by Dominic Mazzoni, modified by David R. SkynReleased under terms of the GNU General Public License Version 2n'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 highernfrequencies for faster oscillation."

;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 400.0

; set tremolo *waveform* 
(setq *waveform* (cond
((= wave 0) ; sine
((= wave 1) ; triangle
((= 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)))))

; check for negative [invalid] frequency value
(cond ((<= lfo 0)
(format nil 
"ErrornnYou have entered an invalid frequency of ~a Hz.   
Please enter a frequency above 0 Hz." lfo))
; apply tremolo
(mult (sum (const (- 1.0 (/ amount 200.0))) (scale (/ amount 200.0) 
(osc (hz-to-step lfo) 1.0 *waveform* phase))) s)))

; from previous commit
; arch-tag: 0ee3925a-8016-44db-91e8-8c4b7a9f3992

Many Thanks.

That frequency sweep is a neat bit of code.

I’ve stripped out the error checking to make it easier for you to see what is going on (so you will need to be careful to enter sensible parameters).
Basically what I’ve done here is to make both of these scripts into functions, so that they can easily be called within another script.

I’ve also stripped out a couple of the options so as to reduce the number of sliders (the interface was getting rather big).
I’ve put quite a few comments in the code so hopefully you can see what it’s doing.
if you’re interested in learning how to make plug-ins, I’ve listed some useful resources here:
tremsweep.ny (1.31 KB)

checking. I’ll tell you.

Steve, thank you very much. I have no way to express that I feel for your help.

but there is only that correct a detail.

I need that frequency sweep or frequency variation apply to the variation of the tremolo. So tremolo frequency sweep should be applied to any sample sound like voices, etc.


Manual results here with waveform type square, start frequency 1hz, end f. 15hz:

Uploaded with

friend, learn the language requires some time which I haven’t now, if you help me with this detail I’ll be immensely grateful. That all intelligence comes to you.

I think is see what you mean.
You want to be able to apply tremolo and a “sliding speed/pitch change” to a sound (any sound) so that as the pitch varies then so the tremolo speed also varies?
Like this sample?

No, the only that should vary is the tremolo frequency while time passes.

Applied the tremolo over sound, sound should remain intact with the same pitch.

Only the “vibrator” should vary from one value to other (Tremolo frequency)

I hope you understand me.

Like this:

OK - give me a couple of days, I’ll see what I can do.

Thanks, I’ll wait.

I’ve posted the new plug-in here:

  • Thank you very much. You’re a genius in the field. Was perfect. Success in your life. -

Hello and please excuse me for resurrecting this thread.
I am not familiar with Nyquist and I really need to do the function in quotes above, so to vary the tremolo depending on the base pitch.

So I have say a sine wave tone varying between 50 - 200 Hz and I want to create three different tremolo frequencies based on the frequency of the sine wave.

For example:

If input wave is between 50 - 100 Hz: use tremolo with a 30Hz frequency
If input wave is between 100 - 150 Hz: use tremolo with a 60Hz frequency
If input wave is between 150 - 200 Hz: use tremolo with a 90Hz frequency

Is there a quick fix I can apply to the plug-in in order to do this?

Thank you very much.

If you want the plug-in to automatically detect what frequency the tone is, then that is possible, but is not a “quick fix”.
What’s the “job”? (What are you wanting to do / what is it for?)

Topic split to: