AMPLE guideSong text by example

Page 17 of 20

Song text by example

Read and write the text of a song, from the smallest song to a chain with effects.

Every song is a text file, and it is worth being able to read it. This page goes from the smallest song to a longer one. Most of them work as they are. The ones with kit samples/kit need a folder of drum samples with that name; without the kit line the drums block plays its built-in sounds.

The Source view shows the song as text. Everything on this page can be typed there.
The Source view shows the song as text. Everything on this page can be typed there.

The shape of a block#

drums beat stable@1.2 at 1 for 8 {
  kit samples/kit
}

A block is: the kind (drums), its name (beat), a version tag (stable@1.2), where it is in time (at 1 for 8: from bar 1, for 8 bars), and then its settings between curly braces. Names have no spaces; use - or _.

Cables#

bass bass stable@1.1 {
  from chords.notes -> notes
}

A cable is written in the block that receives: from <block>.<output> -> <input>. This one says: the bass takes the notes output of the block chords into its own input called notes.

The smallest song#

project "tiny" { tempo 100  master-seed 1 }

midi-clip chords stable@1.0 {
  chords Am F C G
}
bass bass stable@1.1 {
  from chords.notes -> notes
}
mixer mix stable@1.1 {
  from bass.audio -> in1
}
master master live@1.3 {
  from mix.mix -> mix
}

The first line is the project: its name, the tempo and the master seed. The rest is four blocks and three cables. Chords go into a bass, the bass goes into the mixer, the mixer goes into the master.

Two parts, in time#

piano piano stable@1.0 at 1 for 8 as verse, 9 for 8 as chorus {
  from chords.notes -> notes
}

A block can play in several stretches, and each can have a name: verse in bars 1 to 8, chorus in bars 9 to 16.

A drum beat with sections#

drums beat stable@1.2 at 1 for 12 {
  kit samples/kit
  pattern kick:x...x...x...x... snare:....x.......x... hat:x.x.x.x.x.x.x.x.
  patterns verse=kick:x.......x....... snare:....x.......x... hat:x.x.x.x.x.x.x.x. / fill=kick:xxxxxxxxxxxxxxxx snare:x.x.x.x.xxxxxxxx hat:xxxxxxxxxxxxxxxx
  song verse*4 fill verse*4 fill
}

pattern is the plain beat; patterns names others; song strings them together. See Drums and patterns.

Notes written by hand#

midi-clip lead stable@1.0 at 1 for 4 {
  melody "a3:0.5 c4:0.5 e4:1 g4:0.5 e4:0.5 c4:1 a3:2"
}

A tune as note names and lengths in beats. See MIDI and notes.

An effect chain#

midi-clip harmony stable@1.0 at 1 for 16 {
  chords Am F C G Am F C G Am F C G Am F C G
}
bass line stable@1.2 at 1 for 16 {
  from harmony.notes -> notes
}
filter dull stable@1.0 {
  type lowpass
  cutoff 700 Hz
  from line.audio -> in
}
delay echo stable@1.0 {
  time 375 ms
  feedback 35%
  mix 28%
  from dull.out -> in
}
reverb room stable@1.0 {
  size 45%
  decay 50%
  mix 22%
  from echo.out -> in
}

A bass through a low-pass filter, a delay and a reverb. Each effect takes what the one before gives it. See Effects.

Fading out at the end#

volume ending stable@1.0 {
  from line.audio -> in
  gain fadeout(7, 6s, exp)
}

The bass (from the effect chain above) fades to silence over six seconds, starting at bar 7. See Fades.

Autocomplete#

The Source view helps you type. While you type, AMPLE shows its best guess in grey, right after the cursor. Press Tab to take it.

Typing midi-c: the grey rest of the word is the guess. Tab fills in the whole block, with its parameters.
Typing midi-c: the grey rest of the word is the guess. Tab fills in the whole block, with its parameters.

Ctrl+Space opens the list of everything that fits at the cursor. Choose with the arrow keys, take it with Enter or Tab, and close it with Esc.

Ctrl+Space after # view pin: the blocks of the song that can be pinned.
Ctrl+Space after # view pin: the blocks of the song that can be pinned.

Esc also hides the grey guess. It stays away on that line until you start typing on another line, or type a space or delete one. Ctrl+Space brings it back at once.

What it can complete, depending on where the cursor is:

A few habits#

You can now read the text of a song. Ready for a whole one? Build a full band song in Make a song: Rooftop Light. To look up a word, use the dictionary.

← When something goes wrongMake a song: Rooftop Light →