mirror of
https://github.com/ZDoom/fluidsynth.git
synced 2025-04-08 00:31:11 +00:00
Chorus enhancement. (#548)
This adds new LFO modulators: - these modulators are computed on the fly, instead of using lfo lookup table. Advantages: - Avoiding a lost of 608272 memory bytes when lfo speed is low (0.3Hz). - Allows to diminish the lfo speed lower limit to 0.1Hz instead of 0.3Hz. A speed of 0.1 is interesting for chorus. Using a lookup table for 0.1Hz would require too much memory (1824816 bytes). - Make use of first-order all-pass interpolator instead of bandlimited interpolation. - Although lfo modulator is computed on the fly, cpu load is lower than using lfo lookup table with bandlimited interpolator. Also adds a stereo unit controlled by WIDTH macro. WIDTH [0..10] value define a stereo separation between left and right. - When 0, the output is monophonic. - When > 0 , the output is stereophonic. WIDTH is currently fixed to maximum value to provide maximum stereo effect.
This commit is contained in:
parent
f2b7438511
commit
0288466f40
5 changed files with 752 additions and 352 deletions
|
@ -73,7 +73,7 @@ Developers: Settings can be deprecated by adding: <deprecated>SOME TEXT</depreca
|
|||
<name>chorus.speed</name>
|
||||
<type>num</type>
|
||||
<def>0.3</def>
|
||||
<min>0.29</min>
|
||||
<min>0.1</min>
|
||||
<max>5</max>
|
||||
<desc>
|
||||
Sets the modulation speed in Hz.</desc>
|
||||
|
|
|
@ -21,6 +21,7 @@ All the source code examples in this document are in the public domain; you can
|
|||
|
||||
- \ref Disclaimer
|
||||
- \ref Introduction
|
||||
- \ref NewIn2_1_0
|
||||
- \ref NewIn2_0_7
|
||||
- \ref NewIn2_0_6
|
||||
- \ref NewIn2_0_5
|
||||
|
@ -65,6 +66,9 @@ What is FluidSynth?
|
|||
|
||||
- FluidSynth is open source, in active development. For more details, take a look at http://www.fluidsynth.org
|
||||
|
||||
\section NewIn2_1_0 Whats new in 2.1.0?
|
||||
|
||||
- smallest allowed chorus speed is now 0.1 Hz (previously 0.29 Hz)
|
||||
|
||||
\section NewIn2_0_7 Whats new in 2.0.7?
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -49,7 +49,6 @@ typedef enum
|
|||
*/
|
||||
fluid_chorus_t *new_fluid_chorus(fluid_real_t sample_rate);
|
||||
void delete_fluid_chorus(fluid_chorus_t *chorus);
|
||||
int fluid_chorus_init(fluid_chorus_t *chorus);
|
||||
void fluid_chorus_reset(fluid_chorus_t *chorus);
|
||||
|
||||
void fluid_chorus_set(fluid_chorus_t *chorus, int set, int nr, fluid_real_t level,
|
||||
|
|
|
@ -198,7 +198,7 @@ void fluid_synth_settings(fluid_settings_t *settings)
|
|||
fluid_settings_register_int(settings, "synth.chorus.active", 1, 0, 1, FLUID_HINT_TOGGLED);
|
||||
fluid_settings_register_int(settings, "synth.chorus.nr", FLUID_CHORUS_DEFAULT_N, 0, 99, 0);
|
||||
fluid_settings_register_num(settings, "synth.chorus.level", FLUID_CHORUS_DEFAULT_LEVEL, 0.0f, 10.0f, 0);
|
||||
fluid_settings_register_num(settings, "synth.chorus.speed", FLUID_CHORUS_DEFAULT_SPEED, 0.29f, 5.0f, 0);
|
||||
fluid_settings_register_num(settings, "synth.chorus.speed", FLUID_CHORUS_DEFAULT_SPEED, 0.1f, 5.0f, 0);
|
||||
fluid_settings_register_num(settings, "synth.chorus.depth", FLUID_CHORUS_DEFAULT_DEPTH, 0.0f, 256.0f, 0);
|
||||
|
||||
fluid_settings_register_int(settings, "synth.ladspa.active", 0, 0, 1, FLUID_HINT_TOGGLED);
|
||||
|
@ -5272,7 +5272,7 @@ fluid_synth_set_chorus_on(fluid_synth_t *synth, int on)
|
|||
* @param nr Chorus voice count (0-99, CPU time consumption proportional to
|
||||
* this value)
|
||||
* @param level Chorus level (0.0-10.0)
|
||||
* @param speed Chorus speed in Hz (0.29-5.0)
|
||||
* @param speed Chorus speed in Hz (0.1-5.0)
|
||||
* @param depth_ms Chorus depth (max value depends on synth sample rate,
|
||||
* 0.0-21.0 is safe for sample rate values up to 96KHz)
|
||||
* @param type Chorus waveform type (#fluid_chorus_mod)
|
||||
|
@ -5330,19 +5330,6 @@ int fluid_synth_set_chorus_type(fluid_synth_t *synth, int type)
|
|||
return fluid_synth_set_chorus_full(synth, FLUID_CHORUS_SET_TYPE, 0, 0, 0, 0, type);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set one or more chorus parameters.
|
||||
* @param synth FluidSynth instance
|
||||
* @param set Flags indicating which chorus parameters to set (#fluid_chorus_set_t)
|
||||
* @param nr Chorus voice count (0-99, CPU time consumption proportional to
|
||||
* this value)
|
||||
* @param level Chorus level (0.0-10.0)
|
||||
* @param speed Chorus speed in Hz (0.29-5.0)
|
||||
* @param depth_ms Chorus depth (max value depends on synth sample rate,
|
||||
* 0.0-21.0 is safe for sample rate values up to 96KHz)
|
||||
* @param type Chorus waveform type (#fluid_chorus_mod)
|
||||
* @return #FLUID_OK on success, #FLUID_FAILED otherwise
|
||||
*/
|
||||
int
|
||||
fluid_synth_set_chorus_full(fluid_synth_t *synth, int set, int nr, double level,
|
||||
double speed, double depth_ms, int type)
|
||||
|
@ -5399,7 +5386,7 @@ fluid_synth_set_chorus_full(fluid_synth_t *synth, int set, int nr, double level,
|
|||
/**
|
||||
* Get chorus voice number (delay line count) value.
|
||||
* @param synth FluidSynth instance
|
||||
* @return Chorus voice count (0-99)
|
||||
* @return Chorus voice count
|
||||
*/
|
||||
int
|
||||
fluid_synth_get_chorus_nr(fluid_synth_t *synth)
|
||||
|
@ -5415,7 +5402,7 @@ fluid_synth_get_chorus_nr(fluid_synth_t *synth)
|
|||
/**
|
||||
* Get chorus level.
|
||||
* @param synth FluidSynth instance
|
||||
* @return Chorus level value (0.0-10.0)
|
||||
* @return Chorus level value
|
||||
*/
|
||||
double
|
||||
fluid_synth_get_chorus_level(fluid_synth_t *synth)
|
||||
|
@ -5431,7 +5418,7 @@ fluid_synth_get_chorus_level(fluid_synth_t *synth)
|
|||
/**
|
||||
* Get chorus speed in Hz.
|
||||
* @param synth FluidSynth instance
|
||||
* @return Chorus speed in Hz (0.29-5.0)
|
||||
* @return Chorus speed in Hz
|
||||
*/
|
||||
double
|
||||
fluid_synth_get_chorus_speed(fluid_synth_t *synth)
|
||||
|
|
Loading…
Reference in a new issue