Foggy Eye 一只雾眼

sad_chords = [chord(:F, :minor7), chord(:Ab, :major7), chord(:E, :major7), chord(:F, "7")].ring
sad_chords += [chord(:A, :minor7), chord(:D, :minor7), chord(:F, "7")].ring
c = sad_chords[0] # take the first chord of the ring and save it to a variable
live_loop :melody, delay: 8 do
stop
n = [:f, :a, :d, :e, :f].tick
use_synth :chiplead
use_synth_defaults cutoff: 95
#with_fx :krush, gain: 16, rep: 16 do
r = [0.25, 0.25, 0.25, 3].choose
play n, release: r
sleep r
#end
end
live_loop :bass, delay: 0 do
stop
with_fx :level,amp: 0.5 do
use_synth :pluck
use_octave -2
3.times do
play c[0] # play the first note of the chord
sleep 1
end
play c[1] # play the second note of the chord
sleep 0.5
play c[2] # # play the third note of the chord
sleep 0.5
c = sad_chords.tick
end
end
define :heartbeat do |i|
sample :drum_heavy_kick, rpitch: i*8
sleep 0.25
sample :bd_haus, rpitch: i*8
sleep 0.75
end
live_loop :drum do
with_fx :level, amp: 0.8 do
heartbeat 1.8
end
end
define :discrete_shepard do |up, synth, amp=1|
center = :f
#use_bpm 300
use_synth :mod_beep
#use_synth_defaults attack: 0.1, release: 0.1
notes = range(center, center+13)
if up then
notes = notes.reverse
end
notes = notes.stretch(2).rotate(1)
puts notes
amps = range(0,24)
#puts(amps)
amps = amps.map{|f| f/24.0*amp}
amps = amps.ring
if up then
amps = amps.reverse
end
#puts(amps.reverse)
for i in range(0, 24)
n = notes[i]
#puts i, n
play n, amp: amp
play n + 12, amp: amps.reverse[i]
play n - 12, amp: amps[i]
if i % 2 == 1 then
sleep 0.5
end
sleep 0.25
end
end
live_loop :s do
with_fx :ring_mod, freq: 120 do
discrete_shepard false, :sine, 0.1
end
end