mm-lilypond 1.2.0 → 1.2.1

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
  SHA256:
3
- metadata.gz: fdbfb6d2f24f1d1080cd6ea6559ade00260f830a2c092680bcea1b095b189c8e
4
- data.tar.gz: a240526e7b535154b73af7d698ac39e2456acb531c61d31e82a5e4a1fef81c82
3
+ metadata.gz: c44f2496ab4de60c51990de2db7d2c0b314b393596fa8e8c18c0825959a3eb08
4
+ data.tar.gz: 8f0f63d25907403c48b8edf83b7adea1c8e8e3c01c6182597d5b01c6e3308dc7
5
5
  SHA512:
6
- metadata.gz: 1fc161114967aceae870bfbe23d5daed473cbb0afefb92020935df1474026c2313717a579445c9483dbe74c7d19639d8f0e1433bc56bc8ec165b318deb9fae42
7
- data.tar.gz: aa56e773fe514b8c126e7ecbf1d5dc68e95f40482aef1c71b5978231a922c27f8a0306ba9b96ae54af2947ae1bb93fe6654b8e2a1080c28217cf08922d1c6403
6
+ metadata.gz: 2d92861c3308ab48d124cd839b7864eb9e60209c70eddd2642a33ab4fbeb6c00018f38a00d40f4205c46749db80ff16816ac401a5d1a257105299b6280c2e73d
7
+ data.tar.gz: 54785fc10cab4b60721cf9131fe07f8162a3fff82e68bf093727291b174ef8f498b69a6795470ccfa0b75cfabab905b873497d8fb0f3338260d0d850b0e2358d
@@ -2,7 +2,7 @@ require 'mm'
2
2
  require 'erb'
3
3
 
4
4
  class MM::Lilypond
5
- VERSION = "1.2.0"
5
+ VERSION = "1.2.1"
6
6
 
7
7
  attr_accessor :offset, :basenames, :prime_limit, :prime_steps
8
8
  attr_writer :template
@@ -81,6 +81,12 @@ class MM::Lilypond
81
81
  def cents_deviation ratio
82
82
  unaltered = cents_of_unaltered ratio
83
83
  deviation = (ratio.cents % 1200) - unaltered
84
+
85
+ # Account for extreme displacements, such as cDs
86
+ if unaltered == 0.0 && deviation > 600.0
87
+ deviation -= 1200.0
88
+ end
89
+
84
90
  if deviation < 0
85
91
  "#{deviation.round}"
86
92
  else
@@ -48,6 +48,7 @@ class TestMM::TestLilypond < Minitest::Test
48
48
  def test_cents_deviation
49
49
  assert_equal "+2", @lily_parser.cents_deviation(MM::Ratio.new(3, 2))
50
50
  assert_equal "-14", @lily_parser.cents_deviation(MM::Ratio.new(5, 4))
51
+ assert_equal "-27", @lily_parser.cents_deviation(MM::Ratio.new(63, 32))
51
52
  end
52
53
 
53
54
  def test_cents_of_unaltered
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mm-lilypond
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Smith