Skip to content
This is the development version of the documentation. It may change before the next release. See 0.6.x for the latest release.

Modulation

Modulation is an amplitude modulation (AM) feature that modulates the output amplitude of each transducer over time. It applies a coefficient sequence common to all transducers while sampling it at a fixed period, thereby varying the intensity of the sound field produced by the Pattern over time.

Each sample is an 8 bit amplitude coefficient , which is multiplied by the transducer output amplitude and then divided by 255.

Each sample in the buffer is applied in order at the period of the SamplingConfig passed to Modulation::new. The sampling_config held by the Option of a waveform computation function determines the length of the waveform (number of samples), and it must match the SamplingConfig passed to Modulation::new. For example, with SamplingConfig::FREQ_4K (4 kHz, sampling period 250 µs), one period of a 200 Hz sine wave is 20 samples.