A drum machine is any electronic device which imitates a drum kit or percussion. These were often designed as a replacement for a drummer and are still often used as such, but many bands and producers prefer the unique electronic sounds, rather than a real drum kit, in many situations.
In addition, many producers will combine drum machines and real drums together in one track. Techniques such as sampling a real drummer and manipulating his or her rhythms, or playing with classic drum-machine sounds triggered by a real player from an electric drum kit mean that the lines between human and machine are often very blurry indeed.
(It should be noted here that if you’re aiming to be a professional drummer then you should get used to hearing a small range of drummer-jokes, often comparing us unfavorably to drum machines. For example: The difference between a drummer and a drum machine? You only have to punch the information into the drum machine once.
The tellers of these jokes can not be reasoned with. My advice is to let them have their little laugh and go stoically about your business knowing that deep down they secretly wish that they were a drummer too.)
Drum machines can be sorted in to two basic categories: synthesizers and samplers. There are many different types of synthesizer, but very basically they use tone-generators and filters to produce different sounds. The sounds produced are often fairly unconvincing but have been embraced by musicians all the more because of this fact.
The most famous synthesis-style drum machine is the Roland TR-808, first made in 1980. Its deep kick-drum tone and funky claps can be heard all over hundreds of songs, especially Hip-Hop.
A typical drum machine is shown in the following photo. Each of the 16 large buttons along the bottom corresponds with a drum sound. Patterns are played in by hand, usually one drum at a time as it loops.
The patterns can be quantized - made to be perfectly in time with your chosen grid (16th notes, 32nd notes, triplets etc.) - if desired. The length of the loop can be anywhere from one bar to hundreds. Drums can be individually tuned (pitched up or down) and specific components can be altered in different ways - decay for the crash cymbal, a "snappy" setting for the snare etc.
Samplers have had a greater impact on hip hop. The E-MU SP-1200 had a massive impact on hip hop when released in 1987.
Producers can record samples from vinyl (or wherever) onto the eight channels and play them back in any way they like.
One notable example of this is the "Amen break" - in the 80’s it became very common for people to sample G. C. Coleman’s drum break from the Winston’s 1969 song "Amen Brother" on the SP-1200 or something similar and chop it up for their own purposes. Samples from this particular break can be heard in literally thousands of songs, including almost every "drum and bass" song.
Akai’s MPC series have been amongst the most popular samplers since their introduction in 1988. They were initially designed by Roger Linn, who created the first digital drum-machine in 1979.
The trademark grid of 16 large, square pads are velocity sensitive (soft hits will sounds soft, hard hits will be accented) and reliable enough to play as a live instrument. The MPC provided unprecedented flexibility in manipulating samples.
Many drum machines and most software-based instruments can be controlled with MIDI - Musical Instrument Digital Interface. MIDI is simple electronic signals which contain information about the note being played: when it starts, pitch, velocity and when it ends.
(It can also contain information about other attributes, such as vibrato, sustain pedal etc.) MIDI can be generated by an electric instrument such as keyboard with MIDI out or an electric drum kit, or it can be programmed manually.
This is a typical "piano-roll" style MIDI interface. The x-axis (horizontal) represents time - the grid is set to be 16th notes. The y-axis (vertical) represents different notes, or in this case, different drum samples, already stored on the computer. The height of the bars seen underneath each note represent velocity.