欢迎光临散文网 会员登陆 & 注册

心如朝阳,凝视忧虑

2023-03-21 09:05 作者:reverland  | 我要投稿

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

心如朝阳,凝视忧虑的评论 (共 条)

分享到微博请遵守国家法律