public class PulseWave extends Oscillator
TWO_PI| Constructor and Description |
|---|
PulseWave(float frequency,
float amplitude,
float sampleRate)
Constructs a pulse wave with the given frequency, amplitude and sample
rate.
|
| Modifier and Type | Method and Description |
|---|---|
float |
getPulseWidth()
Returns the current pulse width.
|
void |
setPulseWidth(float w)
Sets the pulse width of the pulse wave.
|
protected float |
value(float step)
Returns the value of the waveform at
step. |
amplitude, frequency, generate, generate, noPortamento, pan, period, portamento, sampleRate, setAmp, setAudioListener, setFreq, setPan, setPanNoGlidepublic PulseWave(float frequency,
float amplitude,
float sampleRate)
frequency - the frequency of the pulse waveamplitude - the amplitude of the pulse wavesampleRate - the sample rate of the pulse wavepublic void setPulseWidth(float w)
w - the new pulse width, this will be constrained to [1, 30]public float getPulseWidth()
protected float value(float step)
Oscillatorstep. To take
advantage of all of the work that Oscillator does, you can
create your own periodic waveforms by extending Oscillator
and implementing this function. All of the oscillators included with Minim
were created in this way.value in class Oscillatorstep - an offset from the beginning of the waveform's periodstep