reverb is fully occluded in an obstruction example


(GhPGame) #1

Hi,

I’m trying to simulate an obstruction case.
I’m having a 3D sound source and a column in a reverb room. I set the direct factor of the column (defining a cube geometry to represent the column) to be 0.8 and the reverb factor to 0. The column is located in front of the column (on the Z axis).
When the listener is standing in front of the column, I expect the direct sound to be lowered and it is happening. But I don’t hear the effect of reverb. I expect the reverb sound not be affected at all.
I have set the the reverb for the room and when I move around I can hear the effect of the early reflections.
Any help would be appreciated.


(Brett Paterson) #2

Are you saying the reverb occlusion value of 0 sounds like it is behaving like 1.0? (no reverb), but you said you could hear it suddenly when you step out of way of the column and look at the source directly?


(GhPGame) #3

Yes it seems that I only hear the sound when there is a direct ray from source to the listener, and I do not hear any reverb although I have set up a 3D reverb.


(Brett Paterson) #4

have you tried 0.1? 0.5? 0.9? There are 2 ways to set the occlusion values, addPolygon and setPolygonAttributes, anything there being mixed up/overridden?


(Brett Paterson) #5

actually I think I know the effect you’re having, the issue is more to do with where the reverb is connected to in the graph from the channel. If it comes post fader, it will only produce reverb from the post fader signal, which is quiet. You can probably hear a tail of a reverb if you move left and right of the column before it dies out.
I’ll give suggestion on how to reroute to pre-fader in the next post


(GhPGame) #6

Thanks Brett, I have used different values for reverb factor, none of them works. I only used addPolygon, I never call setPolygonAttrributes, I’m not sure whether I have to use this function since the factors are already set using addPolygon.


(Brett Paterson) #7

By default, the reverb is connected to the fader, which is the output of the 3d panning algorithm. This means when the dry mix fades, so does the reverb.

The only way to make the reverb come before the dry 3D or occlusion part, is to

  1. Do 3D panning on a wrapper channel group, not the channel itself (so put a channel in a channelgroup, one for each channel, then call ChannelGroup::set3DAttributes, not Channel::set3DAttributes). Reverb always comes from the channel, so it will come first, then the channelgroup will do the dry 3d pan later. This keeps them separate. ChannelGroup::setMode(FMOD_3D) will be needed to make it 3d pannable.

  2. add a new tail to a channel (call System::createDSPByType(FMOD_DSP_TYPE_MIXER, &newtail); then do channel->setReverbProperties(0, 0); followed immediately by setReverbProperties(0, 1); ,which resets the internal reverb connect to the new tail. Unfortunately I found this doesn’t work currently due to a missed check, so I will have to patch the next release with this for this method to work.

At least method 1 will work for now, and method 2 will work in the next point release.


(GhPGame) #8

Thank you so much Brett. I’ll try it tomorrow and let you know.


(Brett Paterson) #9

Just FYI this is for FMOD5 (studio), your post tag says FMOD4 (ex), so it wont work in FMOD 4.


(GhPGame) #10

Thanks Brett, I’m using FMOD5, looks like I’m not in the right forum. However, calling set3DAttributes on the channelGroup but not channel, does not solve my problem, while I’m also losing nice 3D effects of the sound.
Here is what I did: when I want to play the sound, I call playSound which initializes the channel, then I assign the channel to a channel group and then I call setMode, set3DMinMaxDistance and set3DAttributes on the channelGroup.
The sounds fades away so quickly as I move the listener (I used to get perfect results in terms of 3D Sound when I applied those methods on the channel but not channel group).


(Brett Paterson) #11

You probably have the channel set to 3d as well, so it is getting double panned and double attenuated. Make sure the channel/sound is now FMOD_2D and the channelgroup is the only thing that does 3d


(GhPGame) #12

Thanks Brett. It’s perfect, I’m even surprised how perfectly FMOD in managing this. When the listener is behind the column, I don’t hear the direct sound but I fully hear the reverb, which is solving the problem. The only issue is that I should have the same number of the channels and channel groups, and I also have to separate the sounds by assigning them to different channel groups, which is not desired cause we may need to group them to set their volums or apply DSP effects. Also I now have to find a way to differentiate between a real 2D sound or a 3D sound which I have defined to be 2D to apply the reverb on the channelGroup.
I guess this issue needs to be solved in the future release of FMOD.
Thanks again Brett for your useful guidance.


(GhPGame) #13

Just one more question, is it possible to set the reverb based on the listener position? Right now, the reverb is the same everywhere as long as the listener is inside the reverb zone.


(Brett Paterson) #14

You can just add channelgroups to a parent channelgroup, if you want a bus heirarchy. You are not stopped by having channels in channelgroups. You can stack them however deep you want.

This is only a workaround for the alternate method that is described above.

If you want to 3D position the reflections, I would suggest putting the reverb DSP unit into a ChannelGroup (you could find it and simply call addDSP to a new ChannelGroup, which should disconnect it from where it was, and put it into the new position) and use 3D panning on the ChannelGroup, as before.


(GhPGame) #15

Sorry for asking too many questions. Now I’m using addDSP to add reverb to each channel (in a channelGroup), but again I have the problem with reverb getting fully occluded. It seems that I should accept this trade off.


(Brett Paterson) #16

That is not the right way to do it. You can’t create new reverbs and add them via addDSP and expect them to be managed by the internal systems. There is 1 system reverb.
The only reason I said use addDSP is to -reposition- the system reverb (addDSP will disconnect it from wherever it is and put it in the new position).

There is only 1 system reverb,which is the only one that reacts to geometry.
You have to locate it (via getDSP and getnuminputs/getinput/getinfo) then ‘reposition it’. This -only- to satisfy the requirement that you had for 3d positioning the system reverb. This is an extra requirement for a system that does not support it natively so you have to do extra low level connection management.


(GhPGame) #17

Pretty confusing then. I know add the reverb to a channel group, then I get the DSP and I add it to a new channel group. The reverb disconnects from the first sound and connects to the new one, which is for sure not what I’m expecting. I want them both to be affected by the reverb of the room they are located in, I just want the reverb to get lowered as I go further from the sound. Also, by adding the DSP to the channel group it is not enclosed in a geometry.
They are different ways to add reverb, you suggested me to use them all, and at the end it made me confused :frowning:


(Brett Paterson) #18

you dont put the existing reverb’s dsp unit in your sounds channelgroup, you put it in a stand alone, ‘reverb’ channelgroup, just so you can get access to channelgroup functions like set3DAttributes. This has nothing to do with your sounds. It is purely to put the reverb dsp in a channelgroup. nothing more. You said you wanted to position the reverb separately to the sounds I thought.


(Brett Paterson) #19

if you dont care about panning of the reverb, just leave it alone and use the Reverb3D api which already allows you to have reverb fade out the further away you get from a reverb sphere’s center point.


(GhPGame) #20

Thanks you for your patience and help Brett.