Control Individual Channels from Interleaved Wav File

Hi,

I’m new to FMOD and I’m trying to understand how I can have a multichannel (8 channels) wave file and control the volume and pan of each channel (or pair of channels) inside Unity (or what I should create inside FMOD to allow this).

I want to have a multichannel music being controller by the user. Ideally would be to send each channel to specific buses and from there control the level, pan, eq and other sends (like reverbs).

Is it possible inside FMOD or inside UNITY?

Thanks!!

I’m pretty sure it’s not possible (EDIT : I was wrong, it’s possible), but why don’t you simply break down the multichannel file to multiple files and import them on multiple tracks?

That’s too sad.

I tried to open multiple files in multiple tracks, but I got sync issues.

Do you have any solution?

I tried both using only unity and via fmod.

However, working with multi-tracks, exporting multiple stems from a DAW and importing them in FMOD is an absolutely commun workflow, so you shouldn’t have any problem.
Which DAW or software do you use to break down your file? Are you sure it is syncron in the DAW when you do this?

Importing is ok. It works.
The problem happens when I need to change volumes of the tracks, for example.
The more it advances, the more out of sync it gets.

It’s not a problem inside the DAW for sure.
I use Reaper.

Sometimes it plays in sync, sometimes out of sync after some time.

Could you share a screenshot of your main event on multiple tracks? Is it a loop?

1 Like

No. It’s not a loop file. These are stems of a whole song.
I had some Parameters created to adjust volume, but I decided to remove and wait for your help.

And below is the one single multichannel wave file.

I’m sorry if this is too dumb question, but I’m starting with FMOD, although I have decades of experience with DAW. Maybe I’m thinking the traditional way and it might work differently here.

Inside FMOD they play correctly, but When listening inside Unity, they get out of sync.
I disabled the built-in sound engine from Unity, but I couldn’t get it working without sync problems.
I also was able to change the parameters controlling each channel volume, but I had duplicate routing to the master. Maybe that’s why I listened to the out of sync channels?

If it’s a Unity related problem, I can’t help, we’ll let someone else give some advice.
It’s weird that it desynchronizes, since there’s no async elements in it. Have you just tried to increase the event priority? (master track, down right)
By the way, how did you manage to get a routing of the channels inside a same file to different busses? I’m not even aware of how to do that (but I never use multitrack files).

Actually I didn’t route the channels inside of the same file to different buses. That was my initial question! :slight_smile:

But do you mind to help me with the guidance on how to route each track to different buses in the scenario of a multi track with individual stems?

I can send them to a “send” (ex: reverb), but I could only send the entire event to a bus. Couldn’t route each track. Is that possible?

Yes, it’s a workaround but it works well: on each track you send pre-fader to the mixer channel of your choice, and you set the volume fader to min. You then can automate the volume either by automating this send level, or by snapshots in the mixer.
Simple question, what’s the purpose of routing into different busses, instead of doing the mix directly inside the event?

I really don’t understand why it’s not so intuitive and easy.

If I use sends instead of groups I’d have to deal with duplicated audio.

The idea to have buses is to mimic a music mixing environment.
So I could have, for example, 8 files for the drums, going to one bus.
4 files for vocals going to Vocals Bus.
4 guitars going to Guitars Bus.
And so on.

But if I could simply control each track pan, volume and send volume inside unity it would be already great. But I have no idea how to control each track independently.

You can route each track to a return INSIDE the event and do your mix on those return tracks (which are exactly like busses)! (short answer, the time I write the longer one)

You don’t see things correctly, imo. In FMOD, the “Mixer”, though it’s called so, isn’t the equivalent of the mixer of your DAW. The equivalent of your whole DAW project is a single event in FMOD. The equivalent of the mixer of your DAW in FMOD is (inside an event) the tracks controls, effects and sends (that you generally configure in the bottom tab), busses being “return tracks” you can create as you want, all being eventually routed to the master track of the event.
FMOD Mixer is indeed a mixer, but one (or more) level(s) above the event. Its purpose is to route and mix all your different events themselves. Sending individual tracks of one event to different mixer groups isn’t the normal way to use it, that’s why we should use the workaround I told you.

As I said, it’s a workaround. But the trick is to put the main volume track to min (-inf), so no, there won’t be duplicated audio. The send is in fact used as a routing.

1 Like

Thanks for the explanation!!!

I tried to find a way to control the track audio.
I found only the possibility to control a bus volume in C#.

Like this:
FMOD.Studio.Bus myBus;

Do you know how is it to call a track within an Event?
I’ve seen only tutorials mentioning Buses.

Why don’t you simply automate tracks (or return tracks) volume with parameters, which you can easily set with the code? They are designed for that.

However, routing through the mixer and controlling busses or VCA in the code is absolutely possible too (does it have the same performance, though? I don’t know).

You’re trying to do multiple things here. Each thing has a fairly simple solution, but they interact in a complex way, so I’ll address them one at a time.

There is a simple way to do this. In FMOD Studio, add an FMOD Channel Mix effect to the signal chain of the event track that contains your instrument. Mix the various channels of the track by adjusting the values of the channel mix effect.

If you want your game to be able to adjust the mix at run time, automate the value of each of the channel mix effect’s channel properties on a different parameter, and have Unity set the values of those parameters to adjust the mix.

There is no need to create multiple buses, to break the file down into multiple files, nor to split the instrument onto multiple tracks. Since this method uses one instrument and no sends, it is impossible for the various tracks to get out of sync.

2 Likes

Oh, Channel Mix. There’s something to learn everyday :slight_smile:

1 Like

All equalizers and other effects are applied on a per-bus basis, so if you want to affect some tracks of a sound and not others, you will need to split the signal across multiple buses.

There are a few different ways to do this. The simplest, as Alcibiade said, is to split your multichannel audio file into multiple stereo or mono files. (In your case, it sounds like you want stereo.)

Alternatively, you could use one giant multichannel sound, use sends to split the signal into multiple return tracks, then use an FMOD channel mix effect on each return track to mute all channels other than the ones you want to be audible though that track. This is slightly more resource intensive, as all effects in FMOD Studio are processed in real time, in order to support adaptive audio behavior.

1 Like

There are a few possible causes of synchronization issues when playing multiple audio files, and common methods of fixing them are described in the Troubleshooting chapter of the FMOD Studio User Manual.

If you still experience synchronization issues after trying the techniques described in that chapter, please let us know.

This is mostly correct. I should probably add a few more details, though.

Within an event, audio tracks function as group buses, return tracks function as return buses, and the master track functions as the master bus. The output of an event’s master bus is routed into the project mixer.

You can change the routing destination of a track by right-clicking on the track head and selecting “Reroute” from the context menu.

To view each event’s tracks as mixer strips, click on the “Strips” button in the event editor window’s transport bar. (Its icon looks a bit like “iii”, and is next to a button that looks like “iii” turned sideways.)

Yes and no.

The only differences between tracks in an event and buses in the project mixer are:
A) There can be multiple instances of an event, and each event instance has its own internal set of tracks. The project mixer, by contrast, cannot be instanced, and so there is never more than one instance of any bus.
B) Event instances have certain properties that determine their behavior, such as their position in 3D space, play states, and times when they are created, start, and end. The project mixer, by contrast, deals with the mixed output of all event instances in the project: It starts when the game does and doesn’t end until the game is exited, has no position, and has no ability to divine what individual event instances are doing.

Thus, unless you want a project’s mix to change depending on the state or 3D position of an event instance or need multiple instances of one event to be active simultaneously, there is no practical difference between using a track in the event to create a submix and using a bus in the mixer to create a submix.

1 Like