mml2wav 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bd7a4796c9f409d00b80f36bab6500965ebfcccf
4
- data.tar.gz: c07c86df8f9a0fe8121a2774a885d311548fab66
3
+ metadata.gz: 5a1e953bfb6d378660ab80310c24d6471113cb88
4
+ data.tar.gz: e874322276558218393a43f6085bbbe795db653c
5
5
  SHA512:
6
- metadata.gz: f21edb3881d011862b646a69f32bfad62325c924e7be9daa30e5587be76f1050fcbd174cf2ae179e746ae4b0663d61838a014ba4e8e03d31a5ee92c2cbbe03dc
7
- data.tar.gz: 7123c9626a12a1302ded2e1b26ce5eadc751860154567f15379c4de424b07e7ad127cfa687086c01849240e6e36328402216b27eecc533bc405b2fb3a2a11097
6
+ metadata.gz: 48d9b354f075604e7c2f485690ec8a1a6c73b59dcf186e84da1eeef6dab00947a67fcefcf4fbf413fe1c8f70f1eac080d1be8714e47b3688118ca4c0bf7d9941
7
+ data.tar.gz: 51a6810935932876b27d5c23ea54701112e974aaa305ec24c095e051541f096bc8c53a348d01726c920898e15155cd0228073ca02d4cc10457cdade3957f9377
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # mml2wav [![Gem Version](https://badge.fury.io/rb/mml2wav.svg)](http://badge.fury.io/rb/mml2wav)
2
2
 
3
- MML (Music Macro Language) to WAV audio converter by Ruby.
3
+ MML (Music Macro Language) to WAV audio converter by pure Ruby.
4
4
 
5
5
  ## Dependencies
6
6
 
@@ -4,19 +4,24 @@ module Mml2wav
4
4
  "c" => 32.70325 ,
5
5
  "c#" => 34.647875,
6
6
  "c+" => 34.647875,
7
+ "d-" => 34.647875,
7
8
  "d" => 36.708125,
8
9
  "d#" => 38.890875,
9
10
  "d+" => 38.890875,
11
+ "e-" => 38.890875,
10
12
  "e" => 41.2035 ,
11
13
  "f" => 43.6535 ,
12
14
  "f#" => 46.24925 ,
13
15
  "f+" => 46.24925 ,
16
+ "g-" => 46.24925 ,
14
17
  "g" => 48.999375,
15
18
  "g#" => 51.913125,
16
19
  "g+" => 51.913125,
20
+ "a-" => 51.913125,
17
21
  "a" => 55.0 ,
18
22
  "a#" => 58.2705 ,
19
23
  "a+" => 58.2705 ,
24
+ "b-" => 58.2705 ,
20
25
  "b" => 61.735375,
21
26
  "r" => 0,
22
27
  }
@@ -1,3 +1,3 @@
1
1
  module Mml2wav
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -9,7 +9,7 @@ module Mml2wav
9
9
  def write(sounds, options={})
10
10
  output_path = options[:output] || "doremi.wav"
11
11
  sampling_rate = options[:sampling_rate] || 22050
12
- bpm = options[:bpm] || 60
12
+ bpm = options[:bpm] || 120
13
13
  velocity = 5
14
14
  octave = 4
15
15
  default_length = 4.0
@@ -17,8 +17,8 @@ module Mml2wav
17
17
  format = Format.new(:mono, :pcm_8, sampling_rate)
18
18
  Writer.new(output_path, format) do |writer|
19
19
  buffer_format = Format.new(:mono, :float, sampling_rate)
20
- sounds.scan(/T\d+|V\d+|L\d+|[A-G][#+]?(?:\d+|\.)?|O\d+|[><]|./i).each do |sound|
21
- base_sec = 60.0
20
+ sounds.scan(/T\d+|V\d+|L\d+|[A-G][#+-]?\d*\.?|O\d+|[><]|./i).each do |sound|
21
+ base_sec = 60.0 * 4
22
22
  length = default_length
23
23
  case sound
24
24
  when /\AT(\d+)/i
@@ -27,12 +27,10 @@ module Mml2wav
27
27
  velocity = $1.to_i
28
28
  when /\AL(\d+)/i
29
29
  default_length = $1.to_f
30
- when /\A([A-G][#+]?)(\d+)/i
30
+ when /\A([A-G][#+-]?)(\d+)(\.)?/i
31
31
  length = $2.to_f
32
32
  sound = $1
33
- when /\A([A-G][#+]?)(\.)/i
34
- length = default_length / 1.5
35
- sound = $1
33
+ length = default_length / 1.5 if $3
36
34
  when /\AO(\d+)/i
37
35
  octave = $1.to_i
38
36
  when "<"
@@ -8,7 +8,7 @@ Gem::Specification.new do |spec|
8
8
  spec.version = Mml2wav::VERSION
9
9
  spec.authors = ["Masafumi Yokoyama"]
10
10
  spec.email = ["myokoym@gmail.com"]
11
- spec.description = %q{MML (Music Macro Language) to WAV audio converter by Ruby.}
11
+ spec.description = %q{MML (Music Macro Language) to WAV audio converter by pure Ruby.}
12
12
  spec.summary = spec.description
13
13
  spec.homepage = "https://github.com/myokoym/mml2wav"
14
14
  spec.license = "MIT"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mml2wav
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Masafumi Yokoyama
@@ -52,7 +52,7 @@ dependencies:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
- description: MML (Music Macro Language) to WAV audio converter by Ruby.
55
+ description: MML (Music Macro Language) to WAV audio converter by pure Ruby.
56
56
  email:
57
57
  - myokoym@gmail.com
58
58
  executables:
@@ -96,6 +96,6 @@ rubyforge_project:
96
96
  rubygems_version: 2.4.5
97
97
  signing_key:
98
98
  specification_version: 4
99
- summary: MML (Music Macro Language) to WAV audio converter by Ruby.
99
+ summary: MML (Music Macro Language) to WAV audio converter by pure Ruby.
100
100
  test_files: []
101
101
  has_rdoc: