Each electronic musician has their unique techniques for achieving this effect, but more often than not, it involves the use of something called a Vocoder – Voice Encoder. Developed in 1928 by Homer Dudley, a Bell Labs
The vocoder works by examining speech, to measure how the character (timbre) of a voice changes over time. The signal is split into frequency bands (the higher the number of frequency bands, the clearer the signal), and the level of signal at each frequency band at every point in time is noted. At this point, speech is said to be ‘encoded’. To recreate speech, it works in the opposite direction, by passing broadband noise through a stage that filters the frequency content based on the originally recorded series of numbers. Speech is thus said to be ‘decoded’.
So, vocoders typically have two input signals. The carrier and the modulator. As the name implies, the carrier is the main sound (your voice), the backbone of your arrangement, and the modulator is the signal that changes the timbre of the carrier. The modulator takes your voice, finds the most important frequencies, and imposes its own frequencies on them, so that the character of your voice remains, but all pitch information is changed.
Using a human voice as the carrier, and a simple saw wave as the modulator is the most common example of creating the robot voice trope as we know it today. As you may have guessed by now, in film production, monster voices are typically created by using the human voice as the carrier, and lion roars and dog growls as the modulator. This created the illusion of intelligible speech, but gives the voice a much harsher character than the human vocal cords are capable of producing. Recent examples are Batman’s voice in The Dark Knight Series, Optimus Prime in the movie Transformers, and practically every alien voice in every alien movie on earth.