public class SingleDelayEffect extends AudioEffect16Bit
SingleDelay
,
triana.audio.AudioEffect16bit
ADD, DO_NOTHING, MULTIPLY
Constructor and Description |
---|
SingleDelayEffect(int forwardMemSize,
int feedback,
java.lang.String filterType,
boolean chunked,
float delayInMs,
double sampleRate)
Creates an single delay effect using a feedback comb filter with a particular forward memory size.
|
Modifier and Type | Method and Description |
---|---|
short[] |
process(short[] input)
Process method calls appropriate singleDelayProcess or singleDelayProcessChunked method depending on the users
decision to use or not chunked data.
|
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.
|
short[] |
singleDelayProcess(short[] input)
Method for non chunked data.
|
short[] |
singleDelayProcessChunked(short[] input)
Method for chunked data.
|
getData, getStart, initialiseForward, initialiseForward, preProcess, setForwardMathOperation
public SingleDelayEffect(int forwardMemSize, int feedback, java.lang.String filterType, boolean chunked, float delayInMs, double 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.delayOffset
- the size of the delay in samples. Used to calculate appropriate buffer sizefilterType
- sets which type of filter to use. Can be Standard Feedforward Filter or delayed line onlychunked
- 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 setFilterType(java.lang.String filt)
filt
- the type of filter to create the delaypublic void setChunked(boolean chunk)
chunk
- returns true if the user has indicated that chunked data is being used.public short[] process(short[] input)
input
- short array containing the input data to be passed on to respective methodpublic short[] singleDelayProcess(short[] input)
input
- short array containing the input data to be manipulated by algorithmpublic short[] singleDelayProcessChunked(short[] input)
input
- short array containing the input data to be manipulated by algorithm