# Event Callback Timeline\_Beat doesn't give messages via nested or referenced events

**URL:** <https://qa.fmod.com/t/event-callback-timeline-beat-doesnt-give-messages-via-nested-or-referenced-events/16816>\
**Category:** Unity\
**Created:** [February 26, 2021, 3:49pm UTC](https://qa.fmod.com/t/event-callback-timeline-beat-doesnt-give-messages-via-nested-or-referenced-events/16816 "2021-02-26T15:49:27Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![FelixSherar](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/felixsherar/32/850_2.png) [@FelixSherar](https://qa.fmod.com/u/FelixSherar)\
**Post date:** [February 26, 2021, 3:49pm UTC](https://qa.fmod.com/t/event-callback-timeline-beat-doesnt-give-messages-via-nested-or-referenced-events/16816/1 "2021-02-26T15:49:27Z")

</div>

I’m currently trying to callback the tempo marker of either a nested or referenced event, at 0 or 1 depth level. I’m doing it via timeline\_beat seen in the line below:

evtInstance.setCallback(beatCallback, EVENT\_CALLBACK\_TYPE.TIMELINE\_BEAT);

It works if the event I reference is just the actual event that has the tempo marker. Problem is, I have all music tracks referenced in a parent event that changes the music tracks randomly over time. Reading around the forums, it appears as though it should be possible to get the tempo marker/timeline\_beat of at least 1 depth level. But I’ve tried 0 depth levels (the event isn’t nested, just referenced by dragging and dropping from the browser) and of course as nested. I’m on FMOD 2.01.07.

Here is a screenshot of how the parent event looks:

 ![Screenshot 2021-02-26 at 16.48.55](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/3/3075d5382f9d590b78042a091167b4f95752f9b3.png)

---

<div class="post-metadata">

**Author:** ![joseph](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/joseph/32/264_2.png) [@joseph](https://qa.fmod.com/u/joseph)\
**Post date:** [March 1, 2021, 3:50am UTC](https://qa.fmod.com/t/event-callback-timeline-beat-doesnt-give-messages-via-nested-or-referenced-events/16816/2 "2021-03-01T03:50:39Z")

</div>

When you set the callback, which callback type mask did you use?

---

<div class="post-metadata">

**Author:** ![FelixSherar](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/felixsherar/32/850_2.png) [@FelixSherar](https://qa.fmod.com/u/FelixSherar)\
**Post date:** [March 1, 2021, 9:26am UTC](https://qa.fmod.com/t/event-callback-timeline-beat-doesnt-give-messages-via-nested-or-referenced-events/16816/3 "2021-03-01T09:26:56Z")

</div>

Not quite sure what you mean by type mask, but I assume it isn’t EVENT\_CALLBACK\_TYPE.TIMELINE\_BEAT?

---

<div class="post-metadata">

**Author:** ![joseph](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/joseph/32/264_2.png) [@joseph](https://qa.fmod.com/u/joseph)\
**Post date:** [March 2, 2021, 4:22am UTC](https://qa.fmod.com/t/event-callback-timeline-beat-doesnt-give-messages-via-nested-or-referenced-events/16816/4 "2021-03-02T04:22:05Z")

</div>

If you didn’t specify a type mask, then FMOD defaults to the `EVENT_CALLBACK_TYPE.ALL` mask, which should allow the EVENT\_CALLBACK\_TYPE.TIMELINE\_BEAT callback type though.

Are you registering the callback with the parent event? If you just register it with the event description of the nested or referenced event, it won’t be passed to the parent.

---

<div class="post-metadata">

**Author:** ![FelixSherar](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/felixsherar/32/850_2.png) [@FelixSherar](https://qa.fmod.com/u/FelixSherar)\
**Post date:** [March 2, 2021, 9:43am UTC](https://qa.fmod.com/t/event-callback-timeline-beat-doesnt-give-messages-via-nested-or-referenced-events/16816/5 "2021-03-02T09:43:40Z")

</div>

Here is the code, it is basically the example lifted from the docs on timeline callbacks. Line 49 has the EVENT\_CALLBACK\_TYPE.TIMELINE\_BEAT.

[fmodcalllbackhandler.txt](https://qa.fmod.com/uploads/short-url/fyuOS3rPZUVwSYJi1rvcBqgEisZ.txt) (3.9 KB)

I don’t understand what you mean by registering the callback wit the parent event, or what the event description is referring to.

In Unity, the FMODCallBackHandler has a reference to the parent event:

 ![Screenshot 2021-03-02 at 10.42.49](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/1/10a450caeb8a1290c37d972d334dc0a845b1f3dd.png)  
 ![Screenshot 2021-03-02 at 10.42.58](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/1/1d3dfb4423b6c5daa66330273b58e01ed072129d.png)

---

<div class="post-metadata">

**Author:** ![tristanjl](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/tristanjl/32/261_2.png) [@tristanjl](https://qa.fmod.com/u/tristanjl)\
**Post date:** [March 4, 2021, 4:58am UTC](https://qa.fmod.com/t/event-callback-timeline-beat-doesnt-give-messages-via-nested-or-referenced-events/16816/6 "2021-03-04T04:58:03Z")

</div>

Hi FelixSherar,

It appears when we were adding better support for nested event callbacks, we chose not to enable beat callbacks. I believe the thinking was that you won’t be able to discern which event the callback is coming from if the parent or multiple child events have tempo markers, so the usefulness of the feature was in question.

However, we can look to add support for that in a future version.

---

<div class="post-metadata">

**Author:** ![FelixSherar](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/felixsherar/32/850_2.png) [@FelixSherar](https://qa.fmod.com/u/FelixSherar)\
**Post date:** [March 4, 2021, 8:33am UTC](https://qa.fmod.com/t/event-callback-timeline-beat-doesnt-give-messages-via-nested-or-referenced-events/16816/7 "2021-03-04T08:33:32Z")

</div>

Hi tristanjl,

Thanks for the clarification. I guess that is where the confusion stems from, the fact that other types of markers work in child events, but beat callbacks are exclusive to a single event. It would be very useful if you could pick which event (parent or child) it should do the beat callback from. I’m not sure if this could be done by checking if the parent event has a tempo marker or not. If it has one, it sends callback messages from that, but if it doesn’t, it goes to the next tempo marker it can find in any of the child events.

If there are multiple child events with tempo markers, I suppose it could pick whichever event is currently playing (that it would work with my example above with a multi-instrument hosting the child events.)  
If the child events are playing simultaneously, it could pick the first one it finds, although I suppose this is a really specific use-case, and I can’t even see where you would want to use this, which goes back to your argument of the usefulness being in question.

But if you could at least discern between parent and “currently playing” child events, that would be great. The reason I’ve set it up this way is that the parent event controls the randomization and transitions between the child events. It cycles through the child events at random, then loops them. But the loop region has a 1% chance to disable itself, which will make the playhead go to **Transition Marker A** which sends it back to **Marker A** , picking a new child event and loops again.  
This is much easier and more manageable than having a custom script that handles all this.

Regardless, until this feature goes in, if it even does, do you have any ideas about workarounds for this?

The only other way I can see this working would be doing something like having all the child events listed horizontally on the timeline and have a bunch of transition markers to jump between, but that is gonna get messy fast with transition markers. Then have a parameter that gets randomized from script and then set conditions of the transition markers to be hooked up to this parameter. Something along the lines of this:

 ![Screenshot 2021-03-04 at 10.41.03](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/1/153178da48fa8bedb050eefc649f85eda31d244d.png)

---

<div class="post-metadata">

**Author:** ![tristanjl](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/tristanjl/32/261_2.png) [@tristanjl](https://qa.fmod.com/u/tristanjl)\
**Post date:** [March 5, 2021, 6:07am UTC](https://qa.fmod.com/t/event-callback-timeline-beat-doesnt-give-messages-via-nested-or-referenced-events/16816/8 "2021-03-05T06:07:21Z")

</div>

Something similar to what you are showing is probably the best approach.

For nested beat callback support, we will look to implement a solution that is compatible with as many different use cases as possible.

---

<div class="post-metadata">

**Author:** ![FelixSherar](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/felixsherar/32/850_2.png) [@FelixSherar](https://qa.fmod.com/u/FelixSherar)\
**Post date:** [March 5, 2021, 10:40am UTC](https://qa.fmod.com/t/event-callback-timeline-beat-doesnt-give-messages-via-nested-or-referenced-events/16816/9 "2021-03-05T10:40:38Z")

</div>

Alright, it will be a bit messy, is there any limit to how many markers an event can have stacked in the marker track?

Hope to see that feature implemented soon, would definitely make this a lot more tidy and simple. Thank you!

---

<div class="post-metadata">

**Author:** ![tristanjl](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/tristanjl/32/261_2.png) [@tristanjl](https://qa.fmod.com/u/tristanjl)\
**Post date:** [March 9, 2021, 11:32pm UTC](https://qa.fmod.com/t/event-callback-timeline-beat-doesnt-give-messages-via-nested-or-referenced-events/16816/10 "2021-03-09T23:32:00Z")

</div>

There’s no internal restriction to the number of stacked markers - you are really only restricted by the UI limitations.

---

<div class="post-metadata">

**Author:** ![FelixSherar](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/felixsherar/32/850_2.png) [@FelixSherar](https://qa.fmod.com/u/FelixSherar)\
**Post date:** [March 10, 2021, 8:13am UTC](https://qa.fmod.com/t/event-callback-timeline-beat-doesnt-give-messages-via-nested-or-referenced-events/16816/11 "2021-03-10T08:13:50Z")

</div>

Thank you for the clarification!

---

<div class="post-metadata">

**Author:** ![FelixSherar](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/felixsherar/32/850_2.png) [@FelixSherar](https://qa.fmod.com/u/FelixSherar)\
**Post date:** [May 27, 2021, 3:52pm UTC](https://qa.fmod.com/t/event-callback-timeline-beat-doesnt-give-messages-via-nested-or-referenced-events/16816/12 "2021-05-27T15:52:58Z")

</div>

@tristanjl Sorry for bumping the thread, but I just saw an update to FMOD Studio that has what sounds like the feature I wanted! 😃

 ![Screenshot 2021-05-27 at 17.35.38](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/1/18b7b982b6908f370dfc4a104597e3f978f59a1a.png)

I just wanted to say thanks and also post it here in case someone else falls over this thread.
