0
0

Hi! I’m a composer, just started learning C. I’m working on an interactive music project (with fmod designer), and am having trouble with getting reverb defs to work… All the examples I saw are in C++, but it would be very helpful if someone could help me with the proper way to activate a Reverb Def in C!

Here is my code:

FMOD_REVERB_PROPERTIES *reverb;
ERRCHECK(result = FMOD_EventSystem_GetReverbPreset(eventsystem, EVENTREVERB_TEMPLATELEVEL_REVERB00, &reverb, 0));

The second line doesn’t agree with fmod…

My .fdp is called templatelevel, my reverb def reverb00.

I know it’s a begnner’s question, but would very much appreciate your help! Also wished to know how I can apply reverb defs to specific events/cues…

Many thanks,

Gregzo

  • You must to post comments
0
0

Thanks Ellen, I’m sure people will find that really useful. By the way, I saw your [url=http://thesoundoffootball.com/:oihb1ksm]The Sound of Football[/url:oihb1ksm] project, it’s great to see FMOD being used in such creative way. :)

  • You must to post comments
0
0

Hi Ellen! Seems you’re just as much a newbie as I am… So I’ll just tell you where your cide differs from mine, whoch works:

1) FMOD_REVERB_PROPERTIES reverb00;
(no "*")

2) You are mixing C++ and C syntaxes. As I am only familiar with C, try C only first with my example to see if it works!

Let me know, I’m new to this but got it to work with very little programming knowledge so might be able to help you in a very basic, line of code to line of code way…

Good luck,

Gregzo

  • You must to post comments
0
0

Hi Peter!

Thanks for your fast reply! I have to do some reading up on pointers.. I follow your explanation but I don’t get it to work. Do I need to use 2 variables for eventSystem? I am a puzzled person that need guidance!

In my .h file:

FMOD::EventSystem *eventSystem;

In my .mm file
result = FMOD::EventSystem_Create(&eventSystem);
ERRCHECK(result);

ERRCHECK(result = FMOD_EventSystem_GetReverbPreset(eventSystem,"REVERB00", &reverb00, 0));
ERRCHECK(result = FMOD_EventSystem_SetReverbProperties(eventSystem, &reverb00));

result = eventSystem->init(32, FMOD_INIT_NORMAL | FMOD_INIT_ENABLE_PROFILE, NULL, FMOD_EVENT_INIT_NORMAL);
ERRCHECK(result);

  • You must to post comments
0
0

Hi Ellen,

This function takes a double pointer:
[code:z45ms7xr]
ERRCHECK(result = FMOD::EventSystem_Create(&eventSystem));
[/code:z45ms7xr]

This function takes a single pointer.
[code:z45ms7xr]
ERRCHECK(result = FMOD_EventSystem_GetReverbPreset(&eventSystem,"REVERB00", &reverb00, 0));
[/code:z45ms7xr]

The problem is that you are passing a double pointer into every function when ‘Create’ is the only function that takes a double pointer, the rest require single pointers.

eventSystem is a pointer.

When you have &eventSystem, you are getting a pointer to that pointer (also known as a double pointer).
FMOD_EVENTSYSTEM* // pointer.
FMOD_EVENTSYSTEM** // pointer-to-pointer

similarly:
FMOD_EVENTSYSTEM* eventSystem
eventSystem // is a pointer
&eventSystem // is a double pointer

You only need a pointer to a pointer when you are creating an object. For ecample when you call Create with &eventSystem, the double pointer allows FMOD to modify your eventSystem pointer (because you’re passing in a pointer to that pointer). When you call other functions FMOD does not need to modify your pointer and so it does not need a double pointer, only a single pointer.

  • You must to post comments
0
0

Thanks for the detailed reply!

I added the following lines to my file but got 2 errors..

[code:275i2x8q]
FMOD_RESULT result = FMOD_OK;
FMOD_REVERB_PROPERTIES *reverb00;

ERRCHECK(result = FMOD::EventSystem_Create(&eventSystem));

ERRCHECK(result = FMOD_EventSystem_GetReverbPreset(&eventSystem,"REVERB00", &reverb00, 0));
ERRCHECK(result = FMOD_EventSystem_SetReverbProperties(&eventSystem, &reverb00));

ERRCHECK(result = eventSystem->init(32, FMOD_INIT_NORMAL | FMOD_INIT_ENABLE_PROFILE, NULL, FMOD_EVENT_INIT_NORMAL));[/code:275i2x8q]

