Margin of error for quantized gameplay actions | Help seting up?

Hey!

I have been experimenting with the Quartz Clock and using it as a motor for my gameplay events in my rhythm game prototype. Everything the player can interact with is bound to the same setup and is driven by the Quartz Clock, so whatever they are trying to do is only going to be triggered on the beat.

Current Setup:

(“Quantized on Beat” gets called by the Quartz Clock Event)

This generaly works, but it is frustrating UX wise. I need to add a margin of error which handles slightly offset inputs. Right now this setup registers your input and performs the action on the next beat, but I want to set up a margin of frames or ms AFTER the beat that allows the input to still go through, even if it would slightly trigger offset from the beat.

Any ideas and suggestions?