FunkPanion/scripts/Tempo.gd

14 lines
288 B
GDScript3
Raw Normal View History

2024-11-23 20:36:52 +00:00
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)