The error I got:
[code:275i2x8q]ViewController.mm:93: error: cannot convert ‘FMOD::EventSystem**’ to ‘FMOD_EVENTSYSTEM‘ for argument ‘1’ to ‘FMOD_RESULT FMOD_EventSystem_SetReverbProperties(FMOD_EVENTSYSTEM, const FMOD_REVERB_PROPERTIES*)'[/code:275i2x8q]

In Fmod Designer I have my reverb activated on build and called "Reverb00". I include the .h file generated but there is no sign of the reverb in it. But in the text file generated I find:

[code:275i2x8q]#

Reverbs

#

Name : Reverb00
Index : EVENTREVERB_SOUND_OF_FOOTBALL2_REVERB00 = 0[/code:275i2x8q]

What am I missing? Everything else works in my events.

Many thanks in advance!
Ellen

  • You must to post comments
0
0

Thanks for the quick reply, Peter. I found the correct syntax by good old fashioned and tedious trial and error. I am posting the code here in case a future newbie faces similar issues:

1)Use of Reverb Def created in FMOD Designer (Reverb def name: Reverb00
FMOD_REVERB_PROPERTIES reverb00;
ERRCHECK(result = FMOD_EventSystem_GetReverbPreset(eventsystem,"REVERB00", &reverb00, 0));
ERRCHECK(result = FMOD_EventSystem_SetReverbProperties(eventsystem, &reverb00));

2)Use of FMOD_PRESET reverb (AUDITORIUM in this example)
FMOD_REVERB_PROPERTIES reverbAuditorium = FMOD_PRESET_AUDITORIUM;
ERRCHECK(result = FMOD_EventSystem_SetReverbProperties(eventsystem, &reverbAuditorium));

A few things made it confusing (for a beginner, I suspect):
1) Kind of confused by the differences between FMOD_EVENTREVERB, FMOD_REVERB etc… and by the fact that in the end, so little code was enough(no need to use FMOD_Reverb_SetActive or FMOD_REVERB, just properties).
2)In the FMOD Designer generated header, my reverb def is referred to as EVENTREVERB_TEMPLATELEVEL_REVERB00 , but in the code only REVERB00 is needed (the full name makes FMOD return an error).

I still have a question/feature request: I use FMOD_MusicSystem_SetVolume to set the music’s volume. Is there no way to set the MusisSystem’s reverb in a similar fashion? In FMOD Designer, the two sliders (vol. and rev.) are right next to each other, so a simple FMOD_MusicSystem_SetReverb function would be both logical and practical…

Many thanks in advance!

Greg

  • You must to post comments
0
0

Hi Gregzo, welcome to the FMOD forums!

If the EVENTREVERB_TEMPLATELEVEL_REVERB00 is taken from the header generated by design check that header to make sure that it contains that variable name and also make sure that you #include that header in your code file. If it is still not working please copy paste the entire error message so we can see what the error is.

  • You must to post comments
0
0

Newbie is my real name.. Thank you for your reply Gregzo!

I can’t get it to work even though I exported my files from Fmod Designer with the reverb named reverb00 and activated on build.

[code:3mcek890]
FMOD_RESULT result = FMOD_OK;
char buffer[200] = {0};
FMOD_REVERB_PROPERTIES reverb00;

result = FMOD::EventSystem_Create(&eventSystem); 
ERRCHECK(result);

result = eventSystem->getReverbPreset("REVERB00", &reverb00,0);
ERRCHECK(result);

result = eventSystem->setReverbProperties(&reverb00);
ERRCHECK(result);

[/code:3mcek890]

On "getReverbPreset", I get the following error: "FMOD error! (37) An invalid parameter was passed to this function.
Program ended with exit code: 255"

This is driving me nuts since I am so close to making my reverb sound in my iPhone!

  • You must to post comments
0
0

You have to call EventSystem::init and EventSystem::load to load an FEV so that you can get the reverb properties.

  • You must to post comments
0
0

I should have known.. Thank you so much! It works like a beauty now!

  • You must to post comments
0
0

I have wrote a little nice tutorial on reverbs in iPhone in c++.
Check it out here:
http://labs.society46.com/2011/11/how-t … -fmod-ios/

  • You must to post comments
Showing 11 results
Your Answer

Please first to submit.