vocoder without voice in the output?

Music music's icon

Hello all,

I'm pretty new to Max and I was wondering if you can help me figure out how to go about this.

I want to create a patch that tracks the amplitude and pitch of an incoming signal (microphone) and then uses that information to adjust the pitch and amplitude of an oscillator. Basically a vocoder, but without the original signal's sound being in the output.

I can get the pitch tracking to work with fzero~ but I can't get the amplitude side working without clicks or noise of some kind. I've searched and can't seem to find any solutions on the forum.

Thank you for your time.

Martin Beck's icon

Can you provide a patch that shows the clicking problem?
What do you use to extract the amplitude?

I would recommend to use [M4L.envfol~]

Actually a vocoder as far as I know is a filter bank of multiple fixed bandpass filters that generates envelopes and applies these envelopes to the amplitude control of another filter bank which filters a target sound.
So you seem to do something different than a normal vocoder when you use fzero~ to track the pitch.

Music music's icon

Thank you for your response!

I've tried a few different methods to get the amplitude, but I think what you said about the vocoder being a filter might be the reason. That makes a lot of sense why its not working. My goal was to extract only the amplitude information from the vocoder and then multiply the additive synth output so it follows it.

This patch seems to follow the amplitude the best, but I get a lot of glitchy type sounds. Would using an envelope be able to match in realtime?

Sorry if this is at all crazy and makes no sense, I am very new to Max.

Thank you!

PolySynth_freq2.maxpat
Max Patch

Martin Beck's icon

Hi, I am currently without computer.
This article might be interesting for you https://cycling74.com/tutorials/the-phase-vocoder-–-part-i
When you search the Max forum for vocoder you will also find a lot of hints most people recommend using a filterbank like [fffb~ ] for the source analysis and an envelope follower array like multiple [M4L.envfol~] feeding into another target [fffb~ ] .
This is working on audio sample rate.
More sophisticated vocoders also use special signal paths with noise as target for better reproducing consonant sounds like s, t, z. Amplitude compression is crucial especially for speech as source audio.

Martin Beck's icon

Your approach is not a vocoder. It is more a kind of additive synth which frequency is driven by [fzero~].
This won't give vocoder like effects as it only tracks the fundamental frequency and you add some harmonics with constant amplitude ratio to it. The way a vocoder works is different as it filters the target sound in a way that it also yields non harmonic properties and it also modulates amplitudes of harmonics and formants.
Here is your patch modified to use a single envelope follower solving your click issues.

Max Patch
Copy patch and select New From Clipboard in Max.

Have look at Max' file browser and type in vocoder. There are plenty of examples.
https://en.wikipedia.org/wiki/Vocoder

tmhglnd's icon

As Martin suggested, you would need some kind of envelope following. Your sound is now very glitchy, because there is no smoothing over time, and audiosignals range from -1 to 1 floating point values, so amplitude multiplication is all over the place. Here is your patch with some basic envelope following using [abs~] and [slide~] to control the gain. Also check out [oscbank~].

Max Patch
Copy patch and select New From Clipboard in Max.

Music music's icon

Thank you for your replies and for your help! This is exactly what I was looking for. Both are great solutions!

I was wondering are the values of 441 and 44100 in slide are those for a reason? I've never used that object before, but it looks great!