Class PerformedJSynVoice

java.lang.Object
com.softsynth.jmsl.jsyn2.PerformedJSynVoice

public class PerformedJSynVoice
extends java.lang.Object
Bundle of data created by JSynUnitVoiceInstrument.on() and play() Used to track active voices so parameters updates can be applied instantly. All fields except offTime are set by ins.on(). offTime which is set by off() JSynUnitVoiceInstrument maintains a Vector of these, which can be consulted to retrieve voices active at a certain time
Author:
nick Didkovsky, (c) 2019 Nick Didkovsky, nick@didkovsky.com
  • Constructor Details

    • PerformedJSynVoice

      public PerformedJSynVoice​(int voiceToken, JSynUnitVoiceInstrument jSynUnitVoiceInstrument, double[] data, double onTime)
  • Method Details

    • getOffTime

      public double getOffTime()
      Returns:
      the offTime
    • setOffTime

      public void setOffTime​(double offTime)
      Parameters:
      offTime - the offTime to set
    • getVoiceToken

      public int getVoiceToken()
      Returns:
      the voiceToken
    • getjSynUnitVoiceInstrument

      public JSynUnitVoiceInstrument getjSynUnitVoiceInstrument()
      Returns:
      the jSynUnitVoiceInstrument
    • getData

      public double[] getData()
      Returns:
      the data
    • getOnTime

      public double getOnTime()
      Returns:
      the onTime
    • isActiveAt

      public boolean isActiveAt​(double playTime)
      test to see if this voice is active at this playTime. playTime >= onTime && (playTime < offTime || offTime == -1) Note that offTime == -1 means the voice is presumably still sustaining. off() hasn't been called yet
      Parameters:
      playTime -
      Returns: