Edgar: > … I get memory problems (don’t ask me why)
Steve: > OK, I’ll not ask why
That’s good because I still have no answer…
The separation of the "osc"s to prevent memory problems is done automatically by “multichan-expand” in the last line of the plugin code. The random “phase” value must be different for every vocoder band to prevent a nasty phase sweep effect in the first few seconds, but must be the same value for both stereo channels, otherwise the vocoder sounds sh*t with stereo tracks.
I first had tried to write a “vocoder-band” function that automatically handles stereo sounds, using one “osc” for both stereo channels, but was unable to get rid of memory problems. I still have no idea why this happens.
Steve: > am I right in thinking that’s what this bit of the code is all about…
There are two remainders from previous vocoder versions, the “distance” and the “alternate” variables (directly below the plugin header).
“distance” is a factor to compute the lowpass filter frequency from the mid-frequency of the vocoder band. This works similar like the Nyquist sound-srate and control-srate relationship, which in CMU_Nyquist (but not in Audacity) is defined as:
*control-srate* = *sound-srate* / 20
In the vocoder the lowpass frequency (producing the modulation envelope out of the “modulator” signal) is defined as:
lowpass-frequency = band-mid-frequency / distance
This way every vocoder band has a different lowpass frequency, what prevents the vocoder from sounding “static” (= boring).
In some previous vocoder versions there had been a “distance” slider in the plugin interface, but it has turned out that a value of 20 (like in CMU_Nyquist) seems to be the best possible compromise between “too much voice signal comes through” (distance too low) and “too much mumbling in the speech” (distance too high). Reasonable values for “distance” are from 2 (Nyquist frequency) to approx. 100 if you want to try it yourself.
“alternate” controls the transition between the vocoder bands. With alternate=0 all vocoder bands are added with the same phase, with alternate=1 every second vocoder band gets inverted before added.
With alternate=0 it’s like:
With alternate=1 it’s like:
(scale -1 (band-2))
(scale -1 (band-4))
Another idea: I think it could be possible to write a “unified” Vocoder if the computition of the “waveform” signal is controlled via Lisp macros.
As soon as I have time I will write a “Vocoder Internals” page with all the details explained with pictures. I think all this then will be easier to understand (most of all for me myself…)