gain() controls amplitude and can be patterned to create dynamic accent patterns within a rhythm
.gain(value) scales the amplitude of each event. Values below 1 reduce volume; above 1 boost. When gain is patterned — .gain("1 0.5 0.75 0.5") — each step has a different volume, creating a dynamic accent pattern. The workshop positions gain as a rhythmic tool: “Rhythm is all about dynamics!” Combined with mini-notation’s step-resolution, gain patterns can produce grooves where the same drum sound has accent, ghost, and rest structure from a single pattern line.
Examples
sound(“bd sd hh hh”).gain(“1 1 0.5 0.5”) // accent first two, ghost last two sound(“hh*8”).gain(perlin.range(.3,.9)) // random gain variation
Assessment
Write a hi-hat pattern where the downbeats are at full volume and the upbeats are at half volume using gain().