Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to control wetness/dryness of reverb without repopulating entirely? #14

Closed
codingisnuanced opened this issue Sep 23, 2020 · 1 comment

Comments

@codingisnuanced
Copy link

The only explicit means of changing the reverb wetness/dryness is by repopulating the reverb structure with the same parameters but with different wet/dry values. This seems cumbersome for the computer. What am I missing?

@velipso
Copy link
Owner

velipso commented Sep 23, 2020

If you look at the reverb.c code here:

		outL += er.L * rv->erefwet + input[i].L * rv->dry;
		outR += er.R * rv->erefwet + input[i].R * rv->dry;
		output[i] = (sf_sample_st){ outL, outR };

You can see that erefwet and dry are used at the very end.

So one way to change the wet/dry mix is to set those directly.

rv->erefwet = 0.5;
rv->dry = 0.5;

If you want to measure in dB instead of linear, then you can look at what sf_advancereverb is doing with erefwet and dry:

	rv->erefwet = db2lin(erefwet);
	rv->dry = db2lin(dry);

where db2lin is:

static inline float db2lin(float db){ // dB to linear
	return powf(10.0f, 0.05f * db);
}

The purpose of this library is to make the code easy to read. Don't be afraid of looking through reverb.c and following the variables. You might not understand all the magic math (I don't), but it should be accessible.

@velipso velipso closed this as completed Sep 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants