# Perfect Beat Tracking in Unity?

**URL:** <https://qa.fmod.com/t/perfect-beat-tracking-in-unity/18788>\
**Category:** Unity\
**Tags:** unity\
**Created:** [May 23, 2022, 9:00am UTC](https://qa.fmod.com/t/perfect-beat-tracking-in-unity/18788 "2022-05-23T09:00:09Z")\
**Posts on this page:** 1\
**Showing post:** 28

<div class="post-metadata">

**Author:** ![bloo\_regard\_q\_kazoo](https://avatars.discourse-cdn.com/v4/letter/b/7ea924/32.png) [@bloo\_regard\_q\_kazoo](https://qa.fmod.com/u/bloo_regard_q_kazoo)\
**Post date:** [April 24, 2024, 12:24am UTC](https://qa.fmod.com/t/perfect-beat-tracking-in-unity/18788/28 "2024-04-24T00:24:50Z")

</div>

Alright. I have a new script here that hopefully continues to work. [I recorded an example of it working here.](https://imgur.com/a/tv3pSLk). In the video I have a bass drum and a hi hat cymbal playing on the down and up beats respectively. I am controlling the pitch of the music in real time.

[The new Beat Tracker can be found here.](https://drive.google.com/file/d/1bQDmpyQxdiQ207q3tGMaNPn1ong36I34/view?usp=sharing), Hopefully I didn’t leave any unnecessary code in there.

I’ve added two new functions for the Pitch, “SetPitch” and “GetPitch”, they do exactly what they sound like.

A few things to make sure you’re doing in your project:

- In FMOD, make sure your music event has “Persistent” set to ON, and “Priority” is highest.
- In FMOD, make sure “Streaming” is OFF on your audio file.
- In Unity, set “Run in Background” to ON, Edit \> Project Settings \> Resolution and Presentation \> Run in Background.

I don’t think I forgot anything but let me know if it doesn’t work.

---

_[View the full topic](https://qa.fmod.com/t/perfect-beat-tracking-in-unity/18788)._
