Sound Design Toolkit  078
Physically informed sound synthesis for everyday sounds

Typedefs

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

Functions

SDTWaveguideSDTWaveguide_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]fwdInInput coming from the left side of the waveguide
[in]fwdInInput coming from the right side of the waveguide
void SDTWaveguide_free ( SDTWaveguide x)

Object destructor.

Parameters
[in]xPointer 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]maxDelaySize 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]fDelay time, in samples
void SDTWaveguide_setFwdDamping ( SDTWaveguide x,
double  f 
)

Sets the frequency damping on the right side.

Parameters
[in]fHigh 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]fFeedback gain [0,1]
void SDTWaveguide_setRevDamping ( SDTWaveguide x,
double  f 
)

Sets the frequency damping on the left side.

Parameters
[in]fHigh 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]fFeedback gain [0,1]