Custom FM/AM smoothly changes in time

Hi,

I want to ask how to generate a tone that smoothly changes amplitude and frequency at a given time
for example:
100 Hz to 101 Hz amp 0.9 stretched in 60sec, next (from 101hz) to 103 Hz amp. 0.8 stretched in 30 sec, to 105 Hz amp. 0.7 stretched in 120 sec, and so on

How to create this using Nyquist :question:

Please help,
Michael



;type generate
(mult 0.9 (hzosc (pwlv 100 60 101)))





;type generate
(mult 0.8 (hzosc (pwlv 101 30 103)))

but note that if you want it to go smoothly from the 100/101 Hz tone to the 101/103 Hz tone, then you need to also define where the amplitude changes.

Example, if you want it to go smoothly from:
100 Hz, Amp 0.9
to
101 Hz, Amp 0.9
to
103 Hz, Amp 0.8
then you can do that like:

;type generate
(setf gain (pwlvr 0.9 60 0.9 30 0.8))
(setf freq (pwlvr 100 60 101 30 103))
(mult gain (hzosc freq))

but if you want it to go smoothly from:
100 Hz, Amp 0.9
to
101 Hz, Amp 0.8
to
103 Hz, Amp 0.8
then you need

;type generate
(setf gain (pwlvr 0.9 60 0.8 30 0.8))
(setf freq (pwlvr 100 60 101 30 103))
(mult gain (hzosc freq))

Thank You, I look easy,
the last code in your message is repeated is that correct?


Michael

Halo Steve,
I’m trying to implement/use part of your code in my plugin how should I mention this fact?

Thank you

It is customary to mark plug-ins as licensed under GPL v2 (GNU General Public License v2.0 - GNU Project - Free Software Foundation) or GPL v3. (Audacity is licensed under GPL v2).

Typically this is done by adding the plug-in header:

;copyright "Released under terms of the GNU General Public License version 2"

and optionally a comment:

;; Released under terms of the GNU General Public License version 2:
;; http://www.gnu.org/licenses/old-licenses/gpl-2.0.html

Under GPL v2, you can reuse code from any other GPL v2 plug-in, provided that your plug-in is licensed under compatible terms (easiest to just stick with GPL v2).

Any code that I have posted on this forum is free to use in any open source project.