Sound Design Toolkit 075 Physically informed sound synthesis for everyday sounds

- Main Page
- Modules
- Data Structures
- Files

Typedefs | Functions
Digital waveguide
SDTFilters.h: Audio filters

## Typedefs
typedef struct SDTWaveguide | SDTWaveguide
| Opaque data structure representing a digital waveguide object.

## Functions
SDTWaveguide * | SDTWaveguide_new (int maxDelay)
| Object constructor. More...
void | SDTWaveguide_free (SDTWaveguide *x)
| Object destructor. More...
double | SDTWaveguide_getFwdOut (SDTWaveguide *x)
| Reads the output signal coming from the right side of the waveguide. More...
double | SDTWaveguide_getRevOut (SDTWaveguide *x)
| Reads the output signal coming from the left side of the waveguide. More...
void | SDTWaveguide_setDelay (SDTWaveguide *x, double f)
| Sets the length of the waveguide, in samples. More...
void | SDTWaveguide_setFwdFeedback (SDTWaveguide *x, double f)
| Sets the feedback on the right side. Determines how much energy gets fed back into the system after the wave reaches the right side of the waveguide. Consequently, this value also determines how much attenuated is the output on the same side. More...
void | SDTWaveguide_setRevFeedback (SDTWaveguide *x, double f)
| Sets the feedback on the left side. Determines how much energy gets fed back into the system after the wave reaches the left side of the waveguide. Consequently, this value also determines how much attenuated is the output on the same side. More...
void | SDTWaveguide_setFwdDamping (SDTWaveguide *x, double f)
| Sets the frequency damping on the right side. More...
void | SDTWaveguide_setRevDamping (SDTWaveguide *x, double f)
| Sets the frequency damping on the left side. More...
void | SDTWaveguide_dsp (SDTWaveguide *x, double fwdIn, double revIn)
| Signal processing routine. Call this function at sample rate to compute the output samples. To read them, call the respective functions SDTWaveguide_getFwdOut() and SDTWaveguide_getRevOut(). More...

## Detailed Description

Digital waveguide, simulating relection/refraction of waves in a medium such as the air column in a tube or a vibrating string. Composed of two delay lines of the same length, in a mutual feedback configuration.

## Function Documentation

void SDTWaveguide_dsp | ( | SDTWaveguide * | x,
|  | double | fwdIn,
|  | double | revIn
| ) |  |

Signal processing routine. Call this function at sample rate to compute the output samples. To read them, call the respective functions SDTWaveguide_getFwdOut() and SDTWaveguide_getRevOut().

Parameters

  [in] | fwdIn | Input coming from the left side of the waveguide
  [in] | fwdIn | Input coming from the right side of the waveguide

void SDTWaveguide_free | ( | SDTWaveguide * | x | ) |

Object destructor.

Parameters

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

double SDTWaveguide_getFwdOut | ( | SDTWaveguide * | x | ) |

Reads the output signal coming from the right side of the waveguide.

Returns
  Output sample

double SDTWaveguide_getRevOut | ( | SDTWaveguide * | x | ) |

Reads the output signal coming from the left side of the waveguide.

Returns
  Output sample

SDTWaveguide* SDTWaveguide_new | ( | int | maxDelay | ) |

Object constructor.

Parameters

  [in] | maxDelay | Size of the two buffers, in samples

Returns
  Pointer to the new instance

void SDTWaveguide_setDelay | ( | SDTWaveguide * | x,
|  | double | f
| ) |  |

Sets the length of the waveguide, in samples.

Parameters

  [in] | f | Delay time, in samples

void SDTWaveguide_setFwdDamping | ( | SDTWaveguide * | x,
|  | double | f
| ) |  |

Sets the frequency damping on the right side.

Parameters

  [in] | f | High frequency damping [0,1]

void SDTWaveguide_setFwdFeedback | ( | SDTWaveguide * | x,
|  | double | f
| ) |  |

Sets the feedback on the right side. Determines how much energy gets fed back into the system after the wave reaches the right side of the waveguide. Consequently, this value also determines how much attenuated is the output on the same side.

Parameters

  [in] | f | Feedback gain [0,1]

void SDTWaveguide_setRevDamping | ( | SDTWaveguide * | x,
|  | double | f
| ) |  |

Sets the frequency damping on the left side.

Parameters

  [in] | f | High frequency damping [0,1]

void SDTWaveguide_setRevFeedback | ( | SDTWaveguide * | x,
|  | double | f
| ) |  |

Sets the feedback on the left side. Determines how much energy gets fed back into the system after the wave reaches the left side of the waveguide. Consequently, this value also determines how much attenuated is the output on the same side.

Parameters

  [in] | f | Feedback gain [0,1]