Sonic Pi Scripts

Jumping-off points for Sonic Pi!

Dream Waltz
Dream Waltz

Dream Waltz

A three instrument loop showing how to use ‘control’ to handoff continuously changing LFO levels to an FX parameter.

What it sounds like:

Code:

### Dream Waltz
### Author: Shea Kennedy (Doffu)
### About: A three instrument loop showing how to use 'control' to handoff continuously changing LFO levels to an FX parameter. 

# INITIALIZE
use_bpm 70
use_transpose 1 #Change this for some fun. I like: 8, 1, 0.4, and 32!
use_random_seed 0

# AUTOMATION
lfo0 = (line 70, 100, inclusive: true, steps: 16).mirror
lfo1 = (line 0.8, 0.99, inclusive: true, steps: 32).mirror
lfo2 = (line 120, 60, inclusive: true, steps: 4).mirror
lfo3 = (line 120, 100, inclusive: true, steps: 8)
lfo4 = (line 1, 10, inclusive: true, steps: 16).mirror
lfo5 = (line -0.5, 0.5, inclusive: true, steps: 16).mirror


with_fx :lpf do |lpf|
  live_loop :bass do
    puts tick
    control lpf, cutoff: lfo0.look
    use_synth :chipbass
    play (octs :e1, 3).look
    sleep 0.5
  end
end


with_fx :pan do |pan|
  with_fx :lpf do |lpf|
    live_loop :upper do
      puts tick
      control lpf, cutoff: lfo2.look, res: lfo1.look, mix: choose([0.1, 0.8])
      control pan, pan: lfo5.look
      use_synth :chipbass
      play (octs (knit :e3, 3, :gs3, 5, :as3, 4).look, 3).look
      sleep 0.25
    end
  end
end

with_fx :autotuner, note: :e4 do |formant|
  live_loop :melody, sync: :bass do
    puts tick
    control formant, formant_ratio: lfo4.look
    use_synth :chipbass
    play (octs (knit :e4, 6, choose([:gs4, :gs6]), 3, :as5, 3).look, 3).look
    sleep 0.5
  end
end 

Where it’s been used:

Music Platforms:

Socials:

Leave a Reply

Your email address will not be published. Required fields are marked *