Class: Music::Transcription::Tempo::BPM

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_npm(beat_dur) ⇒ Object



56
57
58
# File 'lib/music-transcription/conversion/tempo_conversion.rb', line 56

def to_npm beat_dur
  Tempo::NPM.new(beat_dur*@value)
end

#to_nps(beat_dur) ⇒ Object



52
53
54
# File 'lib/music-transcription/conversion/tempo_conversion.rb', line 52

def to_nps beat_dur
  Tempo::NPS.new(Rational(@value*beat_dur,60))
end

#to_qnpm(beat_dur) ⇒ Object



48
49
50
# File 'lib/music-transcription/conversion/tempo_conversion.rb', line 48

def to_qnpm beat_dur
  Tempo::QNPM.new(4*beat_dur*@value)
end

#to_sObject



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

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