Also posted to YouTube here: SweepingSynth - Sonic pi - YouTube
I thought I would post the code this time because it is more complex and can be changed to get other results easier, so have fun messing around with this!
with_fx :ixi_techno, cutoff_min: 125, cutoff_max: 70, mix: 0.75, phase: 8, res: 0.5 do
with_fx :ixi_techno, cutoff_min: 125, cutoff_max: 70, mix: 0.75, phase: 16, res: 0.5 do
live_loop :calmchords do
use_synth :sine
play chord(:F3, :major7), attack: 0.25, sustain: 1, release: 0.75
sleep 2
play chord(:C3, :major7), attack: 0.25, sustain: 1, release: 0.75
sleep 2
play chord(:G3, :minor7), attack: 0.25, sustain: 1, release: 0.75
sleep 2
play chord(:A3, :major), attack: 0.25, sustain: 1, release: 0.75
sleep 2
end
with_fx :level, amp: 0.125 do
live_loop :acompanynotes do
use_synth :hoover
8.times do
play 89, amp: 0.05
sleep 0.25
end
8.times do
play 84, amp: 0.05
sleep 0.25
end
8.times do
play 91, amp: 0.05
sleep 0.25
end
4.times do
play 93, amp: 0.05
sleep 0.5
end
end
end
#sleep 8
with_fx :panslicer, wave: 3, phase: 2 do
with_fx :level, amp: 3 do
live_loop :peacemelody do
a = 1
b = 0.1
use_synth :piano
play_pattern_timed [88, 84, 81, 77], [0.25], sustain: a, attack: b
play_pattern_timed [88, 84, 81, 77], [0.25], sustain: a, attack: b
play_pattern_timed [84, 79, 76, 72], [0.25], sustain: a, attack: b
play_pattern_timed [84, 79, 76, 72], [0.25], sustain: a, attack: b
play_pattern_timed [90, 86, 83, 78], [0.25], sustain: a, attack: b
play_pattern_timed [90, 86, 83, 78], [0.25], sustain: a, attack: b
##play_pattern_timed [88, 84, 81, 77], [0.25], sustain: 2
##play_pattern_timed [88, 84, 81, 77], [0.25], sustain: 2
play chord(:A3, :major), sustain: 1, release: 1
sleep 0.5
play_pattern_timed [81, 85, 88], [0.5], sustain: 0, attack: 0.1
sleep 0
#sync "/live_loop/calmchords"
end
end
end
#sleep 8
#############################################################
with_fx :panslicer, wave: 2, phase: 2 do
with_fx :level, amp: 2 do
live_loop :pluckmelody do
a = 2
b = 0.1
use_synth :pluck
play_pattern_timed [88, 84, 81, 77], [0.25], sustain: a, attack: b
play_pattern_timed [88, 84, 81, 77], [0.25], sustain: a, attack: b
play_pattern_timed [84, 79, 76, 72], [0.25], sustain: a, attack: b
play_pattern_timed [84, 79, 76, 72], [0.25], sustain: a, attack: b
play_pattern_timed [90, 86, 83, 78], [0.25], sustain: a, attack: b
play_pattern_timed [90, 86, 83, 78], [0.25], sustain: a, attack: b
##play_pattern_timed [88, 84, 81, 77], [0.25], sustain: 2
##play_pattern_timed [88, 84, 81, 77], [0.25], sustain: 2
play chord(:A3, :major), sustain: 1, release: 1
sleep 0.5
play_pattern_timed [81, 85, 88], [0.5], sustain: 0, attack: 0.1
sleep 0
#sync "/live_loop/calmchords"
end
end
end
end
live_loop :sweepbeat do
sample :drum_tom_hi_soft, pan: 1
sleep 0.5
sample :drum_cymbal_closed, pan: -1
sleep 0.5
end
live_loop :sweepbeat2 do
48.times do
sample :drum_snare_soft, amp: 0.25, pan: rrand_i(1, -1)
sleep 0.125
end
sample :drum_snare_soft
sleep 1
sample :drum_cymbal_open, amp: 0.25
sleep 1
end
end