live_loop :list do
play choose([52, 55, 59])
sleep 0.25
end
リストの操作
# 一度に演奏
play [52, 55, 59]
# オプションを指定して一度に演奏
play [52, 55, 59], amp: 0.3
# 音階で指定
play [:E3, :G3, :B3]
# リストの要素にアクセス
loop do
play [52, 55, 59][1]
sleep 0.25
end
コード (和音, chord)
# コードいろいろ
live_loop :chord do
play chord(:C4, :major)
sleep 1.0
play chord(:C4, :major7)
sleep 1.0
play chord(:C4, :minor)
sleep 1.0
play chord(:C4, :minor7)
sleep 1.0
play chord(:C4, :dim)
sleep 1.0
play chord(:C4, :dim7)
sleep 1.0
play chord(:C4, :sus2)
sleep 1.0
play chord(:C4, :sus4)
sleep 1.0
play chord(:C4, :augmented)
sleep 1.0
end
カノン進行
live_loop :chord do
use_synth :fm
play chord(:C5, :M)
sleep 1.5
play chord(:G4, :M)
sleep 1.5
play chord(:A4, :m)
sleep 1.5
play chord(:E4, :m)
sleep 1.5
play chord(:F4, :M)
sleep 1.5
play chord(:C4, :M)
sleep 1.5
play chord(:F4, :M)
sleep 1.5
play chord(:G4, :M)
sleep 1.5
end
王道進行 (IV△7–V7–iii7–vi progression)
live_loop :chord do
use_synth :fm
play chord(:F4, :M7)
sleep 1.5
play chord(:G4, '7')
sleep 1.5
play chord(:E4, :m7)
sleep 1.5
play chord(:A4, :m)
sleep 1.5
end
TK進行
# TK進行
live_loop :chord do
use_synth :fm
play chord(:A4, :m)
sleep 1.5
play chord(:F4, :M)
sleep 1.5
play chord(:G4, :M)
sleep 1.5
play chord(:C4, :M)
sleep 1.5
end
3.times do
play 50
sleep 0.5
sample :elec_blup
sleep 0.5
play 62
sleep 0.25
end
反復のネスト + ループ
live_loop :live do
sample :drum_heavy_kick
2.times do
sample :elec_blip2, rate: 2
sleep 0.25
end
sample :elec_snare
4.times do
sample :drum_tom_mid_soft
sleep 0.125
end
end
if文による条件分岐
i = 0
live_loop :live do
if i % 4 == 0 then
sample :drum_heavy_kick
else
sample :drum_cymbal_closed
end
sleep 0.125
i = i+1
end
if文とone_inによる確率的な条件分岐
live_loop :live do
if one_in(3)
sample :drum_heavy_kick
else
sample :drum_cymbal_closed
end
sleep 0.125
end
if文とone_in その2
live_loop :live do
if one_in(3)
sample :drum_heavy_kick
sleep 0.25
else
sample :drum_cymbal_closed
sleep 0.125
end
end
複数のリズムの共存
live_loop :live do
sample :drum_heavy_kick
4.times do
sample :elec_blip2, rate: 2
sleep 1.0/8.0
end
sample :elec_snare
4.times do
sample :drum_tom_mid_soft
sleep 0.125
end
end
live_loop :live2 do
sample :drum_heavy_kick
3.times do
sample :elec_blip2, rate: 2
sleep 1.0/8.0
end
sample :elec_snare
4.times do
sample :drum_tom_mid_soft
sleep 0.125
end
end
リスト
live_loop :live do
play choose([ 52, 55, 59 ])
sleep 0.25
end
# 一度に演奏
play [ 52, 55, 59 ]
# オプションを指定して一度に演奏
play [ 52, 55, 59 ], amp: 0.3
# 音階で指定
play [ :E3, :G3, :B3 ]
# リストの要素にアクセス
loop do
play [ 52, 55, 59 ][ 1 ]
sleep 0.25
end
# 55が演奏される
Piano Phase
notes = [:E4, :Fs4, :B4, :Cs5, :D5, :Fs4, :E4, :Cs5, :B4, :Fs4, :D5, :Cs5]
use_synth :prophet
with_fx :reverb do
live_loop :reich1 do
i = 0
12.times do
play (notes[i]), release: 0.4, pan: 0.8, cutoff: 80
sleep 0.15
i = i + 1
end
end
live_loop :reich2 do
i = 0
12.times do
play (notes[i])+12, release: 0.4, pan: -0.8, cutoff: 80
sleep 0.1501
i = i + 1
end
end
end