Drum machines can be programmed to play any beat or combination of beats that the user desires. The main difference between the machine and a drummer is that the live drummer can switch beats more quickly than the machine, and the sound quality is not quite the same as live drums.
Drum machines produce beats and rhythms in a similar fashion to a live drummer. Users program which drums they want to sound and the tempo they want the beat to be conducted in.
The first "rhythm machine" was developed in 1930 by Leon Theremin, though these early machines were very primitive compared to the modern drum machine.
Many recording studios now use drum machines instead of hiring live drummers for their commercial recordings, including TV and radio spots, and movie soundtracks.
Drum machines are cheaper and easier to carry around than a drum kit; their small size also allows them to fit in a smaller area of a performance or practice space.
Some musical purists detest drum machines as they feel that there is no substitute for a live drummer in any musical situation.