rhythmmml 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rhythmmml/scene.rb +5 -4
- data/lib/rhythmmml/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: de6910bb661fa7543e33efcc11cba0bb73c2d3b3
|
4
|
+
data.tar.gz: 21563af764fb579fca57f6ca78c71fd36a42fd4b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bdb8e3b03f5ea28ecada61bfdc97c3c5b1f488874330dd3b983c61787564ac13017fcb9c367f8ee543560b92c548036a21c73c8cb3fa49e255d65854ff3357f3
|
7
|
+
data.tar.gz: 90f1a799d48b1fe2b142fc23f641fbe452d24d5413951ca67a150975aab2756f66484b4993d9125949d0978119d02d73ac8fa75b43e0bf0b8cd4357a1ceb5abf
|
data/lib/rhythmmml/scene.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
require "gosu"
|
2
2
|
require "mml2wav"
|
3
3
|
require "wavefile"
|
4
|
-
require "
|
4
|
+
require "tmpdir"
|
5
5
|
require "rhythmmml/object"
|
6
6
|
require "rhythmmml/figure"
|
7
7
|
require "rhythmmml/parser"
|
@@ -152,13 +152,14 @@ module Rhythmmml
|
|
152
152
|
distance = (@bar_y - rhythm.y).abs
|
153
153
|
if distance < 10
|
154
154
|
@info.score += 10 - distance
|
155
|
-
|
156
|
-
|
155
|
+
Dir.mktmpdir("rhythmmml") do |dir|
|
156
|
+
path = File.join(dir, "a.wav")
|
157
|
+
WaveFile::Writer.new(path, @format) do |writer|
|
157
158
|
samples = sine_wave(*rhythm.info[2])
|
158
159
|
buffer = WaveFile::Buffer.new(samples, @buffer_format)
|
159
160
|
writer.write(buffer)
|
160
161
|
end
|
161
|
-
Gosu::Sample.new(@window,
|
162
|
+
Gosu::Sample.new(@window, path).play
|
162
163
|
end
|
163
164
|
@objects.delete(rhythm)
|
164
165
|
@rhythms.delete(rhythm)
|
data/lib/rhythmmml/version.rb
CHANGED