0.1.8 • Published 5 years ago
@vapurrmaid/bpm v0.1.8
@vapurrmaid/bpm
A simple zero-dependency package for working with BPM calculations.
BPM class
Constructor
new BPM(bpm);- bpm: number- A number greater than 0
Public Properties
- value: number- Number of beats per minute (BPM)
Public Methods
durationFor
Calculates the duration (in seconds) for a particular note at the BPM.
  durationFor(aNote, beatNote = "quarter"): number- aNote: NoteDuration- the note to calculate the duration for
- beatNote: NoteDuration- the note that's considered 1 beat
numberOfBeatsFor
Calculates the number of beats for the given note duration at this BPM.
numberOfBeatsFor(aNote, beatNote = "quarter"): number- aNote: NoteDuration- the note to calculate the duration for
- beatNote: NoteDuration- the note that's considered 1 beat