I am currently working on a little school project, where I am trying to create some layered interactive music. The idea is to have a base layer with drums, and add other layers on top according to certain parameters (health, danger, etc). In addition, I want to be able to add flourishes to mark events such as killing an enemy. Now, I created this kind of system in the Music tab in Fmod Designer, though I could not figure out how to make a concurrent theme fade in/out according to a parameter. After searching around in these forums, I made a multitrack event instead with my music loops, with volume controlled by a parameter. However, now I cannot seem to easily add flourishes that sync with the music. I tried starting the event and the cue at the same time in code, though the result was… …not so synced.
So, how do I do this properly? Is it possible?
- Mrop asked 6 years ago
I had some ideas about a programming based solution where the music is played as a multitrack event (increasing in complexity with a parameter), with flourishes as a separate event, triggered by some code, but delayed until the correct beat was reached (by keeping a "clock" in code). But are you saying that event playback is not that reliable and precise?
The method you’ve suggested might be effective, but it would depend heavily on the music you’re using, the details of your code, and the available system resources.
Unlike the music system, event playback was designed with the assumption that very small amounts of latency would not be a significant problem, as most real-world sounds are noticably chaotic, and rarely follow exact timing. It was therefore considered acceptable that there was a small but unpredictable delay between an event being triggered in code and it actually being played. How noticable the delay is depends on how often FMOD::System::update() is called and how large the buffer size is, with larger values resulting in greater delays in either case. Music, on the other hand, often depends on exact timing, and so the interactive music system is designed specifically to avoid the delays that affect events. However, in order to facilitate that optimisation, users have significantly less control over non-time based aspects of sound when using interactive music rather than events.
Fortunately, as time has gone by a number of users have found themselves in positions similar to yours, wanting to use the accurate timing of the interactive music system in conjunction with the powerful effects and automation only usable in the event system. A few of them have discussed the techniques they used to work around the issue on these forums, so I suggest you browse such issues as [url:1xwcs0w8]http://www.fmod.org/forum/viewtopic.php?f=8&t=14815[/url:1xwcs0w8], [url:1xwcs0w8]http://www.fmod.org/forum/viewtopic.php?f=8&t=14554[/url:1xwcs0w8] and [url:1xwcs0w8]http://www.fmod.org/forum/viewtopic.php?f=8&t=14668[/url:1xwcs0w8].
Coincidentally, we have dramatically overhauled the way music and events work for FMOD Studio. Once it is released, problems like this will be a thing of the past.
I tried implementing a timer that would queue events to play only at the first beat of a bar. However, the playback was not exact enough, because of the delay inherent in playing an event. I look forward to any new features in later releases in Fmod and thank you for your answers.
Unfortunately, the only way Designer’s Music sytem will interact with parameters is when evaluating the conditions of segment links, and the event system cannot cue sounds with milisecond accuracy. These limitations were originally considered beneficial, but the historical reasons for them have become increasingly less relevant as time has passed.
It [i:bjhpus0p]is[/i:bjhpus0p] possible to fade segments in and out through use of the ‘Default Transition’ and ‘Transition timeout (ms)’ theme properties, though there are substantial limits to this method. Unfortunately, I cannot give more specific advice without knowing more details about your project.
Please login first to submit.