tonal-tools 8.4.0 → 8.5.0

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: f338aaedc8ca555cdd827f87d963b1d49c631ca1bcdc72b9679a3845f547ec1a
4
- data.tar.gz: 2792b60dc17116d627160be56b325c6301be6b62c5918b3e3a0461a2b909a7b2
3
+ metadata.gz: 520c39d6d3f6519ad21174305aaa089babd81bccde2416ddc09e2cc22d3f5ae7
4
+ data.tar.gz: 03ecbc849c92b953298c804c7b43caa0c020290dd3a1f183a5cfea3a0728fdaa
5
5
  SHA512:
6
- metadata.gz: 3eb756d61d8cd3e98cce4ecc2dfe9545120702d3bf782225c7f9ed83843d210c12588d6694467464d6d9ef1f1bade97b65dffc1d174fb054387a7f32df2d13e2
7
- data.tar.gz: 2a32319de368a22657d8d141c645f148715b74272b6be442ca36c7174b9a276b40e5450773bd4dfc45a61dd76e3b5d1b53121f5ef36f2b36829e3d2382f8b9df
6
+ metadata.gz: 21af61fe964bff3bca95070e3796fcaa77b93e52dadc68314eb52b0dafa08932486cfa988d6bacab9a0dc86b3543d4782534f575304d752b0ad34155785b1578
7
+ data.tar.gz: ba8d2348c7b0d9f50bd8188051c64db63c49dd5d731ad1b2e61c473a844242978809edce8df261b761ff6efb13220f1ebcc737edf45b52a4fea2481e03299fe7
@@ -1,4 +1,4 @@
1
1
  module Tonal
2
2
  TOOLS_PRODUCER = "mTonal"
3
- TOOLS_VERSION = "8.4.0"
3
+ TOOLS_VERSION = "8.5.0"
4
4
  end
data/lib/tonal/cents.rb CHANGED
@@ -15,7 +15,7 @@ class Tonal::Cents
15
15
 
16
16
  # @return [Tonal::Cents]
17
17
  # @example
18
- # Tonal::Cents.new(ratio: 2**(2.0/12)) => 200.0
18
+ # Tonal::Cents.new(ratio: 2**(2.0/12)) => 200.0 ¢
19
19
  # @param cents [Numeric, Tonal::Log2]
20
20
  # @param log [Numeric, Tonal::Log2]
21
21
  # @param ratio [Numeric, Tonal::Log2]
@@ -45,7 +45,7 @@ class Tonal::Cents
45
45
 
46
46
  # @return [Tonal::Cents] the default cents tolerance
47
47
  # @example
48
- # Tonal::Cents.default_tolerance => 5
48
+ # Tonal::Cents.default_tolerance => 5 ¢
49
49
  #
50
50
  def self.default_tolerance
51
51
  self.new(cents: TOLERANCE)
@@ -53,7 +53,7 @@ class Tonal::Cents
53
53
 
54
54
  # @return [Float] value of self
55
55
  # @example
56
- # Tonal::Cents.new(ratio: 2**(1.0/12)).value => 100.00
56
+ # Tonal::Cents.new(ratio: 2**(1.0/12)).value => 100.00 ¢
57
57
  #
58
58
  def value(precision: @precision)
59
59
  @value.round(precision)
@@ -64,7 +64,7 @@ class Tonal::Cents
64
64
  # @return
65
65
  # [Tonal::Cents] nearest hundredth cent value
66
66
  # @example
67
- # Tonal::Cents.new(cents: 701.9550008653874).nearest_hundredth => 700.0
67
+ # Tonal::Cents.new(cents: 701.9550008653874).nearest_hundredth => 700.0 ¢
68
68
  #
69
69
  def nearest_hundredth
70
70
  self.class.new(cents: value.round(Tonal::Cents::HUNDREDTHS_ROUNDOFF).to_f)
@@ -73,7 +73,7 @@ class Tonal::Cents
73
73
  # @return
74
74
  # [Tonal::Cents] nearest hundredth cent difference
75
75
  # @example
76
- # Tonal::Cents.new(cents: 701.9550008653874).nearest_hundredth_difference => 1.96
76
+ # Tonal::Cents.new(cents: 701.9550008653874).nearest_hundredth_difference => 1.96 ¢
77
77
  #
78
78
  def nearest_hundredth_difference
79
79
  self.class.new(cents: (value - nearest_hundredth))
@@ -91,7 +91,7 @@ class Tonal::Cents
91
91
  # @return
92
92
  # [String] the string representation of Tonal::Cents
93
93
  # @example
94
- # Tonal::Cents.new(100.0).inspect => "100.0 ¢"
94
+ # Tonal::Cents.new(100.0).inspect => 100.0 ¢
95
95
  #
96
96
  def inspect
97
97
  "#{value.round(@precision)} ¢"
@@ -102,7 +102,7 @@ class Tonal::Cents
102
102
  #
103
103
  # @return [Tonal::Cents, Numeric] result of operation
104
104
  # @example
105
- # Tonal::Cents.new(cents: 200) - Tonal::Cents.new(cents: 100) => 100.0
105
+ # Tonal::Cents.new(cents: 200) - Tonal::Cents.new(cents: 100) => 100.0 ¢
106
106
  # @param rhs [Tonal::Cents, Numeric]
107
107
  #
108
108
  def -(rhs)
@@ -111,7 +111,7 @@ class Tonal::Cents
111
111
 
112
112
  # @return [Tonal::Cents, Numeric] result of operation
113
113
  # @example
114
- # Tonal::Cents.new(cents: 100) + Tonal::Cents.new(cents: 200) => 300.0
114
+ # Tonal::Cents.new(cents: 100) + Tonal::Cents.new(cents: 200) => 300.0 ¢
115
115
  # @param rhs [Tonal::Cents, Numeric]
116
116
  #
117
117
  def +(rhs)
@@ -120,7 +120,7 @@ class Tonal::Cents
120
120
 
121
121
  # @return [Tonal::Cents, Numeric] result of operation
122
122
  # @example
123
- # Tonal::Cents.new(cents: 200) * 2 => 400.0
123
+ # Tonal::Cents.new(cents: 200) * 2 => 400.0 ¢
124
124
  # @param rhs [Tonal::Cents, Numeric]
125
125
  #
126
126
  def *(rhs)
@@ -129,7 +129,7 @@ class Tonal::Cents
129
129
 
130
130
  # @return [Tonal::Cents, Numeric] result of operation
131
131
  # @example
132
- # Tonal::Cents.new(cents: 400) / 2 => 200.0
132
+ # Tonal::Cents.new(cents: 400) / 2 => 200.0 ¢
133
133
  # @param rhs [Tonal::Cents, Numeric]
134
134
  #
135
135
  def /(rhs)
data/lib/tonal/step.rb CHANGED
@@ -86,6 +86,15 @@ class Tonal::Scale
86
86
  end
87
87
  alias :cents_difference :efficiency
88
88
 
89
+ # @return [Boolean] true if the step is coprime to the modulo
90
+ # @example
91
+ # Tonal::Scale::Step.new(step: 5, modulo: 12).coprime? => true
92
+ # Tonal::Scale::Step.new(step: 6, modulo: 12).coprime? => false
93
+ #
94
+ def coprime?
95
+ step.coprime?(modulo)
96
+ end
97
+
89
98
  def +(rhs)
90
99
  self.class.new(step: (rhs % modulo), modulo: modulo)
91
100
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tonal-tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 8.4.0
4
+ version: 8.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jose Hales-Garcia
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2026-04-16 00:00:00.000000000 Z
10
+ date: 2026-05-02 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: yaml