Sound Design Toolkit  078
Physically informed sound synthesis for everyday sounds

Typedefs

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

Functions

SDTFluidFlowSDTFluidFlow_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]xPoiter to the instance to destroy
SDTFluidFlow * SDTFluidFlow_new ( int  nBubbles)

Object constructor.

Parameters
[in]Numberof 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]fAverage number of bubbles per second
void SDTFluidFlow_setExpDepth ( SDTFluidFlow x,
double  f 
)

Sets the gamma factor for the depth assignment.

Parameters
[in]fDepth 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]fRadius 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]fMaximum 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]fMaximum 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]fMinimum 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]fMinimum 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]fRise cutoff, [0, 1]
void SDTFluidFlow_setRiseFactor ( SDTFluidFlow x,
double  f 
)

Sets the amount of blooping for the bubble population.

Parameters
[in]fRise factor. Typical value for water = 0.1