tonal-tools 7.0.0 → 7.1.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: '08e71f0a71f06993084a2567211a4106cefc25aaa4d1f28bc941bf737097915b'
4
- data.tar.gz: 6fa78c5271fa011906a7de57b9a56f7693bd11f2985d5193b868bd00468d3341
3
+ metadata.gz: 6eb41e5ffdfb2d4e1d6e76f5f69a2c1ad9a81d658af99e8a338211a5deea5d09
4
+ data.tar.gz: b63cb8bd6081fecdbbd97a2b003d84c2ea6533f9c656a63ba856c9732d021810
5
5
  SHA512:
6
- metadata.gz: 6509f49a314f5cec9b413617ddf00967e7c57655b9eb86b8b96e56033c3ef8cd8e136ee0a69cffb0e1de413e998b67537671763fd98bb937552bb03dc52316ff
7
- data.tar.gz: c99a22e906caaaca500225189a19f7633df2144485ef6c9479faf9bbbaefed01a04a085fd7de0b74cf4549f6b37c8afa919566d561709e66685306d962218863
6
+ metadata.gz: f33625446c980e2a0e92d37efefb6abda13a084f214900af13c2cad9a981e087ff971d3fd62f86e83ec574a1bc9f153f80a5b61001c36cc9fe8eb4fda6fb9336
7
+ data.tar.gz: 99f81e26f709629654cd54402635d2e504c7075426f5f5807add1a3226736951f37cd459e929fc6c96b101a7290e88a23914b296e5b987212def629455fd9886
@@ -1,4 +1,4 @@
1
1
  module Tonal
2
2
  TOOLS_PRODUCER = "mTonal"
3
- TOOLS_VERSION = "7.0.0"
3
+ TOOLS_VERSION = "7.1.0"
4
4
  end
@@ -39,13 +39,22 @@ class Numeric
39
39
  #
40
40
  def div_times(factor) = [self / factor, self * factor]
41
41
 
42
- # @return [Tonal::ReducedRatio] the octave reduced ratio of self
42
+ # @return [Tonal::Ratio] the octave reduced ratio of self
43
43
  # @example
44
- # (2**(1.0/12)).ratio => (4771397596969315/4503599627370496)
44
+ # (4/5r).to_ratio => 4/5
45
+ # @param reduced
46
+ # @param equave
45
47
  #
46
48
  def to_ratio(reduced: false, equave: 2/1r) = reduced ? Tonal::ReducedRatio.new(self, equave: equave) : Tonal::Ratio.new(self, equave: equave)
47
49
  alias :ratio :to_ratio
48
50
 
51
+ # @return [Tonal::ReducedRatio]
52
+ # @example
53
+ # {4/5r}.to_reduced_ratio => 8/5
54
+ # @param equave
55
+ #
56
+ def to_reduced_ratio(equave: 2/1r) = to_ratio(reduced: true, equave: equave)
57
+
49
58
  # @return [Float], the degrees on a circle of self
50
59
  # @example
51
60
  # (2**(6.0/12)).period_degrees => 180.0
@@ -124,6 +133,9 @@ class Numeric
124
133
 
125
134
  # @return [Integer] the Wilson height
126
135
  # @example (14/9r).wilson_height => 13
136
+ # @param reduced
137
+ # @param equave
138
+ # @param prime_rejects
127
139
  #
128
140
  def wilson_height(reduced: false, equave: 2/1r, prime_rejects: [2]) = ratio(reduced: reduced, equave: equave).wilson_height(prime_rejects: prime_rejects)
129
141
 
@@ -153,6 +165,7 @@ class Numeric
153
165
  # @return [Vector], self represented as a prime vector
154
166
  # @example
155
167
  # (3/2r).prime_vector => Vector[-1, 1]
168
+ # @param reduced
156
169
  #
157
170
  def prime_vector(reduced: false) = ratio(reduced: reduced).prime_vector
158
171
  alias :monzo :prime_vector
@@ -183,13 +196,13 @@ class Numeric
183
196
  def to_vector = Vector[self.numerator, self.denominator]
184
197
  alias :vector :to_vector
185
198
 
186
- # @return [Tonal::ReducedRatio], the Ernst Levy negative of self
199
+ # @return [Tonal::Ratio], the Ernst Levy negative of self
187
200
  # @example
188
201
  # (7/4r).negative => (12/7)
189
202
  #
190
203
  def negative = ratio.negative
191
204
 
192
- # @return [Tonal::ReducedRatio], the ratio rotated on the given axis, default 1/1
205
+ # @return [Tonal::Ratio], the ratio rotated on the given axis, default 1/1
193
206
  # @example
194
207
  # (3/2r).mirror => (4/3)
195
208
  # @param axis around which self is mirrored
@@ -377,7 +390,7 @@ class Array
377
390
  #
378
391
  def mean = self.sum / self.count.to_f
379
392
 
380
- # @return [Tonal::ReducedRatio] ratio reconstructed from the result of a prime factor decomposition
393
+ # @return [Tonal::Ratio] ratio reconstructed from the result of a prime factor decomposition
381
394
  # @example
382
395
  # [[[3, 1]], [[2, 1]]].ratio_from_prime_divisions => (3/2)
383
396
  # @param reduced [Boolean] if a reduced or unreduced ratio is returned
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: 7.0.0
4
+ version: 7.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jose Hales-Garcia
@@ -191,7 +191,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
191
191
  - !ruby/object:Gem::Version
192
192
  version: '3.1'
193
193
  requirements: []
194
- rubygems_version: 3.6.8
194
+ rubygems_version: 3.7.1
195
195
  specification_version: 4
196
196
  summary: Tonal tools
197
197
  test_files: []