Skip to content

Add Fills to a Song

A fill is written at a position on the song’s lane. It masks what is underneath, across section boundaries too, and the part underneath resumes in its own place when the fill ends. The Arrangement Model explains masking and layers.

Write to a position with .at(start, duration), in cycles from the start of the song:

use "std/instruments" { Sampler, Kit };
let drums = AudioTrack("drums");
drums.set_instrument(Sampler(Kit("CR-78")));
let verse = section(8);
verse[drums] << [bd bd sd bd];
let chorus = verse.clone();
chorus[drums] << [bd sd bd sd];
let song = arrange(#[verse, chorus]);
song[drums].at(6, 4) << [cp cp];

Running an .at() line again with a different length reshapes that same fill. Rewriting the whole lane changes the structure underneath and keeps the fill:

song[drums] << [bd _ sd _];

.clear() on the position removes it:

song[drums].at(6, 4).clear();

Write fills to a named layer, and mute or unmute them together:

song[drums].layer("fills").at(7, 1) << [hh hh hh hh];
song[drums].layer("fills").at(15, 1) << [hh hh hh hh];
song[drums].layer("fills").mute();
song[drums].layer("fills").unmute();

A muted layer goes quiet at the next cycle boundary. .layer("fills").clear() removes the layer’s writes, .clear() on the lane removes everything above the structure, and .set_layer_order(#[...]) sets the stack from bottom to top.