The Godot Q&A is currently undergoing maintenance!

Your ability to ask and answer questions is temporarily disabled. You can browse existing threads in read-only mode.

We are working on bringing this community platform back to its full functionality, stay tuned for updates.

godotengine.org | Twitter

0 votes

Process in settings Timer node set on Fixed. But starting timer in project along with the metronome playing in FL Studio (or musical composition in a player) I find a discrepancy. Sometimes next kick it sounds a bit later or earlier than necessary.

My script looks like this:

onready var sounds = get_node("SamplePlayer")
onready var timer = get_node("Timer")
var BPM = 160

func _ready():
    set_fixed_process(true)
    timer.start()

func _fixed_process( delta ):
    # I tried to move following line in ready() function without delta
    timer.set_wait_time((60/BPM)*(60*delta))

func _on_Timer_timeout():
    sounds.play("kick", false)

How can I automatically adjust timer as perfectly aligned metronome?

in Engine by (19 points)
edited by

1 Answer

0 votes

I kinda did something to make an accurate metronome

https://gitlab.com/gianclgar/accurare-metronome-godot-gdscript/

by (64 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.