# Uncommon type of timed events

**URL:** <https://forums.unrealengine.com/t/uncommon-type-of-timed-events/1182821>\
**Category:** Blueprint\
**Tags:** delay, event-dispatcher, data-table, unreal-engine, sequence, Blueprint, question\
**Created:** [May 29, 2023, 10:20pm UTC](https://forums.unrealengine.com/t/uncommon-type-of-timed-events/1182821 "2023-05-29T22:20:43Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Robostep98291](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Robostep98291](https://forums.unrealengine.com/u/Robostep98291)\
**Post date:** [May 29, 2023, 10:20pm UTC](https://forums.unrealengine.com/t/uncommon-type-of-timed-events/1182821/1 "2023-05-29T22:20:43Z")

</div>

I have a data table which is converted to an array of strings. The values represent milliseconds on which sound should be fired. My first approach was to compare in-game time with a row value. If it is equal then sound plays, if not - wait until next tick. The problem is that time between adjacent row values is less than a tick. My question is can i use an array of milliseconds to play sound in correct time?

---

<div class="post-metadata">

**Author:** ![EliasWick](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/eliaswick/32/1175208_2.png) [@EliasWick](https://forums.unrealengine.com/u/EliasWick)\
**Post date:** [May 30, 2023, 7:19am UTC](https://forums.unrealengine.com/t/uncommon-type-of-timed-events/1182821/2 "2023-05-30T07:19:20Z")

</div>

Hey! I did a quick check and my suspicion to your method was proven correct. Using the code below: The **Print String** “Hello” does never executes when the **Get Game Time in Seconds** reaches 1. The Branch probably skips some of the game time, because it’s not possible to return data quickly enough using the **Event Tick**.

 ![bild](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/1/1/91174fd34e9ce15d6de070f36e3e32ca99a6c111.png)

Increasing the span as such will yield a “Hello” 1-3 times:

 ![bild](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/5/9/3598409a9a927f1c886ada1850fadf3f8593b1c7.png)

You would probably need to find another method if you are required to execute on the precision of a millisecond.

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [May 30, 2023, 9:29am UTC](https://forums.unrealengine.com/t/uncommon-type-of-timed-events/1182821/3 "2023-05-30T09:29:54Z")

</div>

> [@EliasWick](#):
>
> You would probably need to find another method if you are required to execute on the precision of a millisecond.

I wonder if one could employ a timer - it’s quite happy to fire in between the frames, as many times needed, too. But the results are not distributed _equally_ between the 2 frames, afaik.

> The problem is that time between adjacent row values is less than a tick.

What is the end goal, though? What are you making that is so time sensitive? Let’s say you manage to pull it off and read the lines faster than Tick (with a timer). You _still_ cannot _start_ playing the sound between the frames (can you?). You can always up the frames, ofc, a sustainable 240Hz refresh is easily achievable these days. Modern computers reach several hundred frames per second, you could breach 1k fps. I’m ignoring the fact that 500Hz+ refresh screens are not available commercially, we’re talking sound, anyway.

And coming back to the actual application, can anyone tell if the sounds is played in the 1st or 2nd frame, even in a sluggish 30Hz scenario? If you add up all the input lag from the user devices, the 10ms delay seems insignificant. Someone corrects me here if I’m wrong, please.

---

<div class="post-metadata">

**Author:** ![Robostep98291](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Robostep98291](https://forums.unrealengine.com/u/Robostep98291)\
**Post date:** [May 30, 2023, 12:11pm UTC](https://forums.unrealengine.com/t/uncommon-type-of-timed-events/1182821/4 "2023-05-30T12:11:12Z")

</div>

For now i decided to fire event based on “less or equal” condition. It seems to work as expected.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/0/8/008c633c41a3da42702c904f3ce408bbebdcb370.png)

> [@Everynone](#):
>
> What is the end goal, though? What are you making that is so time sensitive?

I’m trying to make a rhythm game and i don’t want to use third party plugins. MIDI clock fires approximately every 0.005208333333 seconds at BPM 120. My time values are in MIDI clock and converted to milliseconds.  
EDIT: Thanks for help everyone

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [May 30, 2023, 12:14pm UTC](https://forums.unrealengine.com/t/uncommon-type-of-timed-events/1182821/5 "2023-05-30T12:14:50Z")

</div>

So it does not really matter then. You’re not doing anything between the frames. You just need to check when something is ready to go on the current frame.

---

<div class="post-metadata">

**Author:** ![3dRaven](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/3draven/32/906552_2.png) [@3dRaven](https://forums.unrealengine.com/u/3dRaven)\
**Post date:** [May 30, 2023, 12:20pm UTC](https://forums.unrealengine.com/t/uncommon-type-of-timed-events/1182821/6 "2023-05-30T12:20:24Z")

</div>

For rhythm games I’d suggest looking at the Quartz Sub-system. It’s specifically built with music and timing in mind (sound quantization events etc)

---

<div class="post-metadata">

**Author:** ![Robostep98291](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Robostep98291](https://forums.unrealengine.com/u/Robostep98291)\
**Post date:** [May 30, 2023, 12:22pm UTC](https://forums.unrealengine.com/t/uncommon-type-of-timed-events/1182821/7 "2023-05-30T12:22:46Z")

</div>

44100 hz audio is still faster than 240 hz video. Think about it🤔

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [May 30, 2023, 12:23pm UTC](https://forums.unrealengine.com/t/uncommon-type-of-timed-events/1182821/8 "2023-05-30T12:23:34Z")

</div>

It does not matter. You cannot start / stop sound between the frames. The framerate is the execution frequency limiter. You’d need to go much deeper than BPs to achieve that.

---

<div class="post-metadata">

**Author:** ![Robostep98291](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Robostep98291](https://forums.unrealengine.com/u/Robostep98291)\
**Post date:** [May 30, 2023, 12:24pm UTC](https://forums.unrealengine.com/t/uncommon-type-of-timed-events/1182821/9 "2023-05-30T12:24:03Z")

</div>

I’ll look into it. Thanks

---

<div class="post-metadata">

**Author:** ![Robostep98291](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Robostep98291](https://forums.unrealengine.com/u/Robostep98291)\
**Post date:** [May 30, 2023, 12:26pm UTC](https://forums.unrealengine.com/t/uncommon-type-of-timed-events/1182821/10 "2023-05-30T12:26:22Z")

</div>

Ah, i see. Now it is clear. Thank you

---

<div class="post-metadata">

**Author:** ![system](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/1/3/713c9d3f58553f0de89543d76a8a3a2779dc9fa4.png) [@system](https://forums.unrealengine.com/u/system)\
**Post date:** [June 29, 2023, 12:26pm UTC](https://forums.unrealengine.com/t/uncommon-type-of-timed-events/1182821/11 "2023-06-29T12:26:58Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
