Arrange a Song from Sections
A section holds every track’s lane for a stretch of the song; arrange() puts sections in
sequence. Every method is in the audio reference.
The Arrangement Model explains how sections,
lanes and layers relate. For a guided first song, see
Arrange a Song.
Write a section
Section titled “Write a section”section(length) makes a section length cycles long. Index it with a track and send the lane a
pattern:
use "std/instruments" { Sampler, Kit };
let drums = AudioTrack("drums");drums.set_instrument(Sampler(Kit("CR-78")));let bass = AudioTrack("bass");bass.set_instrument(Sampler(Kit("CR-78")));
let verse = section(8);verse[drums] << [bd bd sd bd];verse[bass] << [c2 _ g1 _];verse[drums].at(start, duration) << pattern places a pattern inside the lane instead of covering
the whole section.
Write a variation
Section titled “Write a variation”.clone() copies a section, every lane included. Change the copy:
let chorus = verse.clone();chorus[drums] << [bd sd bd sd];Sequence the sections
Section titled “Sequence the sections”arrange(#[...]) plays its elements back to back. elem * n repeats one, and an arrangement can be
an element of another:
let song = arrange(#[verse * 2, chorus]); // verse 0–16, chorus 16–24Play the song
Section titled “Play the song”song.play() starts the song from the top and plays it once through:
song.play();Every lane edit you make afterwards is heard while it plays; you don’t call play() again.
Check what it will play
Section titled “Check what it will play”show(song) prints every lane as it will play — one row per stretch, with the layer that wins it:
show(song);song[drums].entries() lists what you wrote on a lane instead, and flags writes that are completely
hidden as masked.
Related
Section titled “Related”- Audio: Sections — every section and lane method
- Add Fills to a Song — punch fills over the sections
- Automate a Song — volume, pan and effect automation per section
- Render a Project — bounce the song to disk