Package voltage.core

# Class SamplerVoice

java.lang.Object
voltage.core.SamplerVoice

public class SamplerVoice extends Object
A sampler voice with pitch and filter modulation.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `SamplerVoice()`
  Constructor

- ## Method Summary

  Modifier and Type
  Method
  Description
  `int`
  `GetNote()`
  Get the note value of this SamplerVoice.
  `SamplerVoiceProgram`
  `GetProgram()`
  Gets the sampler program used with this voice.
  `boolean`
  `IsPlaying()`
  Is the note playing?
  `void`
  `NoteOff()`
  Stops the note if playing.
  `void`
  `NoteOn(SamplerVoiceProgram program, int noteNumber, int velocity)`
  Starts a note on with the specified program.
  `void`
  `ProcessSamples(double[] stereoBuffer)`
  Process a stereo buffer.
  `void`
  `Reset()`
  Reset the SamplerVoice
  `void`
  `SetFilterModulation(double filterMod)`
  Sets the filter modulation for this voice.
  `void`
  `SetPitchModulation(double pitchMod)`
  Sets the pitch modulation for this voice.

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

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

- ## Constructor Details

  - ### SamplerVoice

    public SamplerVoice()
    Constructor

- ## Method Details

  - ### NoteOn

    public void NoteOn(SamplerVoiceProgram program, int noteNumber, int velocity)
    Starts a note on with the specified program.
    Parameters:
      `program` - the sampler voice program.
      `noteNumber` - a note from 0 to 127.
      `velocity` - a MIDI velocity from 1 to 127.

  - ### NoteOff

    public void NoteOff()
    Stops the note if playing.

  - ### IsPlaying

    public boolean IsPlaying()
    Is the note playing?
    Returns:
      true if playing.

  - ### GetNote

    public int GetNote()
    Get the note value of this SamplerVoice.
    Returns:
      the note value from 0-127

  - ### GetProgram

    public SamplerVoiceProgram GetProgram()
    Gets the sampler program used with this voice.
    Returns:
      the sampler voice program.

  - ### SetPitchModulation

    public void SetPitchModulation(double pitchMod)
    Sets the pitch modulation for this voice.
    Parameters:
      `pitchMod` - the amount from -5.0 to 5.0

  - ### SetFilterModulation

    public void SetFilterModulation(double filterMod)
    Sets the filter modulation for this voice.
    Parameters:
      `filterMod` - the amount from -5.0 to 5.0

  - ### Reset

    public void Reset()
    Reset the SamplerVoice

  - ### ProcessSamples

    public void ProcessSamples(double[] stereoBuffer)
    Process a stereo buffer.
    Parameters:
      `stereoBuffer` - the input stereo buffer. stereoBuffer[0] is the left channel and stereoBuffer[1] is the right channel.