Sound Design Toolkit 075 Physically informed sound synthesis for everyday sounds

- Main Page
- Modules
- Data Structures
- Files

Typedefs | Functions
SDTDCMotor.h: Electric motors

## Typedefs
typedef struct SDTDCMotor | SDTDCMotor
| Opaque data structure for the electric motor synthesis model.

## Functions
SDTDCMotor * | SDTDCMotor_new (long maxSize)
| Object constructor. More...
void | SDTDCMotor_free (SDTDCMotor *x)
| Object destructor. More...
void | SDTDCMotor_setFilters (SDTDCMotor *x)
| Sets the filter coefficients. Call this function whenever the sample rate changes.
void | SDTDCMotor_setRpm (SDTDCMotor *x, double f)
| Sets the Revolutions Per Minute (RPM) of the engine rotor. More...
void | SDTDCMotor_setLoad (SDTDCMotor *x, double f)
| Sets the mechanical stress on the rotor. More...
void | SDTDCMotor_setCoils (SDTDCMotor *x, long l)
| Sets the number of coils on the rotor. More...
void | SDTDCMotor_setSize (SDTDCMotor *x, double f)
| Sets the size of the chassis. The maximum chassis size depends on the buffer length defined at construction time and on the current sampling rate. More...
void | SDTDCMotor_setReson (SDTDCMotor *x, double f)
| Sets the amount of resonance caused by the chassis. More...
void | SDTDCMotor_setGearRatio (SDTDCMotor *x, double f)
| Sets the gear ratio of the engine. More...
void | SDTDCMotor_setHarshness (SDTDCMotor *x, double f)
| Sets the harshness of the engine sound. More...
void | SDTDCMotor_setRotorGain (SDTDCMotor *x, double f)
| Sets the sound volume coming from the rotor. More...
void | SDTDCMotor_setGearGain (SDTDCMotor *x, double f)
| Sets the sound volume coming from the gears. More...
void | SDTDCMotor_setBrushGain (SDTDCMotor *x, double f)
| Sets the sound volume coming from the commutator ring and brushes. More...
void | SDTDCMotor_setAirGain (SDTDCMotor *x, double f)
| Sets the sound volume of the air turbulence caused by rotation. More...
double | SDTDCMotor_dsp (SDTDCMotor *x)
| Signal processing routine. Call this function at sample rate to synthesize an electric motor sound. More...

## Detailed Description

Physically informed model for the synthesis of electric motor sounds.

Electric motors exploit magnetic induction to convert electric energy into mechanical energy. An ideal electric motor should be perfectly silent. In practice, however, rotors are never perfectly balanced and generate pitched tones depending on their revolutions per minute (RPM). Moreover, contacts between parts cause friction noise. Finally, rotation causes air movement and therefore turbulence noise, sometimes increased by the presence of a cooling fan attached to the rotor.

The pitched tone of the rotor is obtained through additive synthesis, summing a fixed number of harmonic partials. Frequency modulation simulates the unevenness in the rotation caused by attached loads. Resonances modes of the chassis are modeled through a comb filter. Aerodynamic turbulence caused by the spinning parts is synthesized with bandpass-filtered white noise, exactly like in the gas model.

## Function Documentation

double SDTDCMotor_dsp | ( | SDTDCMotor * | x | ) |

Signal processing routine. Call this function at sample rate to synthesize an electric motor sound.

Returns
  Computed audio sample

void SDTDCMotor_free | ( | SDTDCMotor * | x | ) |

Object destructor.

Parameters

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

SDTDCMotor* SDTDCMotor_new | ( | long | maxSize | ) |

Object constructor.

Parameters

  [in] | maxSize | Buffer length of the internal comb filter, in samples

Returns
  Pointer to the new instance

void SDTDCMotor_setAirGain | ( | SDTDCMotor * | x,
|  | double | f
| ) |  |

Sets the sound volume of the air turbulence caused by rotation.

Parameters

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

void SDTDCMotor_setBrushGain | ( | SDTDCMotor * | x,
|  | double | f
| ) |  |

Sets the sound volume coming from the commutator ring and brushes.

Parameters

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

void SDTDCMotor_setCoils | ( | SDTDCMotor * | x,
|  | long | l
| ) |  |

Sets the number of coils on the rotor.

Parameters

  [in] | l | Number of coils on the rotor

void SDTDCMotor_setGearGain | ( | SDTDCMotor * | x,
|  | double | f
| ) |  |

Sets the sound volume coming from the gears.

Parameters

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

void SDTDCMotor_setGearRatio | ( | SDTDCMotor * | x,
|  | double | f
| ) |  |

Sets the gear ratio of the engine.

Parameters

  [in] | f | Gear ratio

void SDTDCMotor_setHarshness | ( | SDTDCMotor * | x,
|  | double | f
| ) |  |

Sets the harshness of the engine sound.

Parameters

  [in] | f | Harshness [0, 1]

void SDTDCMotor_setLoad | ( | SDTDCMotor * | x,
|  | double | f
| ) |  |

Sets the mechanical stress on the rotor.

Parameters

  [in] | f | Engine load [0, 1]

void SDTDCMotor_setReson | ( | SDTDCMotor * | x,
|  | double | f
| ) |  |

Sets the amount of resonance caused by the chassis.

Parameters

  [in] | f | Chassis resonance [0, 1]

void SDTDCMotor_setRotorGain | ( | SDTDCMotor * | x,
|  | double | f
| ) |  |

Sets the sound volume coming from the rotor.

Parameters

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

void SDTDCMotor_setRpm | ( | SDTDCMotor * | x,
|  | double | f
| ) |  |

Sets the Revolutions Per Minute (RPM) of the engine rotor.

Parameters

  [in] | f | Engine RPM

void SDTDCMotor_setSize | ( | SDTDCMotor * | x,
|  | double | f
| ) |  |

Sets the size of the chassis. The maximum chassis size depends on the buffer length defined at construction time and on the current sampling rate.

Parameters

  [in] | f | Chassis length, in m