Class GestureScheduleBuilder

java.lang.Object
net.paulhertz.pixelaudio.schedule.GestureScheduleBuilder

public final class GestureScheduleBuilder extends Object
Build schedules for classes that implement PAGesture or use PAGesture implementers, for example to build, interpolate, and warp time and point lists.
  • Constructor Details

    • GestureScheduleBuilder

      public GestureScheduleBuilder()
  • Method Details

    • build

      public GestureSchedule build(PACurveMaker brush, GestureGranularConfig cfg, float sampleRate)
      Builds a gesture schedule from a curve and granular playback configuration.
      Parameters:
      brush - source gesture curve
      cfg - schedule-building configuration
      sampleRate - audio sample rate in Hz
      Returns:
      generated gesture schedule
    • getBaseSchedule

      private GestureSchedule getBaseSchedule(PACurveMaker brush, GestureGranularConfig cfg)
    • toFixedHopScheduleMs

      private static GestureSchedule toFixedHopScheduleMs(GestureSchedule in, int hopSamples, float sampleRate)
    • resampleToCount

      private static GestureSchedule resampleToCount(GestureSchedule in, int count)
    • lerpPointByU

      private static processing.core.PVector lerpPointByU(List<processing.core.PVector> pts, float[] u, float uk)
    • lerpFloatByU

      private static float lerpFloatByU(float[] a, float[] u, float uk)
    • findSegment

      private static int findSegment(float[] u, float uk)
    • scaleToDurationMs

      private static GestureSchedule scaleToDurationMs(GestureSchedule in, int targetDurationMs)
    • warpScheduleTimesMs

      private static GestureSchedule warpScheduleTimesMs(GestureSchedule in, GestureGranularConfig.WarpShape shape, float exponent)
    • warpU

      private static float warpU(float u, GestureGranularConfig.WarpShape shape, float exponent)
    • easeInOutPow

      static float easeInOutPow(float u, float exp)
    • constrain01

      static float constrain01(float u)