Skip to content

Commit

Permalink
Rename the convolution reverb effect to just convolution
Browse files Browse the repository at this point in the history
While the common use case, convolution can do more than just reverb, and it
nicely shortens the name.
  • Loading branch information
kcat committed Oct 12, 2023
1 parent d1acb00 commit 5b86b80
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 27 deletions.
2 changes: 1 addition & 1 deletion al/auxeffectslot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ EffectSlotType EffectSlotTypeFromEnum(ALenum type)
case AL_EFFECT_EAXREVERB: return EffectSlotType::EAXReverb;
case AL_EFFECT_DEDICATED_LOW_FREQUENCY_EFFECT: return EffectSlotType::DedicatedLFE;
case AL_EFFECT_DEDICATED_DIALOGUE: return EffectSlotType::DedicatedDialog;
case AL_EFFECT_CONVOLUTION_REVERB_SOFT: return EffectSlotType::Convolution;
case AL_EFFECT_CONVOLUTION_SOFT: return EffectSlotType::Convolution;
}
ERR("Unhandled effect enum: 0x%04x\n", type);
return EffectSlotType::None;
Expand Down
4 changes: 2 additions & 2 deletions al/effect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ const EffectList gEffectList[16]{
{ "vmorpher", VMORPHER_EFFECT, AL_EFFECT_VOCAL_MORPHER },
{ "dedicated", DEDICATED_EFFECT, AL_EFFECT_DEDICATED_LOW_FREQUENCY_EFFECT },
{ "dedicated", DEDICATED_EFFECT, AL_EFFECT_DEDICATED_DIALOGUE },
{ "convolution", CONVOLUTION_EFFECT, AL_EFFECT_CONVOLUTION_REVERB_SOFT },
{ "convolution", CONVOLUTION_EFFECT, AL_EFFECT_CONVOLUTION_SOFT },
};

bool DisabledEffects[MAX_EFFECTS];
Expand Down Expand Up @@ -113,7 +113,7 @@ constexpr EffectPropsItem EffectPropsList[] = {
{ AL_EFFECT_VOCAL_MORPHER, VmorpherEffectProps, VmorpherEffectVtable },
{ AL_EFFECT_DEDICATED_DIALOGUE, DedicatedEffectProps, DedicatedEffectVtable },
{ AL_EFFECT_DEDICATED_LOW_FREQUENCY_EFFECT, DedicatedEffectProps, DedicatedEffectVtable },
{ AL_EFFECT_CONVOLUTION_REVERB_SOFT, ConvolutionEffectProps, ConvolutionEffectVtable },
{ AL_EFFECT_CONVOLUTION_SOFT, ConvolutionEffectProps, ConvolutionEffectVtable },
};


