# Syncing midi to timeline and triggering Unity callbacks from midi notes

**URL:** https://qa.fmod.com/t/syncing-midi-to-timeline-and-triggering-unity-callbacks-from-midi-notes/22300
**Category:** Unity
**Created:** [November 14, 2024, 5:32pm UTC](https://qa.fmod.com/t/syncing-midi-to-timeline-and-triggering-unity-callbacks-from-midi-notes/22300 "2024-11-14T17:32:57Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![kennydhubbell](https://avatars.discourse-cdn.com/v4/letter/k/e0b2c6/32.png) [@kennydhubbell](https://qa.fmod.com/u/kennydhubbell)
#### Post date: [November 14, 2024, 5:32pm UTC](https://qa.fmod.com/t/syncing-midi-to-timeline-and-triggering-unity-callbacks-from-midi-notes/22300/1 "2024-11-14T17:32:57Z")

</div>

I’m using FMOD in Unity to sync some effects to music. I currently have beat callback and marker callbacks set up and working well. However, this means that my effects either need to land on the beat, or I need to have a marker for each and every time I want a callback to Unity, which is tedious to do by hand. I know that I can get spectrum or loudness data sent back to Unity, and could even have my music spread across different tracks so that I could get spectrum/loudness data for each individual track. However, I think that can get computationally expensive. My one thought was that I could have the original midi data that was used to make the music, and potentially have those notes to trigger something in Unity, but I don’t know if or how this would be possible, or if there is a way to make sure that the midi track stays in sync with the music track. Any guidance here would be appreciated!

---

<div class="post-metadata">

### Author: ![kennydhubbell](https://avatars.discourse-cdn.com/v4/letter/k/e0b2c6/32.png) [@kennydhubbell](https://qa.fmod.com/u/kennydhubbell)
#### Post date: [November 18, 2024, 3:16pm UTC](https://qa.fmod.com/t/syncing-midi-to-timeline-and-triggering-unity-callbacks-from-midi-notes/22300/2 "2024-11-18T15:16:35Z")

</div>

I ended up using the drywetmidi unity plugin and occasionally making sure it’s in sync with the FMOD track with beat callbacks. Seems to be working well enough.

---

<div class="post-metadata">

### Author: ![li\_fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/li_fmod/32/6577_2.png) [@li\_fmod](https://qa.fmod.com/u/li_fmod)
#### Post date: [November 19, 2024, 1:07am UTC](https://qa.fmod.com/t/syncing-midi-to-timeline-and-triggering-unity-callbacks-from-midi-notes/22300/3 "2024-11-19T01:07:27Z")

</div>

Thank you for sharing the solution here!
