Class WindowCache

java.lang.Object
net.paulhertz.pixelaudio.granular.WindowCache

public final class WindowCache extends Object
WindowCache Simple cache for windowFunction.generateCurve(length) results. Avoids recomputing window curves for the same (WindowFunction class, length) pairs. Implementation is thread-safe. For strict real-time safety, prewarm curves during setup, not from the audio thread.
  • Field Details

  • Constructor Details

    • WindowCache

      private WindowCache()
  • Method Details

    • prewarm

      public float[] prewarm(ddf.minim.analysis.WindowFunction wf, int length)
      Precompute and cache a window curve. Call this during setup, not from the audio thread.
    • getWindowCurve

      public float[] getWindowCurve(ddf.minim.analysis.WindowFunction wf, int length)
      Get a cached window curve for the given WindowFunction and length. If not cached, this will lazily generate it. For strict real-time safety, prefer calling prewarm(...) ahead of time.