tonal-tools 8.5.0 → 8.5.2

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: 520c39d6d3f6519ad21174305aaa089babd81bccde2416ddc09e2cc22d3f5ae7
4
- data.tar.gz: 03ecbc849c92b953298c804c7b43caa0c020290dd3a1f183a5cfea3a0728fdaa
3
+ metadata.gz: 9693004e4d76b2c000404f674643eab88d6f9cfa6096d2c7f47e7f25eabfb8b1
4
+ data.tar.gz: cbf08e054d50ba6b677472aeb5d8824c45dd2493425cecbea0852aeb50a50249
5
5
  SHA512:
6
- metadata.gz: 21af61fe964bff3bca95070e3796fcaa77b93e52dadc68314eb52b0dafa08932486cfa988d6bacab9a0dc86b3543d4782534f575304d752b0ad34155785b1578
7
- data.tar.gz: ba8d2348c7b0d9f50bd8188051c64db63c49dd5d731ad1b2e61c473a844242978809edce8df261b761ff6efb13220f1ebcc737edf45b52a4fea2481e03299fe7
6
+ metadata.gz: d2ba9456c73a6a6c48ef51acc2fd0572f8ffd9be7a0735b77b18c6a1e0a8faf6a352df45b3d5f44b057200c51e936ea9ba21d5ea210fdf607a327c33ebf4282a
7
+ data.tar.gz: '02078ab88ddd46711864a22a4b568e2f2c0df14d3c854518e2eb01835b1abaacb4a8d5148988381b2fd3c8553eb21361f8faff725405c242f0a6a6e379e7233b'
@@ -1,4 +1,4 @@
1
1
  module Tonal
2
2
  TOOLS_PRODUCER = "mTonal"
3
- TOOLS_VERSION = "8.5.0"
3
+ TOOLS_VERSION = "8.5.2"
4
4
  end
data/lib/tonal/step.rb CHANGED
@@ -41,12 +41,13 @@ class Tonal::Scale
41
41
  # @return [Rational] of the step
42
42
  # @example
43
43
  # Tonal::Scale::Step.new(ratio: 3/2r, modulo: 31).step_to_r
44
- # => (6735213777669305/4503599627370496)
44
+ # => (18/31)
45
+ # Tonal::Scale::Step.new(ratio: 3/2r, modulo: 34).step_to_r
46
+ # => (10/17)
45
47
  #
46
48
  def step_to_r
47
- tempered.to_r
49
+ Rational(step, modulo)
48
50
  end
49
- alias :to_r :step_to_r
50
51
 
51
52
  # @return [Rational] of the ratio
52
53
  # @example
@@ -57,15 +58,14 @@ class Tonal::Scale
57
58
  ratio.to_r
58
59
  end
59
60
 
60
- # @return [Tonal::Cents] measure of step in cents
61
+ # @return [Tonal::Cents] measure of tempered in cents
61
62
  # @example
62
- # Tonal::Scale::Step.new(ratio: 3/2r, modulo: 31).step_to_cents
63
+ # Tonal::Scale::Step.new(ratio: 3/2r, modulo: 31).tempered_to_cents
63
64
  # => 696.77
64
65
  #
65
- def step_to_cents
66
+ def tempered_to_cents
66
67
  tempered.to_cents
67
68
  end
68
- alias :to_cents :step_to_cents
69
69
 
70
70
  # @return [Tonal::Cents] measure of ratio in cents
71
71
  # @example
@@ -76,13 +76,13 @@ class Tonal::Scale
76
76
  ratio.to_cents
77
77
  end
78
78
 
79
- # @return [Tonal::Cents] the difference between the step and the ratio
79
+ # @return [Tonal::Cents] the difference between the tempered number and the ratio
80
80
  # @example
81
81
  # Tonal::Scale::Step.new(ratio: 3/2r, modulo: 31).efficiency => 5.19 ¢
82
82
  #
83
83
  def efficiency
84
- # We want the efficiency from the step (self). The step is the tempered approximation of the ratio, so we want to know how far off the step is from the ratio. So we take the ratio and subtract the step.
85
- ratio_to_cents - step_to_cents
84
+ # We want the efficiency from the step (self). The tempered value is the tempered approximation of the ratio, so we want to know how far off the step is from the ratio. So we take the ratio and subtract the tempered value.
85
+ ratio_to_cents - tempered_to_cents
86
86
  end
87
87
  alias :cents_difference :efficiency
88
88
 
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: 8.5.0
4
+ version: 8.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jose Hales-Garcia
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2026-05-02 00:00:00.000000000 Z
10
+ date: 2026-05-03 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  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: 4.0.8
195
+ rubygems_version: 4.0.11
196
196
  specification_version: 4
197
197
  summary: Tonal tools
198
198
  test_files: []