Permalink
Browse files

Fixed Muse::Song::Bar::Wav error.

  • Loading branch information...
1 parent 8fd2b0a commit d101c3dac065fd9485adc007cf7117921b6fbebe @ngty committed Mar 17, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/muse.rb
View
@@ -92,14 +92,14 @@ def note_data(note, octave=3, options={})
beats, volume, adsr = (@beats || 1), 10000, 'default'
end
puts "[#{note}] -> beats : #{beats}, :octave : #{octave}"
- duration = ((60 * Wav::SAMPLE_RATE * beats)/@bpm)/Wav::SAMPLE_RATE.to_f
+ duration = ((60 * WavHeader::SAMPLE_RATE * beats)/@bpm)/WavHeader::SAMPLE_RATE.to_f
note_frequency = note + octave.to_s
unless note == '_'
freq = frequency_of(FREQUENCIES[note_frequency.to_sym])
else
freq = 0
end
- (0.0..duration.to_f).step(1.0/Wav::SAMPLE_RATE) do |i|
+ (0.0..duration.to_f).step(1.0/WavHeader::SAMPLE_RATE) do |i|
x = (Config.send(adsr.to_sym,i) * volume * Math.sin(2 * Math::PI * freq * i)).to_i
stream << [x,x]
end

0 comments on commit d101c3d

Please sign in to comment.