tonal-tools 5.0.1 → 5.1.1

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: 71f085a27fce9f25e0dab185ae58880802186931c3946a39d41e9e975d2fb138
4
- data.tar.gz: f4bb5d1c1778aa14b8dd35080be434f409f711a6bd515893276209c338cb4c60
3
+ metadata.gz: dc49345ed34f38eed1600818c0b28910a5525a22c8388338c5739650339c9ec1
4
+ data.tar.gz: a63830d52d1ed45aa575c6ee2d924c547a74260697853680928fbc0a586d1cfb
5
5
  SHA512:
6
- metadata.gz: 28328c475862c7a51e34d6ea9cfeabe3ede92f7716515bf7ca514c4cff2a1e07fba240fd76a0ad98fc96c0c07b2fc15c047df31b957b032956805da3cbf862d0
7
- data.tar.gz: 25b3b997fd617897c43f1d543424581a36f4d26f06c05fbc28ae7b7a6d1b1d53e13c97761380da36f9e8a9160b1124edf85d81aeb4a2aec527646c096ecb1b46
6
+ metadata.gz: 8111bb7846cc0dc220742313c253f6d719d31213ac05c35443eb4dc27058ec236b6bd13b946ad6870ca38b5e48f853385532bc2513f8897c3e5df10c3be3afed
7
+ data.tar.gz: cb3b394f94d175c127b874bba207fc4933e49a91197c48822ea8968578ec57d0dd42730b19eb2a7d6a57eebf44b77615d8b84094d2b3419f88d30b5ae34f1e03
data/data/commas.yml CHANGED
@@ -8,4 +8,4 @@ commas:
8
8
  diaschisma: 2048/2025
9
9
  dieses1: 648/625
10
10
  dieses2: 128/125
11
- septimal: 64/63
11
+ septimal: 64/63
@@ -4,6 +4,9 @@ class Tonal::Ratio
4
4
  DEFAULT_MAX_GRID_SCALE = 100
5
5
  DEFAULT_MAX_GRID_BOUNDARY = 5
6
6
  DEFAULT_DEPTH = Float::INFINITY
7
+ DEFAULT_FRACTION_TREE_DEPTH = 10
8
+ DEFAULT_SUPERPART_DEPTH = 20
9
+ DEFAULT_NEIGHBORHOOD_DEPTH = 10
7
10
  DEFAULT_COMPLEXITY_AMOUNT = 50.0
8
11
  CONVERGENT_LIMIT = 10
9
12
 
@@ -47,7 +50,7 @@ class Tonal::Ratio
47
50
  # @param max_prime the maximum prime number to allow in the collection
48
51
  # @param conv_limit the number of convergents to limit the ContinuedFraction method
49
52
  #
50
- def by_quotient_walk(cents_tolerance: Tonal::Cents::TOLERANCE, depth: DEFAULT_DEPTH, max_prime: DEFAULT_MAX_PRIME, conv_limit: CONVERGENT_LIMIT)
53
+ def by_quotient_walk(cents_tolerance: Tonal::Cents::TOLERANCE, depth: DEFAULT_FRACTION_TREE_DEPTH, max_prime: DEFAULT_MAX_PRIME, conv_limit: CONVERGENT_LIMIT)
51
54
  self_in_cents = to_cents
52
55
  within = cents_tolerance.kind_of?(Tonal::Cents) ? cents_tolerance : Tonal::Cents.new(cents: cents_tolerance)
53
56
 
@@ -68,7 +71,7 @@ class Tonal::Ratio
68
71
  # @param depth the maximum number of ratios in the collection
69
72
  # @param max_prime the maximum prime number to allow in the collection
70
73
  #
71
- def by_tree_path(cents_tolerance: Tonal::Cents::TOLERANCE, depth: DEFAULT_DEPTH, max_prime: DEFAULT_MAX_PRIME)
74
+ def by_tree_path(cents_tolerance: Tonal::Cents::TOLERANCE, depth: DEFAULT_FRACTION_TREE_DEPTH, max_prime: DEFAULT_MAX_PRIME)
72
75
  self_in_cents = to_cents
73
76
  within = cents_tolerance.kind_of?(Tonal::Cents) ? cents_tolerance : Tonal::Cents.new(cents: cents_tolerance)
74
77
  Set.new(ratio: ratio) do |ratios|
@@ -89,7 +92,7 @@ class Tonal::Ratio
89
92
  # @param max_prime the maximum prime number to allow in the collection
90
93
  # @param superpart if the superior part is the numerator or denominator
91
94
  #
92
- def by_superparticular(cents_tolerance: Tonal::Cents::TOLERANCE, depth: 20, max_prime: DEFAULT_MAX_PRIME, superpart: :upper)
95
+ def by_superparticular(cents_tolerance: Tonal::Cents::TOLERANCE, depth: DEFAULT_SUPERPART_DEPTH, max_prime: DEFAULT_MAX_PRIME, superpart: :upper)
93
96
  self_in_cents = to_cents
94
97
  within = cents_tolerance.kind_of?(Tonal::Cents) ? cents_tolerance : Tonal::Cents.new(cents: cents_tolerance)
95
98
  Set.new(ratio: ratio) do |ratios|
@@ -113,7 +116,7 @@ class Tonal::Ratio
113
116
  # @param max_boundary the maximum distance grid ratios will be from the scaled ratio
114
117
  # @param max_scale the maximum self will be scaled
115
118
  #
116
- def by_neighborhood(cents_tolerance: Tonal::Cents::TOLERANCE, depth: DEFAULT_DEPTH, max_prime: DEFAULT_MAX_PRIME, max_boundary: DEFAULT_MAX_GRID_BOUNDARY, max_scale: DEFAULT_MAX_GRID_SCALE)
119
+ def by_neighborhood(cents_tolerance: Tonal::Cents::TOLERANCE, depth: DEFAULT_NEIGHBORHOOD_DEPTH, max_prime: DEFAULT_MAX_PRIME, max_boundary: DEFAULT_MAX_GRID_BOUNDARY, max_scale: DEFAULT_MAX_GRID_SCALE)
117
120
  self_in_cents = to_cents
118
121
  within = cents_tolerance.kind_of?(Tonal::Cents) ? cents_tolerance : Tonal::Cents.new(cents: cents_tolerance)
119
122
  Set.new(ratio: ratio) do |ratios|
@@ -1,4 +1,4 @@
1
1
  module Tonal
2
2
  TOOLS_PRODUCER = "mTonal"
3
- TOOLS_VERSION = "5.0.1"
3
+ TOOLS_VERSION = "5.1.1"
4
4
  end
data/lib/tonal/cents.rb CHANGED
@@ -56,6 +56,7 @@ class Tonal::Cents
56
56
  @value.round(precision)
57
57
  end
58
58
  alias :cents :value
59
+ alias :to_f :value
59
60
 
60
61
  # @return
61
62
  # [Tonal::Cents] nearest hundredth cent value
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.0.1
4
+ version: 5.1.1
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-03-23 00:00:00.000000000 Z
11
+ date: 2024-04-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: yaml