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 +4 -4
- data/lib/tonal/approximation.rb +1 -1
- data/lib/tonal/attributions.rb +1 -1
- data/lib/tonal/extensions.rb +11 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cf75078baac2ea863202aca76b6c00ab636971096fc676982dcb0114376bca8d
|
4
|
+
data.tar.gz: 85b5550ccf29103f87416eea33f8a01c865730eecb4396e482e659ead1e5bf9e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aac11d2e96bda93047dea33f9e79be30f6db228b2fe4c01813544498740e21d82959a3678d0502ec9ee54e055fd96093d9135b244e37e9847de001ccb5a6a7ed
|
7
|
+
data.tar.gz: 1d71ebff05b9d1e83b0dc90f4968c4ffbc9ebc51f0d931e0627588a2ad4262fcf1c63413a519450367b46eafa9f48b65cb2d38373a43fc23be49b4bbfbb5447d
|
data/lib/tonal/approximation.rb
CHANGED
@@ -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
|
|
data/lib/tonal/attributions.rb
CHANGED
data/lib/tonal/extensions.rb
CHANGED
@@ -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
|
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?(
|
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.
|
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
|
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.
|
195
|
+
rubygems_version: 3.5.23
|
196
196
|
signing_key:
|
197
197
|
specification_version: 4
|
198
198
|
summary: Tonal tools
|