0
0

Hi all!

I was wondering if it’s at all possible to alter the properties of a tracker music file (.mod) that’s playing in FMOD- something like enable/disable channels, or maybe even better change the tempo, or single notes of it. That would be wonderful in terms of making music very interactive.

If it’s not possible to change the mod file data in real time, then can you treat separate .mods as you audio stems (crossfading, layering etc.)?

Is that at all possible? We’re going to work on an iOS title in Unity which is very music-heavy, and would benefit tremendously from more interactive structures.

Thanks in advance!

FBP

  • You must to post comments
0
0

> I was wondering if it’s at all possible to alter the properties of a tracker music file (.mod) that’s playing in FMOD- something like enable/disable channels, or maybe even better change the tempo, or single notes of it. That would be wonderful in terms of making music very interactive.
You can only control the volume of channels inside a MOD via Sound::setMusicChannelVolume, there is also Sound::setMusicSpeed to control playback speed but it has several side effects that can make it tricky to use (let me know if you want to learn more about it).

> If it’s not possible to change the mod file data in real time, then can you treat separate .mods as you audio stems (crossfading, layering etc.)?
You can playback multiple MODs if you like, regardless of how they work internally, FMOD just treats them like any other codec.

  • You must to post comments
0
0

Hello Mathew,

thanks very much for your reply! I guess the tempo change in realtime is not absolutely necessary, yet I’m interested in learning more about it. Great news about being able to change channel volumes and have several mods play in sync.

Is it going to be very taxing to use tracker files extensively (so with layering/interactive structures) on iOS? Sorry again if this is a newbie question coding-wise, still learning :)

Filippo

  • You must to post comments
0
0

> yet I’m interested in learning more about it.
Basically we can adjust the playback speed of the tracker file, as a result the play time for the sound increases / decreases. So if you play the file twice as fast, it will end in half the time, but only the codec knows this. The FMOD::Sound will still think it has to play for the original time, so it will play silence until the expected end. Likewise if you play the file at half speed, the sound will cut off halfway through the file.

It’s not trivial to solve this problem internally, FMOD is just not designed to work that way so we proposed a bit of a kludge. You can open the file as normal to determine its length, then close it, then open it again but this time use FMOD_CREATESOUNDEXINFO to force the length to -1. The file will now just play forever (no cutting off) however it’s up to you to determine when to end it (hence why you got the length from the original opening of the file). You would need to take into account any speed changes you have done in your calculations of when the file should finish or where it is up to, but otherwise all is fine.

> Is it going to be very taxing to use tracker files extensively (so with layering/interactive structures) on iOS?
This is a hard question to answer, a lot depends on what you determine as too taxing for your game. The higher the polyphony count for the tracker, i.e. the more voices it uses, the more cost involved. Also keep in mind some formats like IT have effects that will eat CPU time too (if you use them). You would need to keep an eye on performance with System::getCPUUsage to make sure you aren’t overburdening the processor.

  • You must to post comments
0
0

Hi Mathew,

thank you for your helpful answers! We’re currently evaluating the best possible solution for audio in our game, and mod files are now high on the list, especially since it seems possible to dynamically turn channels on and off. We’ll test to see how crazy we can go in terms of track count on iOS :)

Filippo

  • You must to post comments
Showing 4 results
Your Answer

Please first to submit.