Mozzi  version v1.1.0
sound synthesis library for Arduino
ReverbTank Class Reference


A reverb which sounds like the inside of a tin can. More...

#include <ReverbTank.h>

Public Member Functions

 ReverbTank (int8_t early_reflection1=37, int8_t early_reflection2=77, int8_t early_reflection3=127, int8_t loop1_delay=117, uint8_t loop2_delay=255, int8_t feedback_level=85)
 Constructor. More...
 
int next (int input)
 Process the next audio sample and return the reverbed signal. More...
 
void setEarlyReflections (int8_t early_reflection1, int8_t early_reflection2, int8_t early_reflection3)
 Set the early reflection times in terms of delay cells. More...
 
void setLoopDelays (int8_t loop1_delay, uint8_t loop2_delay)
 Set the loop delay times in terms of delay cells. More...
 
void setFeebackLevel (int8_t feedback_level)
 Set the feedback level for the recirculating delays. More...
 

Detailed Description


A reverb which sounds like the inside of a tin can.

ReverbTank is small enough to fit on the Arduino Nano, which for some reason wasn't able to fit a larger version which did fit on other 328 based boards. For simplicity, ReverbTank has hardcoded maximum delay sizes but also has default delay times which can be changed in the constructor or by setting during run time to allow live tweaking. This is a highly simplified design drawing on and probably misinterpreting Miller Puckette's G08.reverb recirculating reverb example for Pure Data.

The room size according to the maximum delay lengths corresponds to:

early reflections and recirculating delay 1: 128/16384 seconds * 340.29 m/s speed of sound = 3.5 metres recirculating delay 2: 7 metres It looks bigger on paper than it sounds.

Definition at line 32 of file ReverbTank.h.

Constructor & Destructor Documentation

◆ ReverbTank()

ReverbTank::ReverbTank ( int8_t  early_reflection1 = 37,
int8_t  early_reflection2 = 77,
int8_t  early_reflection3 = 127,
int8_t  loop1_delay = 117,
uint8_t  loop2_delay = 255,
int8_t  feedback_level = 85 
)
inline

Constructor.

This has default values for the early reflection times, recirculating delay lengths and feedback level, which can be changed here in the constructor or set with other functions during run time.

Parameters
early_reflection1how long in delay cells till the first early reflection, from 0 to 127
early_reflection2how long in delay cells till the second early reflection, from early_reflection1 to 127
early_reflection3how long in delay cells till the third early reflection, from early_reflection2 to 127
loop1_delayhow long in delay cells for the first recirculating delay, form 0 to 127
loop2_delayhow long in delay cells for the first recirculating delay, form 0 to 255
feedback_levelhow much recirculation, from -128 to 127

Definition at line 45 of file ReverbTank.h.

Member Function Documentation

◆ next()

int ReverbTank::next ( int  input)
inline

Process the next audio sample and return the reverbed signal.

This returns only the "wet" signal, which can be combined with the dry input signal in the sketch.

Parameters
inputthe audio signal to process
Returns
the processed signal

Definition at line 65 of file ReverbTank.h.

◆ setEarlyReflections()

void ReverbTank::setEarlyReflections ( int8_t  early_reflection1,
int8_t  early_reflection2,
int8_t  early_reflection3 
)
inline

Set the early reflection times in terms of delay cells.

Parameters
early_reflection1how long in delay cells till the first early reflection, from 0 to 127
early_reflection2how long in delay cells till the second early reflection, from early_reflection1 to 127
early_reflection3how long in delay cells till the third early reflection, from early_reflection2 to 127

Definition at line 91 of file ReverbTank.h.

◆ setFeebackLevel()

void ReverbTank::setFeebackLevel ( int8_t  feedback_level)
inline

Set the feedback level for the recirculating delays.

Parameters
feedback_levelhow much recirculation, from -128 to 127

Definition at line 110 of file ReverbTank.h.

◆ setLoopDelays()

void ReverbTank::setLoopDelays ( int8_t  loop1_delay,
uint8_t  loop2_delay 
)
inline

Set the loop delay times in terms of delay cells.

Parameters
loop1_delayhow long in delay cells for the first recirculating delay, form 0 to 127
loop2_delayhow long in delay cells for the first recirculating delay, form 0 to 255

Definition at line 102 of file ReverbTank.h.