Your EDM.2 capstone has six layers. Sounds like a track. But it’s flat: no ghosts, no width, no cross-rhythm. This lesson adds what turns a pattern into a groove.
Repertoire: Wind Scene (Yasunori Mitsuda, Chrono Trigger, 1995) and Spring (ConcernedApe, Stardew Valley, 2016). Both are three voices breathing together: melody, accompaniment, bass. Same architecture, different aesthetics.
Parallel composition: Adding a second melodic voice to your ambient piece. The shakuhachi ghost. Four layers now.
What you already know: s(), note(), stack(), setcpm(), mini-notation, .gain(), .lpf(), ADSR, .add(note()), sine.range(), and the drums + filtered reese from EDM.1–2.
Four kicks, evenly spaced. One per beat:
Now three claps in the same amount of time:
Stack them:
The kick divides the cycle into four. The clap divides it into three. They line up on beat 1 and pull apart everywhere else. That tension is the groove.
Two or more patterns with different subdivisions running over the same time span. Three against four. Five against eight. They share a downbeat but disagree on everything between.
Replace the clap with s("cp cp cp cp cp"). Five against four. Try s("cp cp cp cp cp cp cp") for seven against four. More hits, more tension.
Euclidean patterns generate polyrhythm. Stack two with different hit counts over the same grid:
Three kicks. Five claps. Eight slots. Two grids interlocking. Change the numbers and the whole groove shifts.
Try s("bd(5,16)") against s("cp(7,16)").gain(0.6). Sixteen slots, more room. Add a third layer: s("hh(11,16)").gain(0.3).
A cross-rhythm is a polyrhythm where the two subdivisions are coprime (no common factor except 1). Three against four is a cross-rhythm because 3 and 4 share no factors. Six against four is not, because both are divisible by 2.
The most common cross-rhythm is 3:2. Two beats in one hand, three in the other. It shows up everywhere: West African bell patterns, Afro-Cuban clave, jazz ride cymbal.
The 4-beat grid (orange) and 3-beat grid (blue) only coincide at the start of each cycle. Every other hit lands in a gap. That’s where the rhythmic interest lives.
West African music is built on polyrhythm. The master drummer plays a timeline pattern while other drums play interlocking parts with different subdivisions. Each player hears a different “beat 1.”
The bell pattern in Ewe music (Ghana) is a 12-pulse timeline where different drums divide those 12 pulses into groups of 2, 3, and 4 simultaneously. Three against four against six. That’s what you built with stack() and euclidean patterns.
For more on West African polyrhythm: Novotney, “The 3:2 Relationship as the Foundation of Timelines in West African Musics” (1998).
Polyrhythm is one kind of layering. Another kind: independent melodic voices playing simultaneously. Listen to how Yasunori Mitsuda layers three voices in the Chrono Trigger Wind Scene:
Three layers. Each one has a different rhythm. The melody moves in steps. The accompaniment arpeggiates chords. The bass holds the foundation. They breathe together because each has space the others don’t fill.
Now the same architecture, simpler. Stardew Valley — Spring (ConcernedApe, 2016):
Same three-voice structure. Melody on top, chords in the middle, bass on the bottom. Mitsuda makes it shimmer. ConcernedApe makes it cozy. The architecture is identical.
Three voices is enough. Melody, accompaniment, bass. If each voice has its own register (high, mid, low) and its own rhythm, they won’t collide. That’s what stack() is for. Not just playing things at the same time. Giving each voice room.
The breakbeat from EDM.1. Kick, snare, hats. Clean and functional:
Now add a quiet euclidean snare underneath:
The main snare still cracks on beat 3. The ghosts fill in around it, quiet enough to stay behind but loud enough to add motion. The beat stopped being a grid. Started being a groove.
Quiet hits between the main beats. Drummers play them naturally. Programmed beats usually miss them. Notice the difference: a pattern that ticks vs. one that breathes.
Same idea, different drum. A euclidean kick layer at low volume:
The ghost kick shuffles underneath the main pattern. It fills spaces without fighting the downbeat.
Change (5,16) to (3,16) for sparser ghosts. Try (7,16) for busier. Adjust .gain() between 0.15 and 0.3. Too loud and they compete. Too quiet and they vanish.
Hi-hats at one volume sound robotic. Pattern the velocity and mix in an open hat at the end of the bar:
The gain pattern creates accents. Quiet, medium, quiet, loud. Your ear locks onto the accents, not the individual ticks.
Try .gain("0.2 0.6 0.3 1") for harder accents. Or s("[hh hh hh oh]*4") to put an open hat every fourth hit. Different rhythmic feel, same number of sounds.
Everything so far plays dead center. A single point between your ears.
.pan() places a sound in the stereo field. 0 is full left. 1 is full right. 0.5 is center. Listen to the hats in this version:
Now the same beat with two hat lines panned apart:
Wider. Each hat has its own space. The kick and snare stay centered. Use headphones for the clearest difference.
.pan(0) = left ear. .pan(1) = right ear. .pan(0.5) = center. Heavy sounds (kick, snare, bass) stay centered. Light textures (hats, percussion) spread to the sides.
Static pan is placement. Moving pan is motion:
.pan(sine.slow(2)): the hats sweep left to right over 2 cycles. Notice the movement is spatial now, not just rhythmic.
Try .pan(sine.slow(8)) for a slower sweep. Or .pan(perlin.range(0.2, 0.8)) for random wandering that avoids the extremes. perlin is a smooth noise signal.
Low frequencies have long wavelengths. A 50Hz wave is about 7 meters long. Your head is about 0.2 meters wide. Your ears can’t tell which direction a 50Hz sound comes from because the wave wraps around your skull before the ears register a difference. Low-frequency panning is wasted information.
Most club sound systems run the sub in mono. Everything below ~120Hz gets summed to a single channel. If your bass is panned hard left, half its energy disappears on summing. Center bass = full power on every system.
Kick, snare, and bass: center. Always. Hats, rides, percussion: spread them. Effects (delay tails, reverb, pads): go wide. The low end anchors. The top end decorates.
That’s why none of the bass patterns in EDM.2 use .pan(). The reese stays at 0.5 (the default). The stereo width comes from everything else.
Your ambient piece has three layers: koto, pulse, bass drone. Now add a second voice. Something that breathes in the spaces the koto leaves. A shakuhachi ghost:
Four voices. The koto and shakuhachi interleave. Where the koto plays, the shakuhachi rests. Where the koto rests, the shakuhachi enters. Same principle as the Wind Scene: each voice has room because the other voices leave space for it.
Change the shakuhachi notes. Try note("~ ~ a4 ~ ~ ~ d5 ~"). The relationship between the two melodies is the composition. Pan the shakuhachi: add .pan(0.7) to spread it right while the koto stays centered.
Everything combined. Kick, snare, ghost snares, stereo hats, open hat, an alternating reese, and a melodic stab. Ten layers. One track.
note("~ <g4 ab4> ~ <eb4 f4>") for higher, brighter notes. Or note("<[~ eb4 ~ c4] [~ f4 ~ eb4]>") for two hits per cycle.s("ride(3,8)").gain(0.25).pan(0.6). The ride cross-rhythm weaves through the hats."<[c2 ~ eb2 ~] [c2 ~ g1 ~] [c2 c2 f2 ~] [eb2 ~ c2 ~]>" for a 4-cycle phrase instead of 2.| tool | does | looks like |
|---|---|---|
| .pan() | stereo position (0=left, 0.5=center, 1=right) | .pan(0.3) |
| .pan(signal) | automated stereo movement | .pan(sine.slow(2)) |
| perlin | smooth random noise signal | perlin.range(0.2, 0.8) |
| ghost layer | quiet euclidean pattern under a main hit | s("sd(3,16)").gain(0.2) |
Kick and snare: centered, loud. Ghost layers: euclidean, quiet. Hats: panned, dynamic gain. Bass: centered, filtered. Everything in a stack().
Next: Atmosphere. Genre shift to phonk. The 808, dark chords, reverb, and space.
Tracks that demonstrate this lesson’s concepts.
| artist | track | why |
|---|---|---|
| Yasunori Mitsuda | Chrono Trigger: Wind Scene (1995) | (VGM) inspired by the three-voice texture: melody, arpeggio, bass |
| ConcernedApe | Stardew Valley: Spring (2016) | (VGM) three-voice folk architecture, joy in simplicity |
| Photek | Ni-Ten-Ichi-Ryu (1997) | (DnB) drum programming so intricate it seemed inhuman |
| Goldie | Timeless (1995) | (DnB) 21 minutes of impossibly layered production |
| Noisia | Stigma (2007) | (neurofunk) polyrhythmic interplay reframes the groove |
| Ewe Drum Ensemble | Agbadza (traditional) | (DnB) master drum + bell + rattle: the original polyrhythmic stack |
Polyrhythm isn’t a technique. It’s a worldview — the idea that multiple independent rhythmic voices can coexist without a single “correct” beat.
The Ewe people of Ghana use a bell pattern (the “standard pattern”) as a timeline against which multiple drums play independent, interlocking parts. Each player hears a different “beat 1.” The master drummer (atsimevu) controls the ensemble but doesn’t dictate individual parts. The music is the relationship between the layers, not any single layer. Ethnomusicologist A.M. Jones documented these structures in Studies in African Music (1959), one of the first Western academic accounts of polyrhythmic practice.
The clave pattern (3+2 or 2+3) arrived in Cuba via the slave trade. It became the organizational principle of son, rumba, salsa, and eventually Latin jazz. The clave isn’t the rhythm — it’s the invisible grid that all other parts reference. Strudel’s euclidean patterns (3,8) and (5,8) generate the same kinds of maximally-even distributions that underlie clave-based music.
Rupert Parkes (Photek) used an E-mu sampler to program drum patterns with the precision of West African ensemble music but the timbral palette of electronic production. “Ni-Ten-Ichi-Ryu” layered single-shot drums from multiple sources with ghost notes so quiet they were almost subliminal. He cited Coltrane’s drummer Elvin Jones as an influence — jazz polyrhythm translated through a sampler.
Sources: Jones, Studies in African Music (1959); Washburne, “The Clave of Jazz” (1997); Pytlik, “Photek: Solaris” (1998).