ddf.minim.ugens
Class Waves

java.lang.Object
  extended by ddf.minim.ugens.Waves

public class Waves
extends java.lang.Object

A library of waveforms.

Author:
Nicolas Brix, Anderson Mills

Field Summary
static Wavetable PHASOR
          A perfect phasor wave going from 0 to 1.
static Wavetable QUARTERPULSE
          A perfect square wave with a 25% duty cycle.
static Wavetable SAW
          A perfect sawtooth wave.
static Wavetable SINE
          A pure sine wave.
static Wavetable SQUARE
          A perfect square wave with a 50% duty cycle.
static Wavetable TRIANGLE
          A perfect triangle wave.
 
Constructor Summary
Waves()
           
 
Method Summary
static Wavetable add(float[] amps, Wavetable... waves)
          Adds any number of Wavetables, each with their own amplitude
static Wavetable pulse(float dutyCycle)
          Constructs a square wave with specficed duty cycle.
static Wavetable randomNHarms(int numberOfHarms)
          Constructs a wave from the first numberofHarms harmonics given random amplitudes.
static Wavetable randomNOddHarms(int numberOfHarms)
          Constructs a wave from the numberOfHarms even harmonics given random amplitudes.
static Wavetable randomNoise()
          Constructs a wavetable of noise
static Wavetable saw(float dutyCycle)
          Constructs a sawtooth wave with specficed duty cycle.
static Wavetable saw(int numberOfHarms)
          Builds a sawtooth wave from the first numberofHarms harmonics.
static Wavetable square(float dutyCycle)
          Constructs a square wave with specficed duty cycle.
static Wavetable square(int numberOfHarms)
          Builds a square wave from the first numberofHarms harmonics.
static Wavetable triangle(float dutyCycle)
          Constructs a triangle wave with specficed duty cycle.
static Wavetable triangle(int numberOfHarms)
          Builds a triangle wave from the first numberofHarms harmonics.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SINE

public static final Wavetable SINE
A pure sine wave.


SAW

public static final Wavetable SAW
A perfect sawtooth wave.


PHASOR

public static final Wavetable PHASOR
A perfect phasor wave going from 0 to 1.


SQUARE

public static final Wavetable SQUARE
A perfect square wave with a 50% duty cycle.


TRIANGLE

public static final Wavetable TRIANGLE
A perfect triangle wave.


QUARTERPULSE

public static final Wavetable QUARTERPULSE
A perfect square wave with a 25% duty cycle.

Constructor Detail

Waves

public Waves()
Method Detail

saw

public static Wavetable saw(int numberOfHarms)
Builds a sawtooth wave from the first numberofHarms harmonics.

Parameters:
numberOfHarms -
Returns:
Wavetable

square

public static Wavetable square(int numberOfHarms)
Builds a square wave from the first numberofHarms harmonics.

Parameters:
numberOfHarms -
Returns:
Wavetable

triangle

public static Wavetable triangle(int numberOfHarms)
Builds a triangle wave from the first numberofHarms harmonics.

Parameters:
numberOfHarms -
Returns:
Wavetable

pulse

public static Wavetable pulse(float dutyCycle)
Constructs a square wave with specficed duty cycle.

Parameters:
dutyCycle -
Returns:
Wavetable

triangle

public static Wavetable triangle(float dutyCycle)
Constructs a triangle wave with specficed duty cycle.

Parameters:
dutyCycle -
Returns:
Wavetable

saw

public static Wavetable saw(float dutyCycle)
Constructs a sawtooth wave with specficed duty cycle.

Parameters:
dutyCycle -
Returns:
Wavetable

square

public static Wavetable square(float dutyCycle)
Constructs a square wave with specficed duty cycle.

Parameters:
dutyCycle -
Returns:
Wavetable

randomNHarms

public static Wavetable randomNHarms(int numberOfHarms)
Constructs a wave from the first numberofHarms harmonics given random amplitudes.

Parameters:
numberOfHarms -
Returns:
Wavetable

randomNOddHarms

public static Wavetable randomNOddHarms(int numberOfHarms)
Constructs a wave from the numberOfHarms even harmonics given random amplitudes.

Parameters:
numberOfHarms -
Returns:
Wavetable

randomNoise

public static Wavetable randomNoise()
Constructs a wavetable of noise

Returns:
Wavetable

add

public static Wavetable add(float[] amps,
                            Wavetable... waves)
Adds any number of Wavetables, each with their own amplitude

Parameters:
amps -
waves -
Returns:
Wavetable