tonal-tools 7.4.1 → 7.6.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: a885f9f2ed3b1a950c3394fefbd826176a159082183b6f3a29309b62e9fc982e
4
- data.tar.gz: 6682d7efb1c39a9afd8865380fe09395ac31bd1b7014425a4eff60ed10b8a320
3
+ metadata.gz: 808fcd9cad8ea582e68af1c54f1e6c2377a0fba3554d0fc7593a11ba05e3c260
4
+ data.tar.gz: 669f92eb3dba1419404c3bd2c9f2f29623c8110d73800cab6a6116a8d0d8b02b
5
5
  SHA512:
6
- metadata.gz: b3ee15e23084e3d8cbd0c5de6560f299108c77ed88ed4ee041dad9223f8dadd272c19474b8596a9e22a3eff980bb721e6759972b8c6e81abd77b06999ca131bc
7
- data.tar.gz: 5d7d8b7fa3372f0704e7bcaf53e62e1e4c79a6380091898127145fc7499a97f5cea056a4b776b8ab5e0d35168bcf9b2c6028ed79bf7fa260301259e694808ae5
6
+ metadata.gz: 2a36a5b1579bcb1eb07d9b71e333023d14764962a22c3b4ae5407c935c8505f69cb5feb03bbfd94d3c97f4d39425f8cc08c433fbd4cbc156d64c2688e2900d0f
7
+ data.tar.gz: 95adea0987991dff6f49d0072107bb8d02c25b7c9693c142ddbc2b69907385561777b821289412073397cbecfb62c734ba7261aba13497a71d6b6cd759e18e01
@@ -1,4 +1,4 @@
1
1
  module Tonal
2
2
  TOOLS_PRODUCER = "mTonal"
3
- TOOLS_VERSION = "7.4.1"
3
+ TOOLS_VERSION = "7.6.0"
4
4
  end
@@ -232,6 +232,13 @@ end
232
232
  class Integer
233
233
  alias :prime_factors :prime_division
234
234
 
235
+ # @return [Tonal::ReducedRatio] the ratio 2**(self/modulo)
236
+ # @example
237
+ # 1.edo(12) => 1.06
238
+ # @param modulo
239
+ #
240
+ def edo(modulo) = (2**(Rational(self,modulo))).to_reduced_ratio
241
+
235
242
  # @return [Integer] the maximum prime factor of self
236
243
  # @example
237
244
  # 72.max_prime => 3
@@ -33,13 +33,24 @@ module Tonal
33
33
  def i(*args, reduced: true)
34
34
  Tonal::Interval.new(*args, reduced:)
35
35
  end
36
+
37
+ # @return [Tonal::ExtendedRatio] an extended ratio
38
+ # @example
39
+ # er(partials: [4,5,6]) => Tonal::ExtendedRatio with partials 4,5,6
40
+ #
41
+ def er(**kwargs)
42
+ Tonal::ExtendedRatio.new(**kwargs)
43
+ end
44
+
45
+ # @return [Tonal::SubharmonicExtendedRatio] a subharmonic extended ratio
46
+ # @example
47
+ # ser(partials: [4,5,6]) => Tonal::SubharmonicExtendedRatio with partials 4,5,6
48
+ #
49
+ def ser(**kwargs)
50
+ Tonal::SubharmonicExtendedRatio.new(**kwargs)
51
+ end
36
52
  end
37
53
 
38
- # @note
39
- # Intended for activation from +~/.irbrc+, by placing: +ENV["MTONAL_IRB_HELPERS" ] = "1"+, in the file
40
- #
41
- # Invoking this command from the IRB will add the helper methods: +r+, +rr+, +i+ in +main+.
42
- # These methods represent {Tonal::Ratio}, {Tonal::ReducedRatio} and {Tonal::Interval} respectively.
43
54
  #
44
55
  # @see Tonal::IRBHelpers
45
56
  #
data/lib/tonal/ratio.rb CHANGED
@@ -281,6 +281,7 @@ class Tonal::Ratio
281
281
  # denominator mapped on y-axis
282
282
  # ==================================
283
283
  #
284
+
284
285
  # @return [Tonal::Ratio] with the antecedent and consequent translated by x and y
285
286
  # @example
286
287
  # Tonal::Ratio.new(3,2).translate(3,3) => (6/5)
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: 7.4.1
4
+ version: 7.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jose Hales-Garcia
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-12-27 00:00:00.000000000 Z
10
+ date: 2025-12-30 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: yaml