I’ve been playing with a couple of modifications written by @Emlyn and added to the 3.2dev github site. The first gives greater flexibility with the degree function and the second modifies the :piano synth allowing micro tuning ie it can respond to play 72.3 for example.
I put together the following piece. NB THIS WILL ONLY WORK ON 3.2DEV compiled after commit #5a15b84
#Arpeggio Meander by Robin Newman
#an experimental piece using the updated degree function (by Emlyn)
#and also his modified piano synth allowing fractional tuning
#I used a function to generate a honky tonk piano (also applied to pluck synth):beep
#This program required 3.2dev > commit #5a15b84 on May 17th 2019
set :kill,false
define :honky do |n,*args|
defaultargs={amp: 1}
ag=args[0]
ag=defaultargs if ag==nil
defaultargs.merge!(ag)
ag=defaultargs
v=ag[:amp]
s=get(:synth)
use_merged_synth_defaults
s=:pluck if s==nil
synth s,note: note(n)
synth s,note: note(n)+0.1,amp: v*0.7
synth s,note: note(n)+0.6,amp: v*0.5
synth s,note: note(n)+12,amp: v*0.3
end
##| scale(:c4,:major).each do |n|
##| honky n,release: 0.5
##| sleep 0.5
##| end
##| stop
define :arp do
chrd = []
sc=get(:sc)
sc=:major if sc==nil
base=get(:base)
puts "base is #{base}"
base=:c4 if base==nil
dc=dice(3)
puts "choose seq #{dc}"
case dc
when 1
degs=['1', '3', '5']
when 2
degs=['1','3','5','6']
when 3
degs=['1','3','5','7']
end
degs.each do |d|
chrd.append (degree d, base, sc)
end
return chrd.ring
end
with_fx :reverb,room: 0.5,mix: 0.7 do
with_fx :level,amp: 1 do |v|
set :v,v
at 110 do
control get(:v),amp: 0,amp_slide: 10
sleep 12
set :kill,true
end
live_loop :ch1 do
ch=arp
ch.each do |n|
honky n,release: 0.4,amp: 0.3
sleep 0.1
end
stop if get(:kill)
end
live_loop :ch2 do
ch=arp.reverse.mirror
ch.each do |n|
honky n,release: 0.4,amp: 0.3 if spread(5,11).tick
sleep 0.2
end
stop if get(:kill)
end
live_loop :ch3 do
ch=arp.mirror
ch.each do |n|
honky n,release: 0.4,amp: 0.5 if spread(7,13).tick
sleep 0.3
end
stop if get(:kill)
end
live_loop :synthChoose do
set :synth,([:pluck,:piano].choose)
sleep rrand_i(1,3)
stop if get(:kill)
end
live_loop :scaleChoose do
set :sc,(scale_names.choose)
puts get(:sc)
sleep rrand_i(1,5)
stop if get(:kill)
end
live_loop :baseChoose do
set :base,(scale(:c4,:major).choose)
sleep rrand_i(2,5)
stop if get(:kill)
end
end #level
end #reverb
You can hear it on SoundCloud