Module: Tonal::IRBHelpers
- Defined in:
- lib/tonal/irb_helpers.rb
Instance Method Summary collapse
-
#er(**kwargs) ⇒ Tonal::ExtendedRatio
An extended ratio.
-
#i(*args, reduced: true) ⇒ Tonal::Interval
The interval between the given args.
-
#r(*args) ⇒ Tonal::Ratio
An unreduced ratio.
-
#rr(*args) ⇒ Tonal::ReducedRatio
A reduced ratio.
-
#ser(**kwargs) ⇒ Tonal::SubharmonicExtendedRatio
A subharmonic extended ratio.
Instance Method Details
#er(**kwargs) ⇒ Tonal::ExtendedRatio
Returns an extended ratio.
43 44 45 |
# File 'lib/tonal/irb_helpers.rb', line 43 def er(**kwargs) Tonal::ExtendedRatio.new(**kwargs) end |
#i(*args, reduced: true) ⇒ Tonal::Interval
Returns the interval between the given args.
35 36 37 |
# File 'lib/tonal/irb_helpers.rb', line 35 def i(*args, reduced: true) Tonal::Interval.new(*args, reduced:) end |
#r(*args) ⇒ Tonal::Ratio
Returns an unreduced ratio.
10 11 12 |
# File 'lib/tonal/irb_helpers.rb', line 10 def r(*args) args.empty? ? Tonal::Ratio : Tonal::Ratio.new(*args) end |
#rr(*args) ⇒ Tonal::ReducedRatio
Returns a reduced ratio.
21 22 23 |
# File 'lib/tonal/irb_helpers.rb', line 21 def rr(*args) args.empty? ? Tonal::ReducedRatio : Tonal::ReducedRatio.new(*args) end |
#ser(**kwargs) ⇒ Tonal::SubharmonicExtendedRatio
Returns a subharmonic extended ratio.
51 52 53 |
# File 'lib/tonal/irb_helpers.rb', line 51 def ser(**kwargs) Tonal::SubharmonicExtendedRatio.new(**kwargs) end |