Class: Vector

Inherits:
Object
  • Object
show all
Defined in:
lib/tonal/extensions.rb

Instance Method Summary collapse

Instance Method Details

#to_ratio(reduced: true, equave: 2) ⇒ Tonal::Ratio Also known as: ratio

Examples:

Vector[3,2].ratio => (3/2)

Parameters:

  • reduced (defaults to: true)
  • equave (defaults to: 2)

Returns:



391
# File 'lib/tonal/extensions.rb', line 391

def to_ratio(reduced: true, equave: 2/1r) = reduced ? Tonal::ReducedRatio.new(*self, equave: equave) : Tonal::Ratio.new(*self, equave: equave)