I was looking at some of @mrbombmusic tutorials on youtube which are a good start to start playing with ideas, and developed one of them to produce the piece below. It can easily be altered or developed further.
#chord progressions and melody meandering through Sonic Pi's scales
#code by Robin Newman, inspired by a tutorial by Mr Bomb
#https://www.youtube.com/watch?v=QeDm_8r1-bQ
use_debug false
use_bpm 110
sn= scale_names #internally defined scale names in Sonic Pi
define :dub do |n| #n is a list of notes
#list n is duplicated an octave above and below the original
#a rest (nil) is added to the list
op=[nil] #output list initiated to a rest (nil) to add some rhythmic change to what is played
n.each do |nv|
op += [nv] #original
op += [nv - 12] #down an octave
op += [nv + 12] #up an octave
end
return op #expanded list is returned
end
with_fx :reverb, room: 0.6,mix: 0.7 do
live_loop :prog do
use_synth :pluck #for melody notes
#choose one of the two progressions. Could add others
progression = [(ring, :i,:vi,:ii,:v),(ring, :i, :v,:vi,:iv)].choose
puts progression
s=scale_names.choose #.tick can be used instead to sequence through them all
puts s
tick_reset :prog #reset tick counter :prog
progression.length.times do #iterate through the progression
#take three note chord for each degree
cn=chord_degree(progression.tick(:prog),:c4,s,3)
in_thread do #individual note thread played at same time as chord
cx=dub(cn) #produced extended list using dub
puts cx
16.times do #play 16 notes/rests from the list
play cx.choose,pan: rrand_i(-1,1) #distribute note to pan -1,0 or 1
sleep 0.25
end
end
with_synth :tb303 do
#play the next chord in the progression
play cn,release: 4,cutoff: 90,amp: 0.5,pan: rrand_i(-1,1)
end
sleep 4
end
end
end#reverb