Skip to content

Automate a Song

A track’s volume, pan and effect parameters are lanes of a section or song, like its notes. The Arrangement Model explains lanes.

Index the section with the track, and send the parameter a value or a signal:

use "std/instruments" { Sampler, Kit };
use "std/effects" { Lowpass };
use "std/signals" { automation };
let drums = AudioTrack("drums");
drums.set_instrument(Sampler(Kit("CR-78")));
drums.set_effects(#[Lowpass("lowpass", 800)]);
let verse = section(8);
verse[drums] << [bd bd sd bd];
verse[drums].volume << -6;
let chorus = verse.clone();
chorus[drums].volume << 0;
let song = arrange(#[verse, chorus]);

An effect parameter is addressed by the effect’s slot name: verse[drums].effect("lowpass").parameter("Cutoff").

Write to a position on the song’s lane, in cycles from the start of the song:

song[drums].volume.at(8, 8) << automation().at(0, -24).at(8, 0); // the chorus swells in

The automation’s own times count from the start of the position.