13 lines
288 B
GDScript
13 lines
288 B
GDScript
class_name Tempo
|
|
|
|
static func get_crotchet(bpm):
|
|
return ((60 / bpm) * 1000)
|
|
|
|
static func get_bpm(crotchet):
|
|
return ((1000 / crotchet) * 60)
|
|
|
|
static func beat_at_time(time, bpm):
|
|
return time / get_crotchet(bpm)
|
|
|
|
static func time_at_beat(beat, bpm):
|
|
return beat * get_crotchet(bpm)
|