Package net.paulhertz.pixelaudio.sampler

# Class SamplerBrushEvent

java.lang.Object
net.paulhertz.pixelaudio.sampler.SamplerBrushEvent

All Implemented Interfaces:
  `Comparable<SamplerBrushEvent>`

public class SamplerBrushEvent extends Object implements Comparable<SamplerBrushEvent>
Stores values used for SamplerBrush event staging, used in tutorial examples such as `TutorialOne_03_Drawing`. SamplerBrush objects implement AudioBrush and address the Sampler synthesis engine. A SamplerBrushEvent is a discrete audio synthesis process, complete with ADSR envelope.

There is no corresponding "GranularBrushEvent". Grains, which allow similar parametric control with the grain window equivalent to the ADSR envelope, are embedded in the audio synthesis process and hence are not discrete events.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `final int`
  `durationMs`
  event duration
  `final ADSRParams`
  `env`
  `final int`
  `eventTimeMs`
  time of event, typically a milliseconds offset from a trigger event
  `final float`
  `gain`
  `boolean`
  `isStale`
  `final float`
  `pan`
  `final float`
  `pitchRatio`
  `final int`
  `samplePos`
  audio buffer index, typically derived from event coordinates
  `final int`
  `x`
  x-coordinate associated with SamplerBrushEvent
  `final int`
  `y`
  y-coordinate associated with SamplerBrushEvent

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `SamplerBrushEvent(int x, int y, int eventTimeMs, int samplePos, int sampleLen, float gain, float pitchRatio, ADSRParams env, float pan)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `int`
  `compareTo(SamplerBrushEvent tl)`
  `int`
  `eventTimeMs()`
  `int`
  `getDurationMs()`
  `int`
  `getX()`
  `int`
  `getY()`
  `boolean`
  `isStale()`
  `void`
  `setStale(boolean stale)`

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

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

- ## Field Details

  - ### x

    public final int x
    x-coordinate associated with SamplerBrushEvent

  - ### y

    public final int y
    y-coordinate associated with SamplerBrushEvent

  - ### eventTimeMs

    public final int eventTimeMs
    time of event, typically a milliseconds offset from a trigger event

  - ### samplePos

    public final int samplePos
    audio buffer index, typically derived from event coordinates

  - ### durationMs

    public final int durationMs
    event duration

  - ### gain

    public final float gain

  - ### pitchRatio

    public final float pitchRatio

  - ### pan

    public final float pan

  - ### env

    public final ADSRParams env

  - ### isStale

    public boolean isStale

- ## Constructor Details

  - ### SamplerBrushEvent

    public SamplerBrushEvent(int x, int y, int eventTimeMs, int samplePos, int sampleLen, float gain, float pitchRatio, ADSRParams env, float pan)

- ## Method Details

  - ### getX

    public int getX()

  - ### getY

    public int getY()

  - ### eventTimeMs

    public int eventTimeMs()

  - ### isStale

    public boolean isStale()

  - ### setStale

    public void setStale(boolean stale)

  - ### getDurationMs

    public int getDurationMs()

  - ### compareTo

    public int compareTo(SamplerBrushEvent tl)
    Specified by:
      `compareTo` in interface `Comparable<SamplerBrushEvent>`