# How to add amount control to amplitude modulation?

I'm trying to implement amount control to amplitude modulation similar to the amount control of frequency modulation. The more amount, the more amplitude variation. The problem is that I can't figure out how to implement it correctly.

Here is a simple amplitude modulation patch in pure data: The idea is that when no amount is applied, no modulation can be heard, and as the amount is raised the modulation becomes more prominent, and when the amount is at the max the carrier's amplitude is being modulated all the way to zero amp.

But how do I do that? Here is a patch where there is a control for the amplitude of the modulator: The problem here is that, as we are multiplying both signals, the control also lowers and raises the amplitude of the carrier. So when the "amount" is zero, there is no signal. That "amount" control ends up modifying the amplitude of the carrier too. It's not so much of an amount control, and ends up being a volume control for the carrier too.

How can an amount control for amplitude modulation be implemented? At the lowest amount there is no modulation, and as the amount rises the modulation becomes more intense. Is there a way to do this?

You basically need to build a cross fader. On one side you have your AM signal, on the other you have a steady signal of 1. You then cross fade over to the AM signal and voila!

I've not got time right now, but will knock one together tomorrow if you're still stuck. If you do solve, it why not post back with the solution as an answer.

I got this solution from the PD mailing list.

You can place the signal addition of the modulator ([+~ 1]) after the multiplication with the slider, right before you multiply that signal with the carrier. But instead of 1, multiply with 0.5. So the modulator could look like this:

```[osc~]
|
[*~ 0.5]
|
[*~ modulation_amount] (0 to 1)
|
[+~ 0.5]
```

With no modulation, the carrier's signal will be at 0.5, and with full modulation it will modulate between 0 and 1.

I really liked this approach, and works really well.

This is an example of the implementation: I've used:

`(1 - Modulator * Amount) * (Input)`

• Modulator is a 0 to 1 ranged modulation signal.
• Amount range is 0 to 1. 1 = Full effect. 0 = No effect.
• Input is your audio signal.
• When the amount is 0 you'll have `(1-0) * (Input)`. This method won't work with [-1, 1] ranged modulation signals. Sep 6, 2014 at 10:59
• @JCPedroza: What -1? Sep 6, 2014 at 11:40
• Never mind, I'm brain farting. Sep 6, 2014 at 11:49