Skip to content
Search

Beats Per Minute

lastmod 2023-05-01created 2021-01-284 edits

Short for Beat Per Min. That is, beats per minute: the number of 1/4 beats per minute.

About

A unit for expressing tempo in music. That is, how many beats per minute the piece is played at; naturally, the higher the beat count, the more beats fit into a minute, so the tempo is faster. However, depending on what counts as a 'beat', the BPM can vary by a factor of 2n or 1/2n. Since its definition is the same as hertz, the two can be converted into each other, though this is rarely done. 1 Hz = 60 BPM.

Note that 60BPM equals 1 minute, and 60BPM in 4 beats also means 1 second per beat. You can use this to build a metronome program. Making a rhythm game is easy, right?

In modern music, BPM is also an indicator of the characteristics of certain genres. This tendency is especially strong in EDM and dance music.

How to calculate

/// Default Bit Per Minutes. (60bpm => 60beat/60second == 1beat/1second)
public static readonly int BPM_UNIT = 60;

public int Divisions { get; private set; } // 4분음표를 몇개로 분할 수 있는가? 의 단위
public int TotalDuration { get; private set; } // 전체 기간 Divisions 값을 참고해야 한다.

public float TotalDurationPerDivisions => (float)TotalDuration / (float)Divisions;
public float TotalBeats => TotalDurationPerDivisions; // 악보의 전체 비트 수. (즉, 4분음표 의 개수)

// ...

var delta = 1.0f; // 직전 업데이트에서 현재 업데이트 까지 경과 시간 (초)
var bpm = 120; // 현재 출력하고자 하는 "bpm" 변수. (만약 120BPM 이면 1초에 두 박자, 즉 1초에 1/4음표 2개 이다)

var beatPerSecond = (float)bpm / (float)60; // 초당 비트 수
var totalSeconds = TotalBeats / beatPerSecond; // 악보의 전체 '초' 수
var deltaPercentage = delta / totalSeconds; // 직전 업데이트에서 현재 업데이트 까지 경과한 퍼센테이지

ProgressPercentage += deltaPercentage; // 현재 진행률 (퍼센테이지)

See also

Favorite site

author Zer0 sitemap