The drum machine below uses AI to help you create unique patterns. Place some notes on steps 1 through 6, press the “Generate” button, and the AI will fill in the rest. Press “Play” to listen to your AI-assisted creation. Each time you press “Generate,” the AI will create a new pattern.


Our AI is a Neural Network trained using many hours of human drumming. Neural Networks are a type of AI inspired by biological brains, and just like them, they can learn to do many different things: translate texts, recognize faces, play games, or even drive cars. They do this by learning to identify or reproduce relations between elements; for instance, the relations between notes in a drum pattern, what we can call the “structure” in music.

It is possible to create completely random drum patterns, but generally, we respond to them because they reflect biological rhythms, old cultural conventions, genre conventions, or recent trends. All of these factors provide structure.

How to build a drum pattern

Art doesn’t have hard rules, but music sometimes uses handy conventions. Drum patterns very often contain three fundamental elements that Kirk Hamilton (host of Strong Songs, a wonderful podcast that takes songs apart and shows how they work) calls: thump, pop, and sizzle.

The thump is normally provided by the bass drum. It’s a low-pitched, deep sound that acts as a “heartbeat.” In a simple rock rhythm, it’s played on steps 1 and 9.


The pop is typically provided by the snare drum. A louder, more explosive sound played counter to the “thump.” The contrast between thump and pop generates motion and makes people dance. In a simple rock rhythm, it’s played on steps 5 and 13, and it’s called the “backbeat.”


The sizzle is often played by the hi-hat. It’s a bright, constant, recurring sound that provides a backdrop tying all the layers together and makes the subdivisions in the pattern explicit.


You can create more variations with simple operations:

Four-on-the-floor is an extremely popular basic pattern used in danceable genres like Disco and Electronic music. Its name comes from having the bass drum play at the start of every beat (in our drum machine, beats start in steps 1, 5, 9, and 13).


The pattern below is a typical hip-hop rhythm. The hi-hat playing every step creates a feeling of speed. The bass drum notes are displaced from four-on-the-floor, creating a richer more complex beat.


The following pattern comes from Impeach the president, a single by funk band The Honey Drippers, and is one of the most sampled patterns in pop music history. The only differences from our initial pattern are the doubled bass drum and the open hi-hat anticipating the backbeat on step 13, but this is enough to change the way it feels completely.


Our drum machine above also features three toms and two cymbals. When playing drums, these are normally used to create fills and to mark the end of bars or sections. In looped patterns, we can use them to provide color, character, and texture. You can also try using them to provide the thump, pop, or sizzle and see how your rhythm changes.

Classic drum machines

Drum machines are some of the most influential electronic instruments and are the cornerstone of electronic dance music, hip-hop, and other genres.

Early ones used synthesized sounds inspired by real percussion instruments and built by combining oscillators and white noise generators. They didn’t sound realistic, but could provide the same rhythmic functions (like the thump, pop and sizzle). Eventually musicians embraced and sought their unique sound.

Drawing of the Rhythmicon

The Rhythmicon, the first drum machine, was developed in 1930 by Leon Theremin. It used rotating discs with perforations that allowed light (triggered by piano keys) to pass through and activate sensors. It didn’t attempt to imitate a real drum kit but could produce very complex rhythms based on the harmonic series from mathematics.

Drawing of the Wurlitzer Sideman

The Wurlitzer Sideman, from 1959, was the first commercially available drum machine. It could play a fixed series of rhythm patterns in ballroom styles like rumba, waltz, fox trot, and tango using discs that rotated at an adjustable speed. It used vacuum tubes to synthesize sounds like cymbals, brushes, maracas, and drums.

Drawing of the Eko ComputeRhythm

The Eko ComputeRhythm, released in 1972, was one of the first programmable drum machines. It featured a 6x16 matrix of buttons for inputting patterns, which became the basic model for countless drum machines (including our own on this page). It could also read patterns from punched cards.

Drawing of the Linn LM-1

The Linn LM-1 from 1980 was the first drum machine to use digital samples (recordings from real drums) instead of synthesized sounds or tape loops. It could be programmed live, corrected human timing, allowed chaining patterns, and had options for more expressive rhythms, like swing and accents. Many session drummers learned to use it and made it super prevalent in 1980s pop records.

Drawing of the TR-808

The Roland TR-808 also came out in 1980. It used analog synthesized versions of acoustic percussion instruments. At its release, it was criticized for sounding too unrealistic but eventually drew a cult following. It became an icon of electronic, dance, and hip hop, thanks to its unique sound, ease of use, and the availability of cheap second-hand units.

How does our AI work?

The neural network used in the interactive above is a type of neural network called a Recurrent Neural Network (RNN). This is a type of neural network that is well-suited for processing sequences of elements. For example, drum patterns, which are sequences of notes. In the “Melody” chapter, we also use an RNN, except that it was trained on melodies instead of drums.

RNNs are not specific to music. They are used for working with all kinds of sequences, for instance, text translation (sequences of words), speech recognition (sequences of spoken sounds), handwriting recognition (sequences of pen strokes), etc. Our RNN was programmed without any music theory, rules about rhythm, drumming, etc. Each possible percussion instrument is a distinct element (like a letter in its alphabet), and the network learns the relationship between these elements during training. As the network was trained with drum patterns, it learned to produce drum patterns.

Our RNN starts with the initial notes you provide and predicts the most probable note that follows in the sequence. The R in RNN, Recurrent, is there because RNNs perform the same computation repeatedly. After predicting each note, it repeats its process incorporating the last note as part of the input. Once the sequence is complete, we can stop.

A human plays a note on a piano. An AI, pictured as a robot, listens to the note played and plays something on a second piano. The output of the second piano goes to a speaker and also back to the robot to be used as further input.

Each note is predicted using information from the ones that came before. This “memory” allows it to reproduce the structure of a drum pattern, where some notes are related to notes several steps in the past (for example, a Bass Drum sounding every four steps.) This memory, however, is limited in how much structure it can hold and how far back it can go. In the “Song” chapter, we talk about a different and more powerful type of neural network.

Food for thought

Patterns can be written on a drum machine before a live show and then be triggered, have their notes modified, or their sound modulated on stage. They’re a great tool for improvisation and playing to the audience.

How can AIs that can quickly compose music be used in the same way on a live show? What kind of prompts could a musician use to guide the compositions during a performance?


Based on the deep-drum app by Gogul Ilango and the Google Magenta Drums RNN demo.

Copyright and license information in our GitHub repository.


Text is available under the Creative Commons Attribution License . Copyright © 2022 IMAGINARY gGmbH.