Class Tube

java.lang.Object
net.oijon.algonquin.tts.trm.Tube

public class Tube extends Object
Author:
N3ther
  • Constructor Summary

    Constructors
    Constructor
    Description
    Tube(int length)
    Creates a tube based on it's length.
  • Method Summary

    Modifier and Type
    Method
    Description
    float[][]
    Debug only, should not be used in production.
    int
    Gets the length of the tube.
    double
    Gets the current loss factor.
    int
    Gets the sample rate the delay line is operating at.
    float[]
    out()
    Gets the current output of the delay line.
    void
    push(float pushAmount)
    Creates and manages a delay line.
    void
    setLoss(double loss)
    Sets the loss factor.
    float[][]
    Converts to 44.1 kHz by adding new data to follow the slope.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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.