tonal-tools 8.5.1 → 8.5.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b2692d9bde2f36dbc28cae1f8e0a892af38e901939ad2e93561442c5d12df67d
4
- data.tar.gz: 5b10622098df90d28d52c99037cc0eda5e834eeba1e200d63bb75dcf70ed811f
3
+ metadata.gz: d35ccfb34bc36393de62b66954048131b48eff9a9aa0c3af8c9f5d97d79d8406
4
+ data.tar.gz: 16b2e4235caeaf796ddd7ceec8e6b881eb2291b4ec0f7f6389ac2faaca1fe243
5
5
  SHA512:
6
- metadata.gz: 18eff7addd0dcc1cba4d9a59a7272853e1bba9a22c13cb727989214542e5705d69134dfb27e61f31d975e0b344226abc9758c5b1d3074285baf68854fc2c07d7
7
- data.tar.gz: 74c467d127fbcbb1c56f43530a3b1d6cbd9b7b7d9fa1f52ad44a443d5a2aef28c43f90b8e187039c4d79a31d32284cc4056c4d766dc1216c6d8db686918e4406
6
+ metadata.gz: 6849510f855a326970cf7a7ad4ee619b05251b15331659192c4a7d1cf17a08eb64cdd55e70232300587f6f263cb906ddde329fba2d7923002b34f303f1ee4bd1
7
+ data.tar.gz: ab77a51fb2c82acf98fb1b65b1d33ace5baac0fbfc4c823140fb1a746995468f8cf3621824af17b07f0f099300dd7b4b244da4578711705e8a62f9d22c1976cd
@@ -1,4 +1,4 @@
1
1
  module Tonal
2
2
  TOOLS_PRODUCER = "mTonal"
3
- TOOLS_VERSION = "8.5.1"
3
+ TOOLS_VERSION = "8.5.3"
4
4
  end
data/lib/tonal/step.rb CHANGED
@@ -48,7 +48,15 @@ class Tonal::Scale
48
48
  def step_to_r
49
49
  Rational(step, modulo)
50
50
  end
51
- alias :to_r :step_to_r
51
+
52
+ # @return [Tonal::Ratio] of the step/modulo
53
+ # @example
54
+ # Tonal::Scale::Step.new(ratio: 3/2r, modulo: 31).step_to_ratio
55
+ # => 18/31
56
+ #
57
+ def step_to_ratio
58
+ Tonal::Ratio.new(step, modulo)
59
+ end
52
60
 
53
61
  # @return [Rational] of the ratio
54
62
  # @example
@@ -59,15 +67,14 @@ class Tonal::Scale
59
67
  ratio.to_r
60
68
  end
61
69
 
62
- # @return [Tonal::Cents] measure of step in cents
70
+ # @return [Tonal::Cents] measure of tempered in cents
63
71
  # @example
64
- # Tonal::Scale::Step.new(ratio: 3/2r, modulo: 31).step_to_cents
72
+ # Tonal::Scale::Step.new(ratio: 3/2r, modulo: 31).tempered_to_cents
65
73
  # => 696.77
66
74
  #
67
- def step_to_cents
75
+ def tempered_to_cents
68
76
  tempered.to_cents
69
77
  end
70
- alias :to_cents :step_to_cents
71
78
 
72
79
  # @return [Tonal::Cents] measure of ratio in cents
73
80
  # @example
@@ -78,13 +85,13 @@ class Tonal::Scale
78
85
  ratio.to_cents
79
86
  end
80
87
 
81
- # @return [Tonal::Cents] the difference between the step and the ratio
88
+ # @return [Tonal::Cents] the difference between the tempered number and the ratio
82
89
  # @example
83
90
  # Tonal::Scale::Step.new(ratio: 3/2r, modulo: 31).efficiency => 5.19 ¢
84
91
  #
85
92
  def efficiency
86
- # We want the efficiency from the step (self). The step is the tempered approximation of the ratio, so we want to know how far off the step is from the ratio. So we take the ratio and subtract the step.
87
- ratio_to_cents - step_to_cents
93
+ # We want the efficiency from the step (self). The tempered value is the tempered approximation of the ratio, so we want to know how far off the step is from the ratio. So we take the ratio and subtract the tempered value.
94
+ ratio_to_cents - tempered_to_cents
88
95
  end
89
96
  alias :cents_difference :efficiency
90
97
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tonal-tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 8.5.1
4
+ version: 8.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jose Hales-Garcia