Class: Music::Transcription::Tempo::NPS

Inherits:
Music::Transcription::Tempo show all
Defined in:
lib/music-transcription/model/tempo.rb,
lib/music-transcription/conversion/tempo_conversion.rb

Constant Summary

Constants inherited from Music::Transcription::Tempo

CONVERSION_METHOD, PARSER

Constants included from Parseable

Parseable::DEFAULT_SPLIT_PATTERN

Instance Attribute Summary

Attributes inherited from Music::Transcription::Tempo

#value

Instance Method Summary collapse

Methods inherited from Music::Transcription::Tempo

#==, #clone, #convert, #initialize

Methods included from Parseable

included

Constructor Details

This class inherits a constructor from Music::Transcription::Tempo

Instance Method Details

#to_bpm(beat_dur) ⇒ Object



66
67
68
# File 'lib/music-transcription/conversion/tempo_conversion.rb', line 66

def to_bpm beat_dur
  Tempo::BPM.new(Rational(60,@value*beat_dur))
end

#to_npmObject



70
71
72
# File 'lib/music-transcription/conversion/tempo_conversion.rb', line 70

def to_npm
  Tempo::NPM.new(Rational(60,@value))
end

#to_qnpmObject



62
63
64
# File 'lib/music-transcription/conversion/tempo_conversion.rb', line 62

def to_qnpm
  Tempo::QNPM.new(Rational(240,@value))
end

#to_sObject



22
# File 'lib/music-transcription/model/tempo.rb', line 22

def to_s; "#{@value}nps" end