FunkPanion/scripts/Tempo.gd
2024-11-23 14:36:52 -06:00

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)