public class VariableDelayEffect extends AudioEffect16Bit
VariableDelay
ADD, DO_NOTHING, MULTIPLY
Constructor and Description |
---|
VariableDelayEffect(int forwardMemSize,
int feedback,
java.lang.String LFOType,
java.lang.String filterType,
int oscillationPeriod,
java.lang.String summingType,
int amplitude,
float delayInMs,
boolean chunked,
float sampleRate)
Creates an variable delay effect with a particular forward memory size and oscillation type.
|
Modifier and Type | Method and Description |
---|---|
short[] |
process(short[] input)
Process method calls appropriate Variable delay Process method depending on the users decision to use or not chunked
data.
|
void |
setAmplitude(int amp)
Sets the size of the amplitude of the LFO waveform.
|
void |
setChunked(boolean chunk)
Determines whether chunked data is being used or not
|
void |
setDelayOffset(float offset)
Sets the delay size in samples that the delayed signal will be delayed by.
|
void |
setFeedback(int feed)
Sets the feedback factor.
|
void |
setFilterType(java.lang.String filt)
Sets the type of filter to be used to create the delay.
|
void |
setLFOType(java.lang.String lowfreqosc)
Determines which type of low frequency oscillator will be instantiated
|
void |
setOscillationPeriod(int osc)
Sets the size of the oscillationPeriod of one complete cycle of the LFO waveform, in samples.
|
void |
setSummingType(java.lang.String summer)
Sets the type of summing of the original signal with the varied signal.
|
short[] |
variProcess(short[] input)
Method for non chunked data.
|
short[] |
variProcessChunked(short[] input)
Method for chunked data.
|
getData, getStart, initialiseForward, initialiseForward, preProcess, setForwardMathOperation
public VariableDelayEffect(int forwardMemSize, int feedback, java.lang.String LFOType, java.lang.String filterType, int oscillationPeriod, java.lang.String summingType, int amplitude, float delayInMs, boolean chunked, float sampleRate)
forwardMemSize
- the size of the forward memory to be used by AudioEffect16bit class.feedback
- the level of attenutation of the delayed signal in the the feedback comb filter. Should
be divided by 100 to give value in percent.LFOType
- chooses the type of oscillation to use.oscillationPeriod
- sets time it takes for one complete oscillilationsummingType
- sets the way to add the returned oscillator value to the original delayfilterType
- sets which type of filter to use. Can be comb, allpass, or delay onlyamplitude
- sets level amplitude (ie sets the maximum 'peak' value and minimum 'trough' value) of
the waveform.delayOffset
- the size of the delay in samples. Used to calculate appropriate buffer sizechunked
- boolean value to indicate if the user is using chunked data. Used by process method to
choose suitable method.public void setFeedback(int feed)
feed
- the level of feedback. This value must be divided by 100 in order to be used, as the feedback factor
must be less than 1.public void setDelayOffset(float offset)
offset
- this is the size of the delay in samples. This is used to set the forward buffer when using chunks,
and also to calculate the size of the final output array.public void setChunked(boolean chunk)
chunk
- returns true if the user has indicated that chunked data is being used.public void setLFOType(java.lang.String lowfreqosc)
lowfreqosc
- the type of LFO waveform that is being used. At present can be triangular or sinusoidal, but more
LFO waveforms can be implemented in the future.public void setSummingType(java.lang.String summer)
summer
- the type of summing algorithm to be appliedpublic void setFilterType(java.lang.String filt)
filt
- the type of filter to create the delaypublic void setOscillationPeriod(int osc)
osc
- the size of the oscillation period in samples.public void setAmplitude(int amp)
amp
- the size if the amplitude of the LFOpublic short[] process(short[] input)
input
- short array containing the input data to be passed on to respective methodpublic short[] variProcess(short[] input)
input
- short array containing the input data to be passed on to respective methodpublic short[] variProcessChunked(short[] input)