Class PeriodicWave

java.lang.Object
com.codename1.media.audio.PeriodicWave

public final class PeriodicWave extends Object

A custom oscillator waveform given by its Fourier coefficients, the Web Audio PeriodicWave. Create one with [BaseAudioContext#createPeriodicWave(float[], float[])] and play it with OscillatorNode.setPeriodicWave(PeriodicWave).

The waveform is sum(real[k] cos(k w t) + imag[k] sin(k w t)) for k from

  1. It is rendered from wavetables built once, each keeping only the harmonics below the Nyquist frequency for its pitch range, so it does not alias.