Expand Down
4 changes: 2 additions & 2 deletions al/effects/convolution.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ void Convolution_setParamfv(EffectProps *props, ALenum param, const float *value
{
switch(param)
{
case AL_CONVOLUTION_REVERB_ORIENTATION_SOFT:
case AL_CONVOLUTION_ORIENTATION_SOFT:
if(!(std::isfinite(values[0]) && std::isfinite(values[1]) && std::isfinite(values[2])
&& std::isfinite(values[3]) && std::isfinite(values[4]) && std::isfinite(values[5])))
throw effect_exception{AL_INVALID_VALUE, "Property 0x%04x value out of range", param};
Expand Down Expand Up @@ -88,7 +88,7 @@ void Convolution_getParamfv(const EffectProps *props, ALenum param, float *value
{
switch(param)
{
case AL_CONVOLUTION_REVERB_ORIENTATION_SOFT:
case AL_CONVOLUTION_ORIENTATION_SOFT:
values[0] = props->Convolution.OrientAt[0];
values[1] = props->Convolution.OrientAt[1];
values[2] = props->Convolution.OrientAt[2];
Expand Down
2 changes: 1 addition & 1 deletion alc/context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ std::vector<std::string_view> getContextExtensions() noexcept
"AL_SOFT_block_alignment",
"AL_SOFT_buffer_length_query",
"AL_SOFT_callback_buffer",
"AL_SOFTX_convolution_reverb",
"AL_SOFTX_convolution_effect",
"AL_SOFT_deferred_updates",
"AL_SOFT_direct_channels",
"AL_SOFT_direct_channels_remix",
Expand Down
2 changes: 1 addition & 1 deletion alc/export_list.h
Original file line number Diff line number Diff line change
Expand Up @@ -820,7 +820,7 @@ inline const EnumExport alcEnumerations[]{

DECL(AL_UNPACK_AMBISONIC_ORDER_SOFT),

DECL(AL_EFFECT_CONVOLUTION_REVERB_SOFT),
DECL(AL_EFFECT_CONVOLUTION_SOFT),
DECL(AL_EFFECTSLOT_STATE_SOFT),

DECL(AL_FORMAT_UHJ2CHN8_SOFT),
Expand Down
8 changes: 4 additions & 4 deletions alc/inprogext.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ void AL_APIENTRY alFlushMappedBufferDirectSOFT(ALCcontext *context, ALuint buffe
#define AL_UNPACK_AMBISONIC_ORDER_SOFT 0x199D
#endif

#ifndef AL_SOFT_convolution_reverb
#define AL_SOFT_convolution_reverb
#define AL_EFFECT_CONVOLUTION_REVERB_SOFT 0xA000
#define AL_CONVOLUTION_REVERB_ORIENTATION_SOFT 0x100F /* same as AL_ORIENTATION */
#ifndef AL_SOFT_convolution_effect
#define AL_SOFT_convolution_effect
#define AL_EFFECT_CONVOLUTION_SOFT 0xA000
#define AL_CONVOLUTION_ORIENTATION_SOFT 0x100F /* same as AL_ORIENTATION */
#define AL_EFFECTSLOT_STATE_SOFT 0x199E
typedef void (AL_APIENTRY*LPALAUXILIARYEFFECTSLOTPLAYSOFT)(ALuint slotid) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY*LPALAUXILIARYEFFECTSLOTPLAYVSOFT)(ALsizei n, const ALuint *slotids) AL_API_NOEXCEPT17;
Expand Down
32 changes: 16 additions & 16 deletions examples/alconvolve.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* THE SOFTWARE.
*/

/* This file contains an example for applying convolution reverb to a source. */
/* This file contains an example for applying convolution to a source. */

#include <assert.h>
#include <inttypes.h>
Expand All @@ -39,9 +39,9 @@
#include "common/alhelpers.h"


#ifndef AL_SOFT_convolution_reverb
#define AL_SOFT_convolution_reverb
#define AL_EFFECT_CONVOLUTION_REVERB_SOFT 0xA000
#ifndef AL_SOFT_convolution_effect
#define AL_SOFT_convolution_effect
#define AL_EFFECT_CONVOLUTION_SOFT 0xA000
#endif


Expand Down Expand Up @@ -278,19 +278,19 @@ static int UpdatePlayer(StreamPlayer *player)
}


/* CreateEffect creates a new OpenAL effect object with a convolution reverb
* type, and returns the new effect ID.
/* CreateEffect creates a new OpenAL effect object with a convolution type, and
* returns the new effect ID.
*/
static ALuint CreateEffect(void)
{
ALuint effect = 0;
ALenum err;

printf("Using Convolution Reverb\n");
printf("Using Convolution\n");

/* Create the effect object and set the convolution reverb effect type. */
/* Create the effect object and set the convolution effect type. */
alGenEffects(1, &effect);
alEffecti(effect, AL_EFFECT_TYPE, AL_EFFECT_CONVOLUTION_REVERB_SOFT);
alEffecti(effect, AL_EFFECT_TYPE, AL_EFFECT_CONVOLUTION_SOFT);

/* Check if an error occurred, and clean up if so. */
err = alGetError();
Expand Down Expand Up @@ -423,10 +423,10 @@ int main(int argc, char **argv)
if(InitAL(&argv, &argc) != 0)
return 1;

if(!alIsExtensionPresent("AL_SOFTX_convolution_reverb"))
if(!alIsExtensionPresent("AL_SOFTX_convolution_effect"))
{
CloseAL();
fprintf(stderr, "Error: Convolution revern not supported\n");
fprintf(stderr, "Error: Convolution effect not supported\n");
return 1;
}

Expand Down Expand Up @@ -500,11 +500,11 @@ int main(int argc, char **argv)
alGenAuxiliaryEffectSlots(1, &slot);

/* Set the impulse response sound buffer on the effect slot. This allows
* effects to access it as needed. In this case, convolution reverb uses it
* as the filter source. NOTE: Unlike the effect object, the buffer *is*
* kept referenced and may not be changed or deleted as long as it's set,
* just like with a source. When another buffer is set, or the effect slot
* is deleted, the buffer reference is released.
* effects to access it as needed. In this case, convolution uses it as the
* filter source. NOTE: Unlike the effect object, the buffer *is* kept
* referenced and may not be changed or deleted as long as it's set, just
* like with a source. When another buffer is set, or the effect slot is
* deleted, the buffer reference is released.
*
* The effect slot's gain is reduced because the impulse responses I've
* tested with result in excessively loud reverb. Is that normal? Even with
Expand Down

0 comments on commit 5b86b80

Please sign in to comment.