Reverb#

Reverb Room#

The room reverb module imitates the reflections of a room. The algorithm is a Schroeder style reverberation, based on Freeverb by Jezar at Dreampoint. It consists of 8 parallel comb filters fed into 4 series all-pass filters, with a wet and dry microphone control to set the effect level.

For more details on the algorithm, see Physical Audio Signal Processing by Julius Smith.

struct reverb_room_t#

A room reverb filter structure.

Public Members

uint32_t total_buffer_length#

Total buffer length

float room_size#

Room size

int32_t wet_gain#

Wet linear gain

int32_t dry_gain#

Dry linear gain

int32_t pre_gain#

Linear pre-gain

comb_fv_t combs[ADSP_RVR_N_COMBS]#

Comb filters

allpass_fv_t allpasses[ADSP_RVR_N_APS]#

Allpass filters

int32_t adsp_reverb_room(reverb_room_t *rv, int32_t new_samp)#

Process a sample through a reverb room object.

Parameters:
  • rv – Reverb room object

  • new_samp – New sample to process

Returns:

int32_t Processed sample

class audio_dsp.dsp.reverb.reverb_room(fs, n_chans, max_room_size=1, room_size=1, decay=0.5, damping=0.4, wet_gain_db=-1, dry_gain_db=-1, pregain=0.015, Q_sig=27)

Generate a room reverb effect. This is based on Freeverb by Jezar at Dreampoint, and consists of 8 parallel comb filters fed into 4 series all-pass filters.

Parameters:
fsint

Sampling frequency in Hz.

n_chansint

Number of channels the block runs on.

max_room_sizefloat, optional

sets the maximum size of the delay buffers, can only be set at initialisation.

room_sizefloat, optional

how big the room is as a proportion of max_room_size. This sets delay line lengths and must be between 0 and 1.

decayint, optional

how long the reverberation of the room is, between 0 and 1

dampingfloat, optional

how much high frequency attenuation in the room, between 0 and 1

wet_gain_dbint, optional

wet signal gain, less than 0 dB.

dry_gain_dbint, optional

dry signal gain, less than 0 dB.

pregainfloat, optional

the amount of gain applied to the signal before being passed into the reverb, less than 1.

Q_sig: int, optional

Q format of the signal, number of bits after the decimal point. Defaults to Q4.27.

Attributes:
fsint

Sampling frequency in Hz.

n_chansint

Number of channels the block runs on.

Q_sig: int

Q format of the signal, number of bits after the decimal point.

pregainfloat

The pregain applied before the reverb as a floating point number.

pregain_intint

The pregain applied before the reverb as a fixed point number.

wetfloat

The linear gain applied to the wet signal as a floating point number.

wet_intint

The linear gain applied to the wet signal as a fixed point number.

dryfloat

The linear gain applied to the dry signal as a floating point number.

dry_intint

The linear gain applied to the dry signal as a fixed point number.

comb_lengthsnp.ndarray

An array of the comb filter delay line lengths, scaled by max_room_size.

ap_lengthnp.ndarray

An array of the all pass filter delay line lengths, scaled by max_room_size.

combslist

A list of comb_fv objects containing the comb filters for the reverb.

allpasseslist

A list of allpass_fv objects containing the all pass filters for the reverb.

room_sizefloat

The room size as a proportion of the max_room_size.

process(sample, channel=0)

Add reverberation to a signal, using floating point maths.

Take one new sample and return the sample with reverb. Input should be scaled with 0 dB = 1.0.

Parameters:
samplefloat

The input sample to be processed.

channelint, optional

The channel index to process the sample on. Default is 0.

Returns:
float

The processed sample.

reset_state()

Reset all the delay line values to zero.

set_pre_gain(pre_gain)

Set the pre gain.

Parameters:
pre_gainfloat

pre gain value, less than 1.

set_wet_gain(wet_gain_db)

Set the wet gain.

Parameters:
wet_gain_dbfloat

Wet gain in dB, less than 0 dB.

set_dry_gain(dry_gain_db)

Set the dry gain.

Parameters:
dry_gain_dbfloat

Dry gain in dB, lees than 0 dB.

set_decay(decay)

Set the decay of the reverb.

Parameters:
decayfloat

How long the reverberation of the room is, between 0 and 1.

set_damping(damping)

Set the damping of the reverb.

Parameters:
dampingfloat

How much high frequency attenuation in the room, between 0 and 1.

set_room_size(room_size)

Set the current room size; will adjust the delay line lengths accordingly.

Parameters:
room_sizefloat

How big the room is as a proportion of max_room_size. This sets delay line lengths and must be between 0 and 1.