Drum machine

One bar of four beats, and a choice of how finely each beat is divided: into two (eighth notes), three (triplets, the 12/8 feel), or four (sixteenth notes). Draw a pattern by clicking cells, then change the subdivision and hear how the same four beats carry a different density and a different style. Each hit has one of three loudness levels, so you can also give the pattern a metric accent, and a swing control delays the off-beat subdivisions, which is the subject of a later section.

Subdivision of the beat
Each thick line starts a beat. Click a cell to cycle its hit through medium, strong, soft, and off; the fill shows the level. The pattern is kept when you change the subdivision, as far as the positions exist on the new grid.
Presets
Styles:
The style presets also set the tempo and the swing. Each is a one-bar sketch of a style's core pattern, reduced to kick, snare, and hi-hats; the snare row stands in for rim, clave, or comping where the style has no backbeat, and the closed hi-hat row for ride or bell.
Accents:
Feel and reference
Swing ratio:
The slider gives the share of each pair of subdivisions taken by the first note; the ratio is that share against the rest. Every second subdivision is delayed accordingly, so a pair of eighths or sixteenths becomes long–short. It has no effect on the triplet grid, which is already long–short by construction.

Things to try: keep the rock pattern and switch to sixteenths, then to triplets, and notice that the beat has not changed while the feel has. Put hi-hats on every step at each subdivision and raise the tempo until the subdivisions stop sounding like separate events. Set only beat 1 with the subdivision tick on and count the divisions aloud. The space bar starts and stops.