Minim |
|
gen9 |
Description 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:
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:
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. Signature Wavetable gen9(int size, float[] partial, float[] amp, float[] phase) Parameters size — int: how many samples the Wavetable should containpartial — float[]: a list of partials to generate amp — float[]: the amplitude of each partial phase — float[]: the phase of each partial Returns a Wavetable Related WavetableExample None available Usage Web & Application |