Sound Design Toolkit 075 Physically informed sound synthesis for everyday sounds

- Main Page
- Modules
- Data Structures
- Files

Typedefs | Functions
Turbulence through hollow cavities
SDTGases.h: Air turbulence and explosions

## Typedefs
typedef struct SDTWindCavity | SDTWindCavity
| Opaque data structure for a hollow cavity object.

## Functions
SDTWindCavity * | SDTWindCavity_new (int maxDelay)
| Object constructor. More...
void | SDTWindCavity_free (SDTWindCavity *x)
| Object destructor. More...
void | SDTWindCavity_setLength (SDTWindCavity *x, double f)
| Sets the lenght of the cavity. More...
void | SDTWindCavity_setDiameter (SDTWindCavity *x, double f)
| Sets the diameter of the cavity. More...
void | SDTWindCavity_setWindSpeed (SDTWindCavity *x, double f)
| Sets the wind speed. More...
double | SDTWindCavity_dsp (SDTWindCavity *x)
| Signal processing routine. Call this function at sample rate to synthesize wind through a cavity. More...

## Detailed Description

Hollow objects such as pipes, valves, tunnels and doorways force the air moving inside them to oscillate at their resonant frequencies, which depend on the size and shape of the cavity itself. Different modes of resonance can be excited, in a more or less noticeable way, depending on the speed of the air flowing inside the tube. For each mode of resonance there is an optimal speed, which makes the air inside the tube resonate the most. As the speed increases, resonance gets weaker and weaker until it breaks up into the next harmonic. Sound waves trapped in a cylindrical cavity can be effectively simulated using a simple comb filter, namely a delay line with feedback. The different excitation of the various harmonics is modeled by a resonant bandpass filter with a high Q factor, therefore with a narrow band and a high resonance.

## Function Documentation

double SDTWindCavity_dsp | ( | SDTWindCavity * | x | ) |

Signal processing routine. Call this function at sample rate to synthesize wind through a cavity.

Returns
  Computed audio sample

void SDTWindCavity_free | ( | SDTWindCavity * | x | ) |

Object destructor.

Parameters

  [in] | x | Pointer to the instance to destroy

SDTWindCavity* SDTWindCavity_new | ( | int | maxDelay | ) |

Object constructor.

Parameters

  [in] | maxDelay | Size of the comb filter buffer, in samples.

Returns
  Pointer to the new instance

void SDTWindCavity_setDiameter | ( | SDTWindCavity * | x,
|  | double | f
| ) |  |

Sets the diameter of the cavity.

Parameters

  [in] | f | Diameter of the cavity, in m

void SDTWindCavity_setLength | ( | SDTWindCavity * | x,
|  | double | f
| ) |  |

Sets the lenght of the cavity.

Parameters

  [in] | f | Length of the cavity, in m

void SDTWindCavity_setWindSpeed | ( | SDTWindCavity * | x,
|  | double | f
| ) |  |

Sets the wind speed.

Parameters

  [in] | f | Wind speed, [0,1]