Package net.oijon.algonquin.tts.trm
Class Tube
java.lang.Object
net.oijon.algonquin.tts.trm.Tube
- Author:
- N3ther
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfloat[][]Debug only, should not be used in production.intGets the length of the tube.doublegetLoss()Gets the current loss factor.intGets the sample rate the delay line is operating at.float[]out()Gets the current output of the delay line.voidpush(float pushAmount) Creates and manages a delay line.voidsetLoss(double loss) Sets the loss factor.float[][]Converts to 44.1 kHz by adding new data to follow the slope.
-
Constructor Details
-
Tube
public Tube(int length) Creates a tube based on it's length.- Parameters:
length- The length of the tube in cm.
-
-
Method Details
-
push
public void push(float pushAmount) Creates and manages a delay line. Needs work.- Parameters:
pushAmount- The input being added to the delay line.
-
standardize
public float[][] standardize()Converts to 44.1 kHz by adding new data to follow the slope. Needs work. I could very well be misunderstanding something about this in the paper by Manzara. If so, this method will probably be replaced.- Returns:
- The standardized delay line, can be turned into a .wav file.
-
out
public float[] out()Gets the current output of the delay line.- Returns:
-
getDelayLine
public float[][] getDelayLine()Debug only, should not be used in production. Returns the full array.- Returns:
- The delay line.
-
getLength
public int getLength()Gets the length of the tube.- Returns:
- The tube length in cm.
-
getSampleRate
public int getSampleRate()Gets the sample rate the delay line is operating at.- Returns:
- The sample rate in Hz
-
getLoss
public double getLoss()Gets the current loss factor. 1 == no loss, 0 == 100% loss per sample.- Returns:
- The loss factor.
-
setLoss
public void setLoss(double loss) Sets the loss factor. Debug only.- Parameters:
loss- The loss factor. 1 == no loss, 0 == 100% loss per sample.
-