Godot-Mixing-Desk icon indicating copy to clipboard operation
Godot-Mixing-Desk copied to clipboard

Beat progress variable

Open Vertiverti opened this issue 2 years ago • 1 comments

Telegraphing events before they happen or having windup animations for events that synchronise to the beat of the music is a common enough scenario. It's not feasible to have a signal like beat for this (because the amount of leeway you need can vary), but a beat progress variable could be useful for this.

Admittedly, I've not looked into the code for too long, but I couldn't find anything like it. It's just a couple lines of code at the end of _process to add it, though.

beat_progress = ((time/beat_length_ms) * 1000.0) beat_progress = beat_progress - int(floor(beat_progress)) returns beat_progress between 0.0 and 1.0

& then any nodes which use it would compare beat_progress & current beat to decide when to do whatever logic they need to.

I'm not aware of any other way to do this using GMD - if there is a better way, I'd love to hear it. But if not, I think this change would be really useful (:

Vertiverti avatar Jul 03 '21 05:07 Vertiverti

@Vertiverti I see no reason not to include something like this, so I'll bundle it with the next update, which should be coming in the next week or so. Thanks for bringing this up :)

kyzfrintin avatar Sep 05 '21 12:09 kyzfrintin