Environmental Effects

For the sake of brevity, we only document the constraints of each effect’s properties. Further details can be found at OpenAL’s Effect Extension Guide which specifies the purpose and usage of each value.

Base Effect

class palace.BaseEffect

Base effect processor.

Instances of this class has no effect (pun intended).

It takes the output mix of zero or more sources, applies DSP for the desired effect, then adds to the output mix.

This can be used as a context manager that calls destroy upon completion of the block, even if an error occurs.

Parameters

context (Optional[Context], optional) – The context from which the effect is to be created. By default current_context() is used.

Raises

RuntimeError – If there is neither any context specified nor current.

See also

ReverbEffect

Environmental reverberation effect

ChorusEffect

Chorus effect

destroy()None

Destroy the effect slot, returning it to the system.

If the effect slot is currently set on a source send, it will be removed first.

property slot_gain

Gain of the effect slot.

property source_sends

List of sources using this effect and their pairing sends.

property use_count

Number of source sends the effect slot is used by.

This is equivalent to calling len(self.source_sends).

Chorus Effect

class palace.ChorusEffect

Chorus effect.

The chorus effect essentially replays the input audio accompanied by another slightly delayed version of the signal, creating a “doubling” effect. This was originally intended to emulate the effect of several musicians playing the same notes simultaneously, to create a thicker, more satisfying sound.

Parameters
  • waveform (str) – Either ‘sine’ or ‘triangle’.

  • phase (int) – From -180 to 180.

  • depth (float) – From 0.0 to 1.0.

  • feedback (float) – From -1.0 to 1.0.

  • delay (float) – From 0.0 to 0.016.

  • context (Optional[Context], optional) – The context from which the effect is to be created. By default current_context() is used.

Raises

RuntimeError – If there is neither any context specified nor current.

delay

Delay, from 0.0 to 0.016.

depth

Depth, from 0.0 to 1.0.

feedback

Feedback, from -1.0 to 1.0.

phase

Phase, from -180 to 180.

waveform

Waveform, either ‘sine’ or ‘triangle’.

Reverb Effect

palace.reverb_preset_names: Tuple[str, ]

Names of predefined reverb effect presets in lexicographical order.

class palace.ReverbEffect

Environmental reverberation effect.

Parameters
  • preset (str, optional) – The initial preset to start with, falling back to GENERIC.

  • context (Optional[Context], optional) – The context from which the effect is to be created. By default current_context() is used.

Raises
  • ValueError – If the specified preset cannot be found in reverb_preset_names.

  • RuntimeError – If there is neither any context specified nor current.

air_absorption_gain_hf

High frequency air absorption gain, from 0.892 to 1.0.

decay_hf_limit

Whether to limit high frequency decay.

decay_hf_ratio

High frequency decay ratio, from 0.1 to 20.0.

decay_lf_ratio

Low frequency decay ratio, from 0.1 to 20.0.

decay_time

Decay time, from 0.1 to 20.0.

density

Density, from 0.0 to 1.0.

diffusion

Diffusion, from 0.0 to 1.0.

echo_depth

Echo depth, from 0.0 to 1.0.

echo_time

Echo time, from 0.075 to 0.25.

gain

Gain, from 0.0 to 1.0.

gain_hf

High frequency gain, from 0.0 to 1.0.

gain_lf

Low frequency gain, from 0.0 to 1.0.

hf_reference

High frequency reference, from 1000.0 to 20000.0.

late_reverb_delay

Late reverb delay, from 0.0 to 0.1.

late_reverb_gain

Late reverb gain, from 0.0 to 10.0.

late_reverb_pan

Late reverb as 3D vector of magnitude between 0 and 1.

lf_reference

Low frequency reference, from 20.0 to 1000.0.

modulation_depth

Modulation depth, from 0.0 to 1.0.

modulation_time

Modulation time, from 0.004 to 4.0.

reflections_delay

Reflections delay, from 0.0 to 0.3.

reflections_gain

Reflections gain, from 0.0 to 3.16.

reflections_pan

Reflections as 3D vector of magnitude between 0 and 1.

room_rolloff_factor

Room rolloff factor, from 0.0 to 10.0.

property send_auto

Whether to automatically adjust send slot gains.