Package net.paulhertz.pixelaudio

# 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 Summary

  Fields
  Modifier and Type
  Field
  Description
  `private final float`
  `maxAudio`
  `private final int`
  `maxColor`
  `private final float`
  `minAudio`
  `private final int`
  `minColor`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `AudioColorTranscoder(float minAudio, float maxAudio, int minColor, int maxColor)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `private static float`
  `clamp(float val, float min, float max)`
  `private static int`
  `clamp(int val, int min, int max)`
  `int`
  `transcodeFloat(float val)`
  `float`
  `transcodeInt(int val)`
  `float`
  `transcodeIntF(float val)`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## 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)