core | ugens | analysis




Generates a Wavetable from a list of partials with matching amplitudes and phases. Partial, here, refers to a particular sine wave in the harmonic series (see: Harmonic vs. partial). If you want to generate a single sine wave, suitable for playing a single tone of a particular frequency in an Oscil, you could use this code:

Wavetable sine = WavetableGenerator.gen9(4096, new float[] { 1 }, new float[] { 1 }, new float[] { 0 });

But what this method lets you do, is create a Wavetable that contains several different partials, each with a particular amplitude or phase shift. For instance, you could create a Wavetable that plays two pitches an octave apart like this:

Wavetable octave = WavetableGenerator.gen9(4096, new float[] { 1, 2 }, new float[] { 1, 1 }, new float[] { 0, 0 });

If this is something you want a particular instrument you write to do, then creating a Wavetable that already contains the octave and using that in an Oscil will be less computationally expensive than creating two Oscils and setting their frequencies an octave apart.


Wavetable gen9(int size, float[] partial, float[] amp, float[] phase)


size — int: how many samples the Wavetable should contain
partial — float[]: a list of partials to generate
amp — float[]: the amplitude of each partial
phase — float[]: the phase of each partial


a Wavetable




None available


Web & Application