I’m currently working on a musical project made in Unity that will be deployed as an app in iOS.
A lot of the changes in the music are meant to be done ‘on the beat’, and I was wondering if there’s a more accurate info I can get from the timeline. Currently I’m making it work with just the beat info, but would be great if I was able to get smaller increments. Is that possible somehow?
Unfortunately, without more information about the problems you’re experiencing, it’s hard for us to know what advice you need.
More accurate than what?
It sounds like you might be trying to handle the timing of transitions from your game’s code, rather than using FMOD’s built-in quantization features. Have you tried using tempo markers and putting quantization trigger conditions on your logic markers or instruments, in order to use FMOD’s built-in quantization?
I thought I was clear in my post, I apologize for that.
I’m used to work with audio on a sample basis, and despite not needing anything like that for this project, it would be quite helpful to have a smaller increment than a beat while querying the Timeline. Right now the smallest I was able to obtain was a 1/4 note, is this correct?
I recognize that that might not help, but I’m afraid I don’t fully understand what problem you’re trying to solve. Once you have queried the precise value of the timeline, what do you plan to use that datum for?
I’m querying the timeline at quite the fast rate, and even the millisecond value only changes in beat increments; ie, if bpm is 120, it gives me 500, 1000, 1500, 2000, etc.
So, in the end what I mean is that if I query it every frame, I get the same value multiple times, while I was expecting I could get smaller increments of the time line. I hope this makes sense.
Thanks for clarifying. As I asked earlier, what do you need this information for? Knowing what you’re trying to do would make it easier for us to help you do it.
The reason was to try and resolve some of the problems I was having with FMOD, but also in general to have the more accurate awareness of the transport within the game engine, to trigger animations based on its location.
Could you clarify what these problems are? You’ve mentioned them a few times, but without knowing what they are, it’s hard to provide advice on how to solve them.
As mentioned in my previous comment, I have animations based on the FMOD timeline. Due to not being able to get an accurate positions from the timeline over time, but only in increments, I had to hack some things by lerping them over time, which is not ideal.
I should clarify that Studio::EventInstance::getTimelinePosition’s accuracy is not tempo-dependent. Rather, it is dependent on Studio update rate, which by default is once per 20 ms.