I was recently trying to create a sine wave frequency sweep audio sample file to test out a digital signal processing (DSP) filter I was trying to write. Using Audacity, you can create plug-ins to achieve all sorts of cool effects. After a little experimentation I came up with the following code:
;nyquist plug-in
;version 3
;type generate
;name "Frequency Sweep"
;action "Producing frequency sweep..."
;info "by Adam Pope"
;control startf "Start Frequency (Hz)" real "" 1 0 20000
;control endf "End Frequency (Hz)" real "" 10000 0 30000
;control duration "Duration (secs)" real "" 20 1 300
;control type "Sweep scale [1=Linear, 2=Exponential]" int "" 1 1 2
;control other "I dont know what this does" real "" 5 0 100
(if (= type 2)
(fmosc startf (pwe duration endf other))
(fmosc startf (pwl duration endf other)) )
Copy this code into a frequencysweep.ny file and place it in your Audacity plug-ins directory. You’ll need to restart audactity for it to register the new plug-in. Once you’re back in, click on ‘Generate’ on the menu bar and select ‘Frequency Sweep’ from the list of options. You will then be presented with a dialog containing sliders to play with the parameters of your sweep. If any of the limits are too restricitve for you, simply change the values in the plug-in file!
If anybody can explain what the 3rd parameter of pwe and pwl does, I’d love to know!











Adam, you can ask about Nyquist on the Audacity-Nyquist list
https://lists.sourceforge.net/lists/listinfo/audacity-nyquist
By the way, this is a ;vertion 1 plug-in, ;version 3 plug-ins
have additional special features which aren’t in your plug-in.
Best
David Sky
Sorry Adam, you only managed to recreate Generate -> Chirp…
Better luck next time!