I’ve always liked the _slide options in Sonic Pi. Felt the urge to do some zapping this afternoon.
Here is the result.
#Stellar Battle by Robin Newman
#This code makes use of the _slide options available in Sonic Pi
#A rapdily falling pitched note is generated, which is also shifted
#rapidly in pan value. Add some gverb and you have the recipie
#for a mega battle.
define :kapow do |n,o=24,p=1|
use_synth [:beep,:tri,:pulse,:zawa,:square].choose
d=[0.1,0.15,0.2,0.25,0.5].choose
#create a note and store reference to it in k
k = play note: n+o,release: d,pan: -p,amp: rand(1.5)+0.2
#control the note via k and slide note and pan values
control k,note: n,note_slide: d,pan: p,pan_slide: d
sleep d
end
with_fx :gverb, room: 25,mix: 0.8 do
live_loop :pow do
kapow scale(:e2,:minor_pentatonic,num_octaves: 3).choose,[12,18,24,30,36].choose,-1
sleep rand(1.5)
end
live_loop :pow2,delay: 2 do
kapow scale(:c3,:minor_pentatonic,num_octaves: 2).choose,[12,18,24,30,36].choose,1
sleep rand(1)
end
end