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

Misplaced Palindrome

2023-02-12 12:50 作者:reverland  | 我要投稿

use_debug false

notes = chord(:c, :major, invert: 1) * 2 + chord(:e, '7sus4', octave: 2) + chord(:c, :major, octave: 2) * 2

notes += chord(:c, :major, octave: 2) * 2 + chord(:e, '7sus2', octave: 2) + chord(:c, :major, invert: 2) * 2


d = 5


use_synth :piano

use_synth_defaults cutoff: rrand(60,110)


define :play_music do

 use_bpm 60

 b = 0.4

 with_fx :reverb, mix: 0.5 do

   # chap1

   puts "first"


   in_thread do

     64.times do

       play notes.tick, sustain: 0.4, release: 0.4 if one_in(3)

       sleep [b, b/2, b/2, b/2].choose

     end

   end


   use_octave -1

   64.times do

     play notes.reverse.tick, sustain: 0.2, release: 0.2

     sleep b

   end


   play :c

   sleep b/2

   play :c

   sleep b/4

   play :c

   sleep b/8


   # chap2

   puts "second"


   use_octave 0


   in_thread do

     64.times do

       play notes.tick, sustain: 0.2, release: 0.2 if one_in(3)

       sleep b/2

     end

   end

   sleep b/2

   64.times do

     play notes.reverse.tick, sustain: 0.2, release: 0.2

     sleep b/2

   end


   play :c

   sleep b/8

   play :c

   sleep b/4

   play :c

   sleep b/2


   use_bpm current_bpm

   # chap3

   puts "third"


   in_thread do

     64.times do

       play notes.tick, sustain: 0.4, release: 0.4 if one_in(4)

       sleep [b, b/2, b/2, b/2].choose

     end

   end

   sleep b/2


   use_octave -1

   64.times do

     play notes.reverse.tick, sustain: 0.2, release: 0.2

     sleep b

   end

 end

end


#live_loop :music do

 play_music

 sleep 1

#end

Misplaced Palindrome的评论 (共 条)

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