How do I shape a Sine with feedback

Andy Fennesz's icon

In the analog world, I know I can flatten a sine wave, so that it spends more time near its extremes than near its middle, by routing it through a VCA, and connecting a copy of it to the VCA's control voltage input. See attached.

How do I do this in Max? I thought a VCA is just equivalent to multiplication, but if I multiply a Max sine by itself, I just end up with a wave double the frequency. Possibly I'm missing something incredibly obvious. Thanks for your input.

Nick Holmes's icon

The sample values normally range from +1 to -1. If you have simply squared these values, you will have flipped the sign of the negative values and rectified the signal, hence the doubling of frequency. Easy to fix - you should multiply the signal by its absolute value, e.g. with [abs~].

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

Roman Thilenius's icon
Andy Fennesz's icon

Thank you, both.