Latency between adding and playing a midi note

I’m still a little unclear about the use case here so it’s hard to give advise. You usually have “live play” which you want to hear immediately and then “recorded play” which would be your scheduled events.
If your scheduled events are so close to your live events that this is unclear, I’m not sure what exact semantics would work for your use case.

However, if you follow this thread (Show Midi Data As It Is Recorded) you’ll see mention of AudioTrack::Listener and it’s recordedMidiMessageSentToPlugins callback. You might be able to use this to determine what actually has been sent to the plugin.

You won’t be able to reliably determine a thresholdTime as it will depend heavily on the resources of the target machine and the complexity of the Edit being played back.

How are you working out when notes should be played back live and when notes should be scheduled and how far in to the future? Do you want these scheduled events to always be played back e.g. if the user starts playback from the beginning again?