[Openal] Filter
Daniel PEACOCK
dpeacock at creativelabs.com
Fri Oct 12 10:44:40 PDT 2007
Hi Andy,
OpenAL does not include any distance-based filtering - but the EAX / EFX
Extensions include an Air Absorption feature. It defaults to 'off'
because although it is a great feature (IMHO) it is *critical* to get your
units in the right scale - otherwise you can get undesirable results.
In EFX ...
The amount of air absorption (Air Absorption HF) is fixed to be 5mb per
meter at the reference high frequency (fixed at 5KHz). Each OpenAL Source
has an Air Absorption Factor parameter (defaults to 0) that is multiplied
by the Air Absorption HF value. The Air Absorption Factor can be set
between 0 and 10 which gives a range of 0 to 50mb of attenuation at the
reference high frequency per meter. Page 83 of the Effects Extension
Guide gives some documenation about the Air Absorption Factor property.
Distance units are assumed to be in meters - if that is not the case then
use the EFX Listener property AL_METERS_PER_UNIT so that AL can convert
your units to meters.
In EAX 4 / 5 ...
The Air Absorption HF value can be changed from it's default of -5mB and
you can also alter a per-Source Air Absorption Factor. Again the
per-Source Air Absorption Factor defaults to 0 to give no Air Absorption.
In EAX 4.0 / 5.0 there are a couple of locations where you will see Air
Absorption HF parameters - in the Reverb Effect and in the EAX 4.0 Context
Object. The actual value that is used is determined based on whether you
have a 'primary environmental reverb' or not. To have a 'primary
environmental reverb' the EAX 4.0 Context Primary FX Slot should point to
an Effect Slot that has the 'Environmental' flag enabled and contains a
reverb effect. In that situation the Air Absorption HF parameter is read
from that Reverb's parameters. Otherwise the parameter is read from the
EAX 4.0 Context Air Absorption HF parameter. Pretty complicated I know -
but as with most of EAX a lot of the features are designed to be automated
if you are creating a single / multi environmental audio game. The EAX
4.0 SDK has lots more documentation about all of this.
Dan
Creative Labs, Inc.
Notice
The information in this message is confidential and may be legally
privileged. It is intended solely for the addressee. Access to this
message by anyone else is unauthorized. If you are not the intended
recipient, any disclosure, copying or distribution of the message, or
any action taken by you in reliance on it, is prohibited and may be
unlawful. If you have received this message in error, please delete it
and contact the sender immediately. Thank you.
"Andy Patrick"
<Andy.Patrick at reb
ellion-derby.com> To
"Daniel PEACOCK"
10/12/2007 01:46 <dpeacock at creativelabs.com>,
AM <openal at opensource.creative.com>
cc
Subject
RE: [Openal] Filter
Many thanks Dan, that is extremely helpful information.
My next question then: I seem to recall that there is an (optional?)
automatic distance filter built into the OpenAL calculations (hence why
you can change the density of the air and the units-to-metres scale) but
can't seem to find a reference to it now, in the docs. What does that
do, by comparison to trying to use the manual filter to achieve a
distance filter effect?
Thanks again
Andy P
> -----Original Message-----
> From: openal-bounces at opensource.creative.com
> [mailto:openal-bounces at opensource.creative.com] On Behalf Of
> Daniel PEACOCK
> Sent: 11 October 2007 20:02
> To: openal at opensource.creative.com
> Subject: RE: [Openal] Filter
>
>
>
>
>
> Hi Andy,
>
> The 'Gain' parameter controls the volume at all frequencies
> (so setting this parameter to 0 will silence the sound), the
> Gain HF parameter controls the volume at high-frequencies
> (the reference high frequency is 5KHz).
> Setting the Gain HF to 0 should result in very muffled audio
> where all the high-frequencies have been filtered out.
>
> The EFX10Show application in the OpenAL SDK allows you to
> play with these
> parameters to see how they work. The parameters are in the
> box labelled
> 'Direct' on the right-hand-side of the Sound Properties dialogue box.
> NOTE : It is actually a little tricky to play with these
> parameter in the application due to the fact that they are in
> a linear 0 to 1 scale. (The parameters are in linear scale
> to match the rest of OpenAL).
>
> These parameters are actually being mapped to EAX Source parameters
> 'Direct' and 'DirectHF'. If you have the EAX 4.0 SDK
> installed you can
> use the ALEAX40Show test application to control the 'Direct'
> and 'Direct HF' parameters in a decibel scale (-10000mb to
> 0mb) which makes it easier to hear their effect.
>
> If you are using a linear interpolation to control the Gain
> HF parameter based on source to listener distance I would
> imagine that this would not sound too good and would result
> in very little audible change until your
> were practically at your defined maximum distance. A logarithmic
> interpolation would have the opposite affect - but may be too
> drastic for your needs - could be worth a try though.
>
> Dan
> Creative Labs, Inc.
>
> Notice
> The information in this message is confidential and may be
> legally privileged. It is intended solely for the addressee.
> Access to this message by anyone else is unauthorized. If
> you are not the intended recipient, any disclosure, copying
> or distribution of the message, or any action taken by you
> in reliance on it, is prohibited and may be unlawful. If
> you have received this message in error, please delete it
> and contact the sender immediately. Thank you.
>
>
>
>
>
>
> "Andy Patrick"
>
> <Andy.Patrick at reb
>
> ellion-derby.com>
> To
> Sent by: "Luis"
> <h.k.1981 at gmail.com>,
> openal-bounces at op
> <openal at opensource.creative.com>
> ensource.creative
> cc
> .com
>
>
> Subject
> RE: [Openal] Filter
>
> 10/10/2007 01:49
>
> AM
>
>
>
>
>
>
>
>
>
>
>
>
>
> Hi Luis, thanks, yes I am reassigning the filter to the
> source after modifying it, however it still doesn't seem to
> change the sound very much.
>
> And I'm still wondering why a filter (for which I would
> expect to change cutoff and slope) instead has fixed cutoff
> and slope, and only allows you to change "gain" and "gainHF"
> and it's not clear what that is expected to do.
>
> Thanks
>
> Andy
>
>
> From: Luis [mailto:h.k.1981 at gmail.com]
> Sent: 10 October 2007 06:12
> To: Andy Patrick; openal at opensource.creative.com
> Subject: Re: [Openal] Filter
>
> Hi Andy.
> Just checking, are you reassigning the filter to the source
> after modifying its parameters? You must do this or the new
> parameters won't affect the source at all.
>
> Hope that helps
>
> On 10/4/07, Andy Patrick <Andy.Patrick at rebellion-derby.com> wrote:
> Hello all,
>
> We're looking at playing around with the per-voice filter
> in the Effects
> Extension, in preparation for occlusion etc. We'd also like
> to change the
> filter over distance using a method that offers more
> control than the
> in-built distance filter in OpenAL, which I seem to remember reading
> about but can't now find a reference to!
>
> I understand that the low pass filter cut-off (-3dB point)
> is fixed at
> 4KHz, and the slope is fixed at -6dB/octave. What I don't
> understand is
> how the available parameters - AL_LOWPASS_GAIN and
> AL_LOWPASS_GAINHF -
> relate to that. I assumed that GAIN would modify the gain
> to the left of
> the cut-off point, and GAINHF would modify the gain to the
> right of the
> cut-off point. However, my attempts at varying GAINHF from 0 to 1 by
> distance doesn't seem to change the sound very much, and
> based on this
> assumption setting both GAIN and GAINHF to 0 would silence
> the sound,
> which it doesn't.
>
> Could someone please explain what the intent of these
> settings is, and
> briefly suggest how I might be able to implement the
> effects I'm after?
> I'm using OpenAL 1.1 on the Windows platform, primarily.
>
> Many thanks
>
> Andy P
>
> _______________________________________________
> Openal mailing list
> Openal at opensource.creative.com
> http://opensource.creative.com/mailman/listinfo/openal
>
>
>
>
> --
> Luis
> CONFIDENTIALITY NOTICE: This e-mail message (including any
> attachments) is for the sole use of the intended recipient
> and may contain confidential, privileged and/or trade secret
> information. Any unauthorised review, use, disclosure or
> distribution is prohibited. If you are not the intended
> recipient, please contact the sender by reply e-mail and
> destroy all copies of the original message.
> _______________________________________________
> Openal mailing list
> Openal at opensource.creative.com
> http://opensource.creative.com/mailman/listinfo/openal
>
> ForwardSourceID:NT00047C16
>
> _______________________________________________
> Openal mailing list
> Openal at opensource.creative.com
> http://opensource.creative.com/mailman/listinfo/openal
>
CONFIDENTIALITY NOTICE: This e-mail message (including any attachments) is
for the sole use of the intended recipient and may contain confidential,
privileged and/or trade secret information. Any unauthorised review, use,
disclosure or distribution is prohibited. If you are not the intended
recipient, please contact the sender by reply e-mail and destroy all copies
of the original message.
ForwardSourceID:NT000486AE
More information about the Openal
mailing list