Sound Design Toolkit  078
Physically informed sound synthesis for everyday sounds
SDTDCMotor.h
1 
22 #ifndef SDT_DCMOTOR_H
23 #define SDT_DCMOTOR_H
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
30 typedef struct SDTDCMotor SDTDCMotor;
31 
35 extern SDTDCMotor *SDTDCMotor_new(long maxSize);
36 
39 extern void SDTDCMotor_free(SDTDCMotor *x);
40 
43 extern void SDTDCMotor_setFilters(SDTDCMotor *x);
44 
47 extern void SDTDCMotor_setRpm(SDTDCMotor *x, double f);
48 
51 extern void SDTDCMotor_setLoad(SDTDCMotor *x, double f);
52 
55 extern void SDTDCMotor_setCoils(SDTDCMotor *x, long l);
56 
61 extern void SDTDCMotor_setSize(SDTDCMotor *x, double f);
62 
65 extern void SDTDCMotor_setReson(SDTDCMotor *x, double f);
66 
69 extern void SDTDCMotor_setGearRatio(SDTDCMotor *x, double f);
70 
73 extern void SDTDCMotor_setHarshness(SDTDCMotor *x, double f);
74 
77 extern void SDTDCMotor_setRotorGain(SDTDCMotor *x, double f);
78 
81 extern void SDTDCMotor_setGearGain(SDTDCMotor *x, double f);
82 
85 extern void SDTDCMotor_setBrushGain(SDTDCMotor *x, double f);
86 
89 extern void SDTDCMotor_setAirGain(SDTDCMotor *x, double f);
90 
94 extern double SDTDCMotor_dsp(SDTDCMotor *x);
95 
96 #ifdef __cplusplus
97 };
98 #endif
99 
100 #endif
101 
void SDTDCMotor_setCoils(SDTDCMotor *x, long l)
Sets the number of coils on the rotor.
void SDTDCMotor_free(SDTDCMotor *x)
Object destructor.
void SDTDCMotor_setReson(SDTDCMotor *x, double f)
Sets the amount of resonance caused by the chassis.
void SDTDCMotor_setLoad(SDTDCMotor *x, double f)
Sets the mechanical stress on the rotor.
void SDTDCMotor_setSize(SDTDCMotor *x, double f)
Sets the size of the chassis. The maximum chassis size depends on the buffer length defined at constr...
void SDTDCMotor_setRotorGain(SDTDCMotor *x, double f)
Sets the sound volume coming from the rotor.
void SDTDCMotor_setRpm(SDTDCMotor *x, double f)
Sets the Revolutions Per Minute (RPM) of the engine rotor.
struct SDTDCMotor SDTDCMotor
Opaque data structure for the electric motor synthesis model.
Definition: SDTDCMotor.h:30
double SDTDCMotor_dsp(SDTDCMotor *x)
Signal processing routine. Call this function at sample rate to synthesize an electric motor sound...
void SDTDCMotor_setGearGain(SDTDCMotor *x, double f)
Sets the sound volume coming from the gears.
void SDTDCMotor_setHarshness(SDTDCMotor *x, double f)
Sets the harshness of the engine sound.
void SDTDCMotor_setBrushGain(SDTDCMotor *x, double f)
Sets the sound volume coming from the commutator ring and brushes.
SDTDCMotor * SDTDCMotor_new(long maxSize)
Object constructor.
void SDTDCMotor_setAirGain(SDTDCMotor *x, double f)
Sets the sound volume of the air turbulence caused by rotation.
void SDTDCMotor_setGearRatio(SDTDCMotor *x, double f)
Sets the gear ratio of the engine.
void SDTDCMotor_setFilters(SDTDCMotor *x)
Sets the filter coefficients. Call this function whenever the sample rate changes.