XOR Ring Modulator
I'm trying to recreate the "ring modulator" from the Korg MS-20. It works by feeding two pulse waves into a XOR gate to create a harmonically rich sound. I've gone as far as to build an electronic replica of it, but I really want to recreate it in Max.
It doesn't seem like it would be hard to do, since all that is really going on is comparing two signals and spitting out a 1 if they are different form each other, but I'm stumped as to what objects to use.
Any help would be greatly appreciated!
!=~ ?
aa
Well the maths is right, but it sounds different to the real world version. Still, cool sound. Thanks!
... having digital stuff sound like their analog counterparts is not trivial... first thing you surely have to take into account when working with pulse trains, square waves & co. is aliasing. After taming that, you may want to add filtering, waveshaping, some noise and randomness...
hth
aa
Filtering is key, because that's what tames yer aliasing at the end of the day.
In addition to what others have said:
You will encounter the same problem that what we learn in class these days as ring-modulation (*~
) sounds nothing like a germanium or silicone diode ring modulator.
Andrea's tips will give you a more analog sound. If you want to model a specific analog sound there are two general approaches:
Analyze the physics of the circuit you are trying to replicate and model that. This can involve some tricky calculus; for an example of modeling a germanium diode ring modulator: http://www.acoustics.hut.fi/dafx08/papers/dafx08_29.pdf
Figure out what the effect on the signal is and create some code that simulates that. I have had some nice sounding results using the description of a diode ring modulator in Curtis Roads' Computer Music Tutorial. I can't check exactly what he said as my copy is in my storage unit, but something about carrier bleed and momentary clipping (and you'll have to use some waveshaping or something to simulate clipping in an analogue circuit) of one of the signals when it exceeds the amplitude of the other signal.
As others have said, filtering to avoid aliasing, but you will want to upsample your process as well.
P.S.: I realize this post doesn't really help you get it done, but just points out the complexity of this problem—a problem that can be both a challenge and fun/exciting to try to solve.
P.P.S: Both of these approaches are taken when modeling acoustic sound sources as well. Maybe later when I have some more time, I can find some other links that could provide inspiration (I know they are out there, just need to think about what to search for).
Thanks for all the advice everyone
I'll have to look into modelling it. The Korg uses four NAND gates to build up an XOR gate, but I got the same effect using a CMOS 4070 XOR chip. I'd have to model the CMOS chip itself, which is outside my current skill level haha, but I reckon it'd be fun to learn about.
As for filtering, what should I be doing and where should I put the filters? Filter the incoming and outgoing signals to the [!=~] object with a 20 kHz low pass?
Got this technique to work with two pulse trains
Or any other oscillator but what if I want to ring modulate a sample with this technique. Ideas? :)