-
Notifications
You must be signed in to change notification settings - Fork 246
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
new reverb #380
new reverb #380
Conversation
Cool, looking forward to testing this! Have you done any performance measurements yourself? |
Yes, using |
Would it maybe be beneficial to be able to disable the denormal handling with a compile-time switch and rely on |
Thanks for the link.
Actual denormal handling introduces a loss of -6% of the |
Nice work. For me a difference is barely audible. Hope this is intended? |
Please, could you develop a bit which difference ? |
No, because I dont really hear a difference (barely == almost not). |
With a roomsize of 1, I can hear quite a difference. The existing reverb has a lot of high frequency ringing, probably an artifact of the comb filters. The new implementation has no unnatural ringing that I can hear. So much better in that regard! But the new implementation has more "wobble" than the old one. I set roomsize to 1 and leave all other settings unchanged. Then I play a single short note of piano and listen to the reverb. The new reverb sounds a little bit like there is a phaser or chorus on it. The existing reverb sounds cleaner and more natural, in my opinion. But maybe it's just that the default parameters need tweaking? |
Yes, the only difference I noticed so far. I think it's the |
Any reverb with only 8 comb filters will produces audible resonant frequencies (
Using only 8 comb filters a possible solution to cancel the resonant frequencies (without putting damp to >0) is to modulate a bit the comb filter (this simulates more peaks of frequency moving very near each to other). This allows to hear the full spectrum when intended (putting damp to 0) without hearing the building of unwanted resonant frequencies.
This is the inconvenient of a modulated delay line. It produces an unwanted frequency modulation (like chorus). However if the modulation depth (
In summary:
When less reverb time is intended for high frequency (damp > 0):
Will see what can be done. |
Since now modulation depth ( Although i am fan of less parameters as possible, i think it worth that |
One important issue: I'm missing a copyright notice. Did you wrote this completely by yourself or is it based on some implementation? If you did it yourself, please add your name + copyright + hint for LGPL 2.1+.
Wouldnt go that far for now. Let us continue rehearsal first. |
All the concepts and ideas comes completely from all the research papers we found on w.w.w on this subject since 40 years. In this source there are no ideas or concepts that come from me. I am responsible of the translation of theses ideas in C language.
I must admit that my knowledge about copyright statements is very limited. Also i don't intend to claim any copyright of my own. You can probably help on this copyright subject. |
Right, I'm aware that the concepts exists and are public domain as it seems. I was only referring to the source code.
So does that mean that you wrote the source code completely yourself, without using or translating any existing source? In this case, just add the existing copyright notice found in fluidsynths other source files to the top of ...Simply to avoid this issue we had at last year with Juergen Muellers chorus implementation. |
Sure. Here the conditions and results of many experiments:
Values below the lower limits are often not sufficient to cancel unwanted "ringing"(resonant frequency). |
Not completely because i have read a lot of research papers and read in this papers examples of implementations written in others languages. So in this regard the source i have written (3 years ago) is based on the works of the author of this papers. |
Yes, the example implementations that you've used must be credited and they must compatible with LGPL (e.g. public domain). I'm not sure if it's necessary to do this that detailed. If the examples you've used are part of the papers you've already cited it's probably ok to silently use them by translating them to C. Just look them through again so we dont miss anything. In every case I'd suggest to apply fluidsynth's copyright note. |
I have looked in the papers. The code examples i have read are just only part of the papers. There are no copyright mention, no licence mention. There are only the author name of the paper. Should be a good idea to contact the author of the papers ?
You mean, of course just add the existing copyright notice found in fluidsynths other source files to the top of fluid_rev.c. |
No, I dont think that's necessary.
Yes please. |
src/rvoice/fluid_rev.c
Outdated
{ | ||
FLUID_FREE(allpass->buffer); | ||
#ifdef WITH_DENORMALISING | ||
FLUID_MEMSET(dl->line, DC_OFFSET, dl->size * sizeof(fluid_real_t)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
memset
sets bytes, not floats. You have to use a for loop.
src/rvoice/fluid_rev.c
Outdated
{ | ||
comb->damp1 = val; | ||
comb->damp2 = 1 - val; | ||
long i; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why long
?
src/rvoice/fluid_rev.c
Outdated
/* | ||
Number of samples to add to the desired length of a delay line. This | ||
allow to take account of modulation interpolation. | ||
1 is sufficient with MOD_DEPTH egal to 6. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
equal to
src/rvoice/fluid_rev.c
Outdated
Modulator for modulated delay line | ||
-----------------------------------------------------------------------------*/ | ||
#define TWO_PI 6.28318530717958647692528676655901 | ||
#define PI_DIVIDED_BY_2 1.57079632679489661923132169163975 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dont think these defines are necessary. We could just write (2*M_PI)
and (M_PI/2.0)
below respectively. Constant folding will remove the multiplication at compile time.
src/rvoice/fluid_rev.c
Outdated
/*-------------------------*/ | ||
/* variable rate control of center output position */ | ||
long index_rate; /* index rate to know when to update center_pos_mod */ | ||
long mod_rate; /* rate at which center_pos_mod is updated */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why using long
for those members?
src/rvoice/fluid_rev.c
Outdated
} | ||
|
||
FLUID_FREE(rev); | ||
delete_fluid_rev_late(&rev->late); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add NULL-guards to destructor functions: fluid_return_if_fail(rev != NULL);
src/rvoice/fluid_rev.c
Outdated
} | ||
else | ||
{ | ||
FLUID_FREE(rev); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Call delete_fluid_revmodel()
pls.
src/rvoice/fluid_rev.c
Outdated
delay_length[i], MOD_DEPTH, MOD_RATE ); | ||
if (result == FLUID_FAILED) | ||
{ | ||
delete_fluid_rev_late(late); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this delete_* call pls. Cleanup should be done by parent constructor function new_fluid_revmodel()
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All cleanup done.
Please add NULL-guards to destructor functions: fluid_return_if_fail(rev != NULL);
Testing rev to not NULL but not using fluid_return_if_fail(), as this is an internal reverb interface API , not a public API. Hope it is correct ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as this is an internal reverb interface API , not a public API. Hope it is correct ?
That does the same thing ofc, but it looks more consistent if you used fluid_return_if_fail()
. I've done that for all destructor functions some time ago.
Also please add the NULL-guard to delete_fluid_rev_late()
. I know, it should never be called with NULL, but I prefer to have those destructors as failsafe as possible.
Thanks for checking.
You mean probably about
Talking about MOD_DEPTH, of course i agree because it depends of the instrument, ears and taste. So it can be reduced to 4. |
Please, as i dont know how to reproduce the "wobble" you have heared, i guess (and hope) the latest change you refer (while the wobble domination augmentation was observed) is |
Yes I was referring to the internal gain scale. Specifically audible for high frequent samples. Here's the midi demo attached. Use it with this soundfont. |
All in all I'm fine with this. Ringing is gone, code is well documented, tiny wheeny drawback is the whobble, but that's only audible for a very few sounds, so nevermind. However I dont want to merge this for 2.0 as it already brings a lot new features. Instead I want to keep this for whatever comes after 2.0. @jjceresa Could you perhaps sooner or later bring this feature to the mailing list? |
Yes, i understand. This compromise between ringing tone and wobble (know also as flutter) is really difficult and doesn't work in all situation.
Yes of course. I understand this.
Yes, i think it is necessary that more ears give a try. For example, i already know that jOrgan-user was interested to try this. Graham Goode (jOrgan-user) have said that it should be easier for them to try a fluidsynth executable (Windows). Did you know if CI travis is able to build executable of new-reverb branch ? (i don't remember). |
1)low input gain (FIXED_GAIN = 0.1) reintroduced. FIXED_GAIN is lowered from 1.0 to 0.1. SCALE_WET augmented from 0.6 to 5. 2)stereo gain reintroduced. Both enhances flatness comb filter frequency response.
Sorry, just realized I haven't respond to this. Travis and AppVeyor continiously build all branches that are being pushed to. Currently Travis does not produce build artifacts. However as it seems you want windows binaries, you can just use the build artifacts from AppVeyor, e.g.: https://ci.appveyor.com/project/derselbst/fluidsynth/build/1192/job/8adfyve7lrsfgw4g/artifacts |
I already know that jOrgan-user was interested to try this. Graham Goode (jOrgan-user) have said that it should be easier for them to try a fluidsynth executable (Windows). Note that the binaries build by AppVeyor doen't run on Windows XP. These probably run on Windows 7 and above. |
I've adjusted the visual studio toolset to be windows xp compatible (hopefully). Could you please try this build: https://ci.appveyor.com/project/derselbst/fluidsynth-g2ouw/build/970/job/ut2rvpvic96bftfl/artifacts |
This build starts on XP but unfortunately it introduces new unknow dlls (with a very complicated dlls dependencies). A lot of these are missing (listed in upper case). This dependency is: libfluidsynth-2.dll depends of:
glib-2.dll depends of:
pcre.dll depends of: some missing dll already listed above libint.dll depends of:
On my own build for XP the classic minimum know dependency is: libfluidsynth-2.dll depends of:
Note that i am not looking for AppVeyor binaries for my own. However, this could be useful for others users (not familiar with compilation) for a quick try. |
Strange. Please try this one as well: https://ci.appveyor.com/project/derselbst/fluidsynth/build/job/bdbhogdn4v1qwqda/artifacts |
For this build, libfluidsynth-2.dll now depends of the same dll that for my build but unfortunately still dependent of missing dll: |
Ok, seems like VS2015 pollutes the binaries with unnecessary dependencies even in xp compatibility mode :/ |
This PR proposes a new reverb which is a
late
reverb (like the actual reverb) which is convenient for Fluidsynth sound engine.The
parameters
are the same than the actual reverb. Also thedefault response of these parameters
are rather the same.The intended goal was:
ringing
" using rather no morecpu load
if possible.The macro
NBR_DELAYS
allows to choose 8 or 12 delays lines.Although 8 lines give good result, using 12 delay lines brings the overall quality a bit higher. This quality augmentation is noticeable particularly when using long reverb time (roomsize = 1) on solo instrument with long release time. Of course the cpu load augmentation is +50% relatively to 8 lines.
As a general rule the reverberation tail quality is easier to perceive by ear when using: