Sound Design Toolkit 075 Physically informed sound synthesis for everyday sounds

- Main Page
- Modules
- Data Structures
- Files

Typedefs | Functions
Fluid flow
SDTLiquids.h: Liquid sounds

## Typedefs
typedef struct SDTFluidFlow | SDTFluidFlow
| Opaque data structure representing a fluid flow object.

## Functions
SDTFluidFlow * | SDTFluidFlow_new (int nBubbles)
| Object constructor. More...
void | SDTFluidFlow_free (SDTFluidFlow *x)
| Object destructor. More...
void | SDTFluidFlow_setMinRadius (SDTFluidFlow *x, double f)
| Sets the minimum radius for the bubble population. More...
void | SDTFluidFlow_setMaxRadius (SDTFluidFlow *x, double f)
| Sets the maximum radius for the bubble population. More...
void | SDTFluidFlow_setExpRadius (SDTFluidFlow *x, double f)
| Sets the gamma factor for the radius assignment. More...
void | SDTFluidFlow_setMinDepth (SDTFluidFlow *x, double f)
| Sets the minimum depth value for the bubble population. More...
void | SDTFluidFlow_setMaxDepth (SDTFluidFlow *x, double f)
| Sets the maximum depth value for the bubble population. More...
void | SDTFluidFlow_setExpDepth (SDTFluidFlow *x, double f)
| Sets the gamma factor for the depth assignment. More...
void | SDTFluidFlow_setRiseFactor (SDTFluidFlow *x, double f)
| Sets the amount of blooping for the bubble population. More...
void | SDTFluidFlow_setRiseCutoff (SDTFluidFlow *x, double f)
| Bubbles deeper than this threshold do not rise in frequency. More...
void | SDTFluidFlow_setAvgRate (SDTFluidFlow *x, double f)
| Sets the amount of generated bubbles per second. More...
double | SDTFluidFlow_dsp (SDTFluidFlow *x)
| Signal processing routine. Call this function at sample rate to obtain a liquid sound. More...

## Detailed Description

Rich and complex liquid sound simulations can be generated through a stochastic population of bubbles, modeled by a sinusoidal oscillator bank with each voice modulated in amplitude and frequency according to desired probability distributions. A simple stochastic algorithm controls the behavior of the bubble population: Bubble generation rate follows a Bernoulli process, while radius and depth for each new bubble are chosen at random. To limit the presence of sudden peaks and glitches, voices are updated based on their age: The bubble with the lowest amplitude gets "killed" in favor of the new one.

## Function Documentation

double SDTFluidFlow_dsp | ( | SDTFluidFlow * | x | ) |

Signal processing routine. Call this function at sample rate to obtain a liquid sound.

Returns
  Output sample

void SDTFluidFlow_free | ( | SDTFluidFlow * | x | ) |

Object destructor.

Parameters

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

SDTFluidFlow* SDTFluidFlow_new | ( | int | nBubbles | ) |

Object constructor.

Parameters

  [in] | Number | of voices in the oscillator bank

Returns
  Pointer to the new instance

void SDTFluidFlow_setAvgRate | ( | SDTFluidFlow * | x,
|  | double | f
| ) |  |

Sets the amount of generated bubbles per second.

Parameters

  [in] | f | Average number of bubbles per second

void SDTFluidFlow_setExpDepth | ( | SDTFluidFlow * | x,
|  | double | f
| ) |  |

Sets the gamma factor for the depth assignment.

Parameters

  [in] | f | Depth gamma factor. O to 1 = shallower bubbles, > 1 = deeper bubbles

void SDTFluidFlow_setExpRadius | ( | SDTFluidFlow * | x,
|  | double | f
| ) |  |

Sets the gamma factor for the radius assignment.

Parameters

  [in] | f | Radius gamma factor. O to 1 = bigger bubbles, > 1 = smaller bubbles

void SDTFluidFlow_setMaxDepth | ( | SDTFluidFlow * | x,
|  | double | f
| ) |  |

Sets the maximum depth value for the bubble population.

Parameters

  [in] | f | Maximum depth value of the generated bubbles, [0, 1]

void SDTFluidFlow_setMaxRadius | ( | SDTFluidFlow * | x,
|  | double | f
| ) |  |

Sets the maximum radius for the bubble population.

Parameters

  [in] | f | Maximum radius of the generated bubbles, in m [0.00015, 0.150]

void SDTFluidFlow_setMinDepth | ( | SDTFluidFlow * | x,
|  | double | f
| ) |  |

Sets the minimum depth value for the bubble population.

Parameters

  [in] | f | Minimum depth value of the generated bubbles, [0, 1]

void SDTFluidFlow_setMinRadius | ( | SDTFluidFlow * | x,
|  | double | f
| ) |  |

Sets the minimum radius for the bubble population.

Parameters

  [in] | f | Minimum radius of the generated bubbles, in m [0.00015, 0.150]

void SDTFluidFlow_setRiseCutoff | ( | SDTFluidFlow * | x,
|  | double | f
| ) |  |

Bubbles deeper than this threshold do not rise in frequency.

Parameters

  [in] | f | Rise cutoff, [0, 1]

void SDTFluidFlow_setRiseFactor | ( | SDTFluidFlow * | x,
|  | double | f
| ) |  |

Sets the amount of blooping for the bubble population.

Parameters

  [in] | f | Rise factor. Typical value for water = 0.1