心如朝陽,凝視憂慮

notes = [:a3, :b3] * 3 + [:c, :e]
notes += [:b3, :a3] * 3 + [:e, :c]
notes += [:a3, :b3] * 2 + [:c, :e]
notes += [:b3, :a3] * 2 + [:e, :c]
notes += [:a3, :b3] + [:c, :e]
notes += [:b3, :a3] + [:e, :c]
notes = notes.ring.mirror
times = [0.25]
set :amp, 1
use_bpm 60
use_synth :piano
i = 0
bpm = 60
live_loop :melody1 do
?use_bpm (Math.sin(i / (Math::PI * 8.0))*0.5 + 1.5) * bpm
?amp = get[:amp]
?n = notes.tick(:n)
?with_fx :reverb do
???play n, amp: amp
?end
?sleep times.tick(:t)
?i += 1
end
live_loop :melody2 do
?use_synth :beep
?use_octave 1
?n = notes.tick(:n)
?with_fx :eq do
???play n, release: 8, amp: 0.8
?end
?sleep 8
end
標(biāo)簽: