Sha256: 0c8c44c331db64b3df63b26724742a6c1d3f2604f80834153f097674863705a4
Contents?: true
Size: 547 Bytes
Versions: 2
Compression:
Stored size: 547 Bytes
Contents
# frozen_string_literal: true require 'alda-rb' REST_RATE = 0.15 MS_LOWER = 30 MS_UPPER = 3000 OCTAVE_UPPER = 9 Alda::Score.new do random_note = -> do ms = -> { duration ms rand(MS_UPPER - MS_LOWER) + MS_LOWER } if rand < REST_RATE pause ms.() octave rand OCTAVE_UPPER note pitch(['abcdefg'[rand 7].to_sym, %i[sharp flat natural].sample]), ms.() end end midi_electric_piano_1_ panning 25 random_note * 50 midi_timpani_ panning 50 random_note * 50 midi_celesta_ panning 75 random_note * 50 end.play
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
alda-rb-0.3.1 | examples/entropy.rb |
alda-rb-0.3.0 | examples/entropy.rb |