Package wellen

Class Wavetable

  • All Implemented Interfaces:
    DSPNodeOutput

    public class Wavetable
    extends Oscillator
    plays back a chunk of samples ( i.e arbitrary, single-cycle waveform like sine, triangle, saw or square waves ) at different frequencies and amplitudes.
    • Constructor Detail

      • Wavetable

        public Wavetable()
      • Wavetable

        public Wavetable​(int pWavetableSize)
      • Wavetable

        public Wavetable​(int pWavetableSize,
                         int pSamplingRate)
    • Method Detail

      • fill

        public static void fill​(float[] pWavetable,
                                int pWavetableType)
      • fill

        public static void fill​(float[] pWavetable,
                                int pHarmonics,
                                int pWavetableType)
      • sawtooth

        public static float[] sawtooth​(float[] pWavetable,
                                       int pHarmonics)
      • square

        public static float[] square​(float[] pWavetable,
                                     int pHarmonics)
      • triangle

        public static float[] triangle​(float[] pWavetable,
                                       int pHarmonics)
      • sine

        public static void sine​(float[] pWavetable)
      • sawtooth

        public static void sawtooth​(float[] pWavetable)
      • triangle

        public static void triangle​(float[] pWavetable)
      • square

        public static void square​(float[] pWavetable)
      • noise

        public static void noise​(float[] pWavetable)
      • set_frequency

        public void set_frequency​(float pFrequency)
        Specified by:
        set_frequency in class Oscillator
      • set_frequency

        public void set_frequency​(float pFrequency,
                                  int pInterpolationDurationInSamples)
        alternative version of `set_frequency` which takes a second paramter that specifies the duration in samples from current to new value. this can prevent unwanted artifacts ( e.g when quickly changing values ). it can also be used to create glissando or portamento effects.
        Parameters:
        pFrequency - destination frequency
        pInterpolationDurationInSamples - duration of interpolation in samples
      • set_offset

        public void set_offset​(float pOffset)
        Specified by:
        set_offset in class Oscillator
      • set_amplitude

        public void set_amplitude​(float pAmplitude)
        Specified by:
        set_amplitude in class Oscillator
      • set_amplitude

        public void set_amplitude​(float pAmplitude,
                                  int pInterpolationDurationInSamples)
        alternative version of `set_amplitude` which takes a second paramter that specifies the duration in samples from current to new value. this can prevents unwanted artifacts ( e.g crackling noise when changing amplitude quickly especially on smoother wave shape like sine waves ). it can also be used to create glissando or portamento effects.
        Parameters:
        pAmplitude - destination amplitude
        pInterpolationDurationInSamples - duration of interpolation in samples
      • get_wavetable

        public float[] get_wavetable()
      • enable_jitter

        public void enable_jitter​(boolean pEnableJitter)
      • get_phase_offset

        public float get_phase_offset()
      • set_phase_offset

        public void set_phase_offset​(float pPhaseOffset)
      • get_jitter_range

        public float get_jitter_range()
      • set_jitter_range

        public void set_jitter_range​(float pJitterRange)
      • reset

        public void reset()
      • current

        public float current()
      • set_interpolation

        public void set_interpolation​(int pInterpolationType)
      • output

        public float output()