tonal-tools 5.0.1 → 5.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/data/commas.yml +1 -1
- data/lib/tonal/approximation.rb +7 -4
- data/lib/tonal/attributions.rb +1 -1
- data/lib/tonal/cents.rb +1 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dc49345ed34f38eed1600818c0b28910a5525a22c8388338c5739650339c9ec1
|
4
|
+
data.tar.gz: a63830d52d1ed45aa575c6ee2d924c547a74260697853680928fbc0a586d1cfb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8111bb7846cc0dc220742313c253f6d719d31213ac05c35443eb4dc27058ec236b6bd13b946ad6870ca38b5e48f853385532bc2513f8897c3e5df10c3be3afed
|
7
|
+
data.tar.gz: cb3b394f94d175c127b874bba207fc4933e49a91197c48822ea8968578ec57d0dd42730b19eb2a7d6a57eebf44b77615d8b84094d2b3419f88d30b5ae34f1e03
|
data/data/commas.yml
CHANGED
data/lib/tonal/approximation.rb
CHANGED
@@ -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:
|
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:
|
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:
|
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:
|
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|
|
data/lib/tonal/attributions.rb
CHANGED
data/lib/tonal/cents.rb
CHANGED
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.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-
|
11
|
+
date: 2024-04-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: yaml
|