Examples
Complete code examples
Ambient Glass
Ethereal wine glass textures:
tempo 90
import "github:SanicBoom/wine-glasses"
let glass_melody = sample("lib:wine-glasses/glass1", root: Eb4)
let glass_high = sample("lib:wine-glasses/glass4", root: D5)
let melody = [Eb4 _ G4 Bb4 _ Ab4 G4 _]
|> glass_melody
|> reverb(size: 0.85, mix: 0.6)
|> delay(time: 0.375, feedback: 0.4)
let shimmer = [Bb5 Eb5 G5 Bb5 Eb6 G5 Bb5 Eb5]
|> fast(2)
|> every(4, rotate(2))
|> glass_high
|> reverb(size: 0.9, mix: 0.7)
play stack(melody, shimmer)Techno Kick
Simple four-on-the-floor:
tempo 130
let kick = sample("lib:drums/808-kick.wav")
let pattern = [kick _ _ _ | kick _ _ _ | kick _ _ _ | kick _ _ _]
|> distortion(0.2)
|> compressor(threshold: -6, ratio: 8)
play patternAcid Bass
303-style acid line:
tempo 138
let bass = [C2 _ C2 C3 | _ C2 _ Eb2 | C2 _ G2 _ | _ C2 Bb1 _]
|> saw
|> lowpass(lfo(rate: 0.25, min: 200, max: 3000), resonance: 0.8)
|> distortion(0.4)
play bassBreakbeat
Chopped break:
tempo 140
let break = sample("lib:breaks/amen.wav") |> slice(8)
let chop = [break[0] break[2] break[1] break[3]
| break[0] break[4] break[6] break[7]]
|> every(4, reverse)
|> prob(0.2, fast(2))
play chopPad Progression
Lush chord pads with envelope shaping:
tempo 80
let pads = [Cm7 _ _ _ | Fm7 _ _ _ | Abmaj7 _ _ _ | G7 _ _ _]
|> slow(2)
|> supersaw
|> adsr(0.5, 0.2, 0.7, 1.0) // Slow attack, long release
|> lowpass(1500)
|> chorus(0.4)
|> reverb(size: 0.9, mix: 0.6)
play padsFM Electric Piano
Rhodes-style electric piano:
tempo 90
let chords = [Dm7 _ Gmaj7 _ | Cmaj7 _ Fmaj7 _]
|> arp(updown)
|> fm(ratio: 1.0, index: 3.0)
|> adsr(0.01, 0.3, 0.4, 0.5)
|> reverb(size: 0.4, mix: 0.3)
play chordsBell Melody
FM synthesis bell tones:
tempo 100
let bells = [E5 G5 B5 E6 | B5 G5 E5 B4]
|> fm(ratio: 3.5, index: 6.0)
|> adsr(0.001, 0.5, 0.2, 1.5)
|> reverb(size: 0.8, mix: 0.5)
|> delay(time: 0.375, feedback: 0.3)
play bellsPlucky Arpeggios
Fast arpeggios with short envelope:
tempo 130
let arp_pattern = [Cm7 Fm7 Gdom7 Cm7]
|> arp(outside)
|> fast(2)
|> saw
|> adsr(0.001, 0.1, 0.0, 0.1) // Plucky sound
|> lowpass(2000)
|> delay(time: 0.25, feedback: 0.4)
play arp_patternLayered Track
Multiple elements together:
tempo 124
let kick = [x _ _ _ | x _ _ _ | x _ _ _ | x _ _ _]
|> sample("lib:drums/kick.wav")
let hihat = [_ x _ x | _ x _ x | _ x _ x | _ x x x]
|> sample("lib:drums/hihat.wav")
|> volume(0.6)
let bass = [C2 _ _ C2 | _ _ C2 _ | C2 _ _ C2 | _ C2 _ _]
|> saw
|> lowpass(800)
let lead = [C4 Eb4 G4 Bb4]
|> every(2, transpose(5))
|> supersaw
|> reverb(0.5)
|> volume(0.7)
play stack(kick, hihat, bass, lead)
|> compressor(threshold: -10, ratio: 4)