fft spectral filter tune
Hello,
I do not know if this already exist, maybe someone can help with this.
using a spectral filter in order to "tune" a sound into a chromatic scale. For example using FFT and multiply some bins (fundamental +harmonics) like a filter in the frequency domain. I think vector size and sample rate used determine the frequencies multiples you can manage, so you must adjust them with the specified harmonics frequencies.
sounds like an interesting thing to try.
firstly when you say vector size you really mean fft size? So changing the fft size can only be done in multiples of 2, which means you can't really fine-tune to a fundamental except in terms of overall resolution-- so the best thing to do would be have a fairly large fft size to increase resolution.
nextly, fft bins are called bins for a good reason-- they are fixed, you can't "move" them around-- what you can do is move the "contents" of one bin into another etc, ie the magnitude and phase data into a different bin, so the best you could do I guess is something like this:
have a generalized "harmonic frequency to bin-number" function (as an abstraction), so if you put in the number 440 (hz), sample rate and fft size it will spit out the *closest* bin numbers of each harmonic as a list. This is a list of "valid" bins. Then with this list, construct some sort of table which maps each bin of an analysis fft into the closest valid bin. Because this is a many-to-not-so-many mapping, you'll get the information from more than one bin being moved into valid bins, so you might want to weight the data according to how far it has to move. Also there's the issue of combining phase and mag data from different bins-- addition, or interpolation? risk of it becoming "meaningless" (ie perceptually dislocated from the process)
Maybe as a simplified prototype, would be simply to make zero only data that's not in a valid bin.
Regarding sample rate, that's a good idea, but try a simpler strategy first. I'm not sure if, in a poly~, you can change the sample rate on the fly? Might have to use scripting to instantiate a new poly with new sample rate, turn audio off then on again? I might be wrong there as I haven't used version 7 much, and it might have dynamic sample rate changing...