使用Sonic-Pi编写-星之所在

中文教程点击这里 http://www.ityks.com/

好有意思,不过我是个程序员,不太懂乐理知识,只能搞这种简单的咯.


use_bpm 80

noteBase = 1

live_loop :jiepai do
  sample :elec_pop
  sleep 1;
end

minAmp = 1

maxAmp = 1

define :noteBeat do |note, beat|
  use_synth :tb303
  with_fx :reverb do
    if (beat == 2)    #两拍
      play note, sustain: 1.25, release: 0.25, attack: 0.25, decay: 0.25 ,amp: rrand(minAmp , maxAmp)
    elsif (beat == 1)    #一拍
      play note, sustain: 0.25, release: 0.25, attack: 0.25, decay: 0.25 ,amp: rrand(minAmp , maxAmp)
    elsif (beat == 0.5)    #二分之一拍
      play note, sustain: 0, release: 0.25, attack: 0.25, decay: 0 ,amp: rrand(minAmp , maxAmp)
    elsif (beat == 0.25)    #四分之一拍
      play note, sustain: 0, release: 0.125, attack: 0.125, decay: 0 ,amp: rrand(minAmp , maxAmp)
    elsif (beat == 0.125)    #八分之一拍
      play note, sustain: 0, release: 0.125, attack: 0, decay: 0 ,amp: rrand(minAmp , maxAmp)
    elsif (beat == 3)    #三拍
      play note, sustain: 2.25, release: 0.25, attack: 0.25, decay: 0.25 ,amp: rrand(minAmp , maxAmp)
    elsif (beat == 3.5)    #三拍半
      play note, sustain: 2.5, release: 0.25, attack: 0.25, decay: 0.25 ,amp: rrand(minAmp , maxAmp)
    elsif (beat == 1.5)    #一拍半
      play note, sustain: 0.5, release: 0.25, attack: 0.25, decay: 0.25 ,amp: rrand(minAmp , maxAmp)
    elsif (beat == 4)
      play note, sustain: 3.25, release: 0.25, attack: 0.25, decay: 0.25 ,amp: rrand(minAmp , maxAmp)
    end
  end
  sleep beat
end

2.times do
  sample :tabla_tun3
  sleep 1
end

noteBeat(72, 0.5)
noteBeat(71, 0.5)
noteBeat(72, 0.5)
noteBeat(76, 0.5)
noteBeat(71, 2)

noteBeat(69, 0.5)
noteBeat(67, 0.5)
noteBeat(69, 0.5)
noteBeat(72, 0.5)
noteBeat(67, 2)

noteBeat(65, 0.5)
noteBeat(64, 0.5)
noteBeat(65, 0.5)
noteBeat(72, 0.5)
noteBeat(71, 1)
noteBeat(67, 1)

noteBeat(69, 0.5)
noteBeat(71, 0.5)
noteBeat(72, 0.5)
noteBeat(76, 0.5)
noteBeat(74, 2)

#2-1

noteBeat(72, 0.5)
noteBeat(71, 0.5)
noteBeat(72, 0.5)
noteBeat(76, 0.5)
noteBeat(71, 1)
noteBeat(67, 1)

#2-2

noteBeat(69, 0.5)
noteBeat(71, 0.5)
noteBeat(72, 0.5)
noteBeat(74, 0.5)
noteBeat(76, 1)
noteBeat(76, 1)

#2-3

noteBeat(77, 0.5)
noteBeat(76, 0.5)
noteBeat(74, 0.5)
noteBeat(72, 0.5)
noteBeat(71, 0.5)
noteBeat(76, 0.5)
noteBeat(68, 0.5)
noteBeat(71, 0.5)

#2-4

noteBeat(69, 3)
noteBeat(69, 0.25)
noteBeat(71, 0.25)
noteBeat(72, 0.25)
noteBeat(74, 0.25)

#3-1

noteBeat(76, 3)
noteBeat(74, 1)

#3-2

noteBeat(79, 1)
noteBeat(77, 1)
noteBeat(76, 1)
noteBeat(74, 0.5)
noteBeat(72, 0.5)

#3-3

noteBeat(71, 3)
noteBeat(72, 0.5)
noteBeat(69, 3.5)

#3-4

noteBeat(69, 0.5)
noteBeat(67, 0.5)

#4-1

noteBeat(77, 1)
noteBeat(79, 1)
noteBeat(69, 0.5)
noteBeat(72, 1)
noteBeat(71, 1.5)

#4-2

noteBeat(72, 1)
noteBeat(74, 1)
noteBeat(71, 1)

#4-3

noteBeat(71, 3)
sleep 0.5
noteBeat(69, 3.5)

#4-4

noteBeat(69, 0.25)
noteBeat(71, 0.25)
noteBeat(72, 0.25)
noteBeat(74, 0.25)

#5-1

noteBeat(76, 3)
noteBeat(74, 1)

#5-2

noteBeat(79, 1)
noteBeat(77, 1)
noteBeat(76, 1)
noteBeat(74, 0.5)
noteBeat(72, 0.5)

#5-3

noteBeat(71, 3)
noteBeat(72, 0.5)
noteBeat(69, 3.5)

#5-4

noteBeat(69, 0.5)
noteBeat(67, 0.5)

#6-1

noteBeat(65, 1)
noteBeat(67, 1)
noteBeat(69, 0.5)
noteBeat(72, 1)
noteBeat(71, 1.5)

#6-2

noteBeat(72, 1)
noteBeat(74, 1)
noteBeat(77, 1)
noteBeat(76, 3.5)

#6-3

noteBeat(74, 0.5)
noteBeat(72, 0.5)

#6-4

noteBeat(71, 2)
noteBeat(66, 2)

#7-1

noteBeat(72, 0.5)
noteBeat(71, 0.5)
noteBeat(72, 0.5)
noteBeat(76, 0.5)
noteBeat(71, 2)

#7-2

noteBeat(69, 0.5)
noteBeat(67, 0.5)
noteBeat(69, 0.5)
noteBeat(72, 0.5)
noteBeat(66, 2)

#7-3

noteBeat(65, 0.5)
noteBeat(64, 0.5)
noteBeat(65, 0.5)
noteBeat(72, 0.5)
noteBeat(71, 1)
noteBeat(67, 1)

#7-4

noteBeat(69, 0.5)
noteBeat(71, 0.5)
noteBeat(72, 0.5)
noteBeat(76, 0.5)
noteBeat(74, 2)

#8-1

noteBeat(72, 0.5)
noteBeat(71, 0.5)
noteBeat(72, 0.5)
noteBeat(76, 0.6)
noteBeat(71, 1)
noteBeat(67, 1)

#8-2

noteBeat(69, 0.5)
noteBeat(71, 0.5)
noteBeat(72, 0.5)
noteBeat(74, 0.5)
noteBeat(76, 1)
noteBeat(76, 1)

#8-3

noteBeat(77, 0.5)
noteBeat(76, 0.5)
noteBeat(74, 0.5)
noteBeat(72, 0.5)
noteBeat(71, 0.5)
noteBeat(76, 0.5)
noteBeat(68, 0.5)
noteBeat(71, 0.5)

#8-4

noteBeat(69, 4)



 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值