export individual partials?

Using Nyquist scripts in Audacity.
Post and download new plug-ins.
Forum rules
If you require help using Audacity, please post on the forum board relevant to your operating system:
Windows
Mac OS X
GNU/Linux and Unix-like
Post Reply
DGByrned
Posts: 12
Joined: Fri Feb 08, 2019 5:37 pm
Operating System: macOS 10.15 Catalina or later

export individual partials?

Post by DGByrned » Thu Oct 08, 2020 10:16 pm

Hey there!

I've done a tiny bit of Nyquist scripting, but I couldn't sort out if there was a way to do this:

I want to create separate WAV files of sine tones for a fundamental frequency, and a set number of harmonics. Seems like something should be possible like:


(start a loop)

Generate tone @ 60 hz, set amplitude, set duration

export to WAV

increment by 60hz to get the next partial,

export

end loop after set amount of partials (maybe 100)?


just can't sort out from the documentation how to do it. Any help would be greatly appreciated!!!

thanks so much

DGB

steve
Site Admin
Posts: 81244
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: export individual partials?

Post by steve » Thu Oct 08, 2020 10:24 pm

The "latest version" plug-in in this post should help with the tone generation. (Ignore the filters - they are just to make the waveforms prettier)
viewtopic.php?p=156631#p156631
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

DGByrned
Posts: 12
Joined: Fri Feb 08, 2019 5:37 pm
Operating System: macOS 10.15 Catalina or later

Re: export individual partials?

Post by DGByrned » Fri Oct 09, 2020 12:57 am

Thanks so much!

The plug-in generates a tone, so then I would have to use it in a macro? Or would I still need to write a nyquist script to create the loop to export the multiple partials, without having to do it all by hand that is?

Thanks!

steve
Site Admin
Posts: 81244
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: export individual partials?

Post by steve » Fri Oct 09, 2020 8:51 am

Exporting directly from Nyquist is "possible" but it's quite tricky, very "technical", and not very user friendly. (There's an example of exporting text files in the "Sample Data Export" plug-in - exporting audio files is even more tricky because you have to also handle file format settings).

I would recommend either using a Macro or generating lots of tones in one project and then using Export Multiple.

One strategy for using Macros could be to create a load of dummy file (they can be multiple copies of 1 second of silence), so that you can batch process those file (though not actually using any audio in the file - the dummy files basically act as a loop counter). You would need some way to change the parameters of the tone generator on each run - perhaps using *SCRATCH*.

One strategy with "Export Multiple" would be to create a project with say 10 or 20 empty audio tracks - select them all, then generate tones into each of the tracks. A "generate" type plug-in iterates over each selected track. Again you would need to change the tone generator settings on each run. You could for example use (get '*track* 'index) as a counter.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

DGByrned
Posts: 12
Joined: Fri Feb 08, 2019 5:37 pm
Operating System: macOS 10.15 Catalina or later

Re: export individual partials?

Post by DGByrned » Fri Oct 09, 2020 7:24 pm

Ah, got it!

Thanks so much for trying to help. I'm trying to avoid having to manually type in the hz for each partial, and since it's simple math i feel like it's a better job for a computer : )

Gonna try to do it with python or SoX. I'll see if I can figure that out.

Thanks again!

DGB

Post Reply