Sha256: 6c116f041d1b188fd351a9356bf03d4148d5d0d1d58baab4492fcc58f992481d

Contents?: true

Size: 784 Bytes

Versions: 16

Compression:

Stored size: 784 Bytes

Contents

require 'feep'

sequence = [
  {freq_or_note: 'A3', duration: 80},
  {freq_or_note: 'E4', duration: 80},
  {freq_or_note: 'G4', duration: 80},
  {freq_or_note: 'C#5', duration: 80},
  {freq_or_note: 'G5', duration: 240}
]

defaults = {
  :freq_or_note => '440', 
  :waveform     => 'saw', 
  :volume       => 0.3, 
  :duration     => 100,
  :notext       => true
}

sequence.each do |seq|
  puts "seq before merge: #{seq}"
  
  seq = defaults.merge(seq)
  
  puts "seq after merge: #{seq}"

  puts "playing #{seq[:freq_or_note]}"
  
  Feep::Base.new({
    :freq_or_note => seq[:freq_or_note], 
    :waveform     => seq[:waveform], 
    :volume       => seq[:volume], 
    :duration     => seq[:duration],
    :notext       => seq[:notext]
  })
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
gemwarrior-0.15.20 tests/test-feep/test-feep.rb
gemwarrior-0.15.19 tests/test-feep/test-feep.rb
gemwarrior-0.15.18 tests/test-feep/test-feep.rb
gemwarrior-0.15.17 tests/test-feep/test-feep.rb
gemwarrior-0.15.16 tests/test-feep/test-feep.rb
gemwarrior-0.15.15 tests/test-feep/test-feep.rb
gemwarrior-0.15.14 tests/test-feep/test-feep.rb
gemwarrior-0.15.13 tests/test-feep/test-feep.rb
gemwarrior-0.15.12 tests/test-feep/test-feep.rb
gemwarrior-0.15.11 tests/test-feep/test-feep.rb
gemwarrior-0.15.10 tests/test-feep/test-feep.rb
gemwarrior-0.15.9 tests/test-feep/test-feep.rb
gemwarrior-0.15.8 tests/test-feep/test-feep.rb
gemwarrior-0.15.7 tests/test-feep/test-feep.rb
gemwarrior-0.15.6 tests/test-feep/test-feep.rb
gemwarrior-0.15.5 tests/test-feep/test-feep.rb