I recently found a voice inversion scramble script, but this is written in Perl, I want to know if someone can help me to rewrite this code to Nyquist, I leave below the Perl script and the website with more information
It’s not easy to do in Nyquist.
That script is only using Python to tell SoX what to do. SoX is an advance command line audio editor and processor - a bit like a command line version of Audacity. Nyquist in Audacity is not able to access external libraries, so it can’t use SoX, which means that to accomplish the task in Nyquist you would need to reproduce the processing that SoX is doing in Nyquist, and that is not easy.
Yes, you would do it with Nyquist, but it’s not an easy project.
Below is a link to the “Nyquist FFT and Inverse FFT Tutorial” from the Nyquist documentation.
To do frequency inversion, take the FFT of the sound. For each FFT window, “reverse” the FFT array, then apply an inverse FFT.
When you “reverse” the FFT array, remember that apart from the first and last bins you are dealing with pairs of values and the pairs need to remain in order, so:
r0 i0, r1 i1, r2 i2 … rn in
rn in … r2 i2, r1 i1, r0 i0.