Class AudioColorTranscoder

java.lang.Object
net.paulhertz.pixelaudio.AudioColorTranscoder

public class AudioColorTranscoder extends Object
Experimental helper class for PixelAudioMapper and other classes or methods that transcode audio and color values. This is thread-safe but it does have to have all fields initialized in the constructor. It has not yet been used in any code and may be removed at a future date. // Standard 8-bit audio → color mapping AudioColorTranscoder defaultTranscoder = new AudioColorTranscoder(-1.0f, 1.0f, 0, 255); // High-resolution 16-bit color and 5V audio AudioColorTranscoder highResTranscoder = new AudioColorTranscoder(-2.5f, 2.5f, 0, 65535);
  • Field Details

    • minAudio

      private final float minAudio
    • maxAudio

      private final float maxAudio
    • minColor

      private final int minColor
    • maxColor

      private final int maxColor
  • Constructor Details

    • AudioColorTranscoder

      public AudioColorTranscoder(float minAudio, float maxAudio, int minColor, int maxColor)
  • Method Details

    • transcodeFloat

      public int transcodeFloat(float val)
    • transcodeInt

      public float transcodeInt(int val)
    • transcodeIntF

      public float transcodeIntF(float val)
    • clamp

      private static float clamp(float val, float min, float max)
    • clamp

      private static int clamp(int val, int min, int max)