tonal-tools 5.1.4 → 5.3.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: 6f6428a7770578a48111345ec79e8741fd778006eb9c66bfa2c9ff9d06df4f58
4
- data.tar.gz: 91c2f7bee770fc580cdaf4de02c900fb695d54ae2caefd0349c513503332b2cf
3
+ metadata.gz: cf75078baac2ea863202aca76b6c00ab636971096fc676982dcb0114376bca8d
4
+ data.tar.gz: 85b5550ccf29103f87416eea33f8a01c865730eecb4396e482e659ead1e5bf9e
5
5
  SHA512:
6
- metadata.gz: 890641d771c7c9ca7c83ba0a70ea584988acc76db3954563e7b924ee2ef861d6fed5da0ef2a0168a8ff36139e0896715d00392bd9cb2b1324a3cd32bf6ea1653
7
- data.tar.gz: ba54c2cbf7073d3d6453e92107b63f4c530d8faeb77acb326f7cea18937c20966c56d2d8c4b1c73ede57f744b47fd88fbec88b335e92f9b6cea119f791393b22
6
+ metadata.gz: aac11d2e96bda93047dea33f9e79be30f6db228b2fe4c01813544498740e21d82959a3678d0502ec9ee54e055fd96093d9135b244e37e9847de001ccb5a6a7ed
7
+ data.tar.gz: 1d71ebff05b9d1e83b0dc90f4968c4ffbc9ebc51f0d931e0627588a2ad4262fcf1c63413a519450367b46eafa9f48b65cb2d38373a43fc23be49b4bbfbb5447d
@@ -152,7 +152,7 @@ class Tonal::Ratio
152
152
 
153
153
  class Set
154
154
  extend Forwardable
155
- def_delegators :@ratios, :count, :length, :min, :max, :entries, :all?, :any?, :reject, :map, :find_index
155
+ def_delegators :@ratios, :count, :length, :min, :max, :entries, :all?, :any?, :reject, :map, :find_index, :to_a
156
156
 
157
157
  attr_reader :ratios, :ratio
158
158
 
@@ -1,4 +1,4 @@
1
1
  module Tonal
2
2
  TOOLS_PRODUCER = "mTonal"
3
- TOOLS_VERSION = "5.1.4"
3
+ TOOLS_VERSION = "5.3.0"
4
4
  end
@@ -179,8 +179,16 @@ class Numeric
179
179
  # @return [Tonal::ReducedRatio], the ratio rotated on the given axis, default 1/1
180
180
  # @example
181
181
  # (3/2r).mirror => (4/3)
182
+ # @param axis around which self is mirrored
182
183
  #
183
184
  def mirror(axis=1/1r) = self.ratio.mirror(axis)
185
+
186
+ # @return [Integer] the floor of the log (to the given base) of self
187
+ # @example
188
+ # Math::PI.log_floor(2) => 1
189
+ # @param base of the log
190
+ #
191
+ def log_floor(base=10) = Math.log(self, base).floor
184
192
  end
185
193
 
186
194
  class Integer
@@ -204,12 +212,13 @@ class Integer
204
212
  #
205
213
  def factorial = (2..self).reduce(1, :*)
206
214
 
207
- # @return [Boolean] if self is coprime with i
215
+ # @return [Boolean] if self is coprime with other number
208
216
  # @example
209
217
  # 25.coprime?(7) => true
210
218
  # 25.coprime?(5) => false
219
+ # @param other number determining coprimeness
211
220
  #
212
- def coprime?(i) = self.gcd(i) == 1
221
+ def coprime?(other) = self.gcd(other) == 1
213
222
 
214
223
  # @return [Array] list of integers that are coprime with self, up to the value of self
215
224
  # @example
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tonal-tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.1.4
4
+ version: 5.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jose Hales-Garcia
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-09-26 00:00:00.000000000 Z
11
+ date: 2024-11-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: yaml
@@ -192,7 +192,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
192
192
  - !ruby/object:Gem::Version
193
193
  version: '3.1'
194
194
  requirements: []
195
- rubygems_version: 3.5.20
195
+ rubygems_version: 3.5.23
196
196
  signing_key:
197
197
  specification_version: 4
198
198
  summary: Tonal tools