Ynzn's Amplitude Modulator + Demultiplexer

Enhanced Version

by Christiaan Janssen

What's it?

This machine demultiplexes the signals that come from the Ynzn's multiplexer and performs an amplitude modulation with them. It comes with the sourcecode to show other machine developers how to demultiplex two signals, so they can be used in their machines.

How used it to work?

First, it copied the signal into two buffers: modulator and carrier.
Then it filtered the modulator and the carrier to remove the undesired signal and reversed the carrier's spectrum. After that it performed the amplitude modulation.

What has changed?

If you listen to it you will hear exactly the same. But I have introduced a few changes in the sourcecode so now it's faster. You'll see the difference in the CPU usage.
Now it has only one buffer for the carrier and no buffer for the modulator. The psamples buffer is used as modulator. Even more, the buffer is created in another part of the program, which is not called as often as the old one was. Creating a buffer is a bit slow.
It filters the two signals in the same way that the other did.
And it performs both demultiplexion (invert carrier's spectrum) and modulation at the same time.
Another minor change is the place where the constant is divided by 100.

The AM formula is:
output = modulator * [carrier + (floor / 100)]

Usage

> P a r a m e t e r s

ModCutOff | The cutoff frequency of the modulator's filter (lowpass). It may be changed to avoid aliasing.
CarCutOff | The cutoff frequency of the carrier's filter (highpass). As before, you can change it to reduce aliasing effect
AbsFloor | Changes the constant that the machine sums to the carrier. If you want a tremolo-like effect reduce the carrier's volume and raise this parameter.

Source Code

This new sourcecode is not as instructive as the old one, so I've preserved that in the zipfile. You can compare them to see how a machine can be improved to get faster results.

Notes

The output will have surely a big saturation. To avoid it reduce the input volume of the signals to -30dB or so. The floor value is divided by 100 for this purpose.
Watch the demosong to see how to connect the multiplexers and this machine. You will notice that only one multiplexer is needed, and the other one isn't necessary. I've kept it there for the same purposes as my old slow code: to serve as an example.
If you try to hear what happens when you put no carrier or no modulator you'll see it sounds, while it shouldn't. This happens because of the aliasing. The mid frequencies of the signal are being considered part of both the modulator and the carrier, so the machine thinks there is a modulator and a carrier. You can change the cutoff values to avoid this, or you can put another (more selective) filter before the Mux. Maybe Asedev's 4p filter.
There are people who have found it useful. I'm surprised! Maybe in a close future I'll see good songs that use this effect... I can't believe it...

Author | Christiaan Janssen "Ynzn"
Email | cjan5813@alu-etsetb.upc.es