Class JSynMusicDevice

java.lang.Object
com.softsynth.jmsl.jsyn2.JSynMusicDevice
All Implemented Interfaces:
Editable, MusicDevice

public class JSynMusicDevice
extends java.lang.Object
implements MusicDevice
MusicDevice for pure Java JSyn. Singleton, use JSynMusicDevice.instance(), since constructor is not public Use this device to convert from JMSL time to JSyn time stamps, instead of using JMSL.clock
Author:
Nick Didkovsky, email: nick@didkovsky.com, (c) 2012 Nick Didkovsky, all rights reserved.
  • Method Details

    • instance

      public static JSynMusicDevice instance()
    • getSynthesizer

      public com.jsyn.Synthesizer getSynthesizer()
    • add

      public void add​(com.jsyn.unitgen.UnitGenerator ugen)
    • remove

      public void remove​(com.jsyn.unitgen.UnitGenerator ugen)
    • jmslTimeToJSynTime

      public double jmslTimeToJSynTime​(double playTime)
    • setFrameRate

      public void setFrameRate​(int frameRate)
      Defaults to 44100
      See Also:
      Synth
    • getFrameRate

      public int getFrameRate()
    • getNumInputChannels

      public int getNumInputChannels()
      Returns:
      the numInputChannels
    • setNumInputChannels

      public void setNumInputChannels​(int numInputChannels)
      set to 0 to disable input, important for unsigned Applets!
      Parameters:
      numInputChannels - the numInputChannels to set
    • getNumOutputChannels

      public int getNumOutputChannels()
      Returns:
      the numOutputChannels
    • setNumOutputChannels

      public void setNumOutputChannels​(int numOutputChannels)
      Parameters:
      numOutputChannels - the numOutputChannels to set
    • getSynthVersion

      public static int getSynthVersion()
    • open

      public final boolean open()
      Specified by:
      open in interface MusicDevice
    • close

      public boolean close()
      Specified by:
      close in interface MusicDevice
    • addEditListener

      public void addEditListener​(EditListener listener)
      unimplemented
      Specified by:
      addEditListener in interface Editable
    • removeEditListener

      public void removeEditListener​(EditListener listener)
      unimplemented
      Specified by:
      removeEditListener in interface Editable
    • edit

      public void edit​(java.awt.Frame f)
      Description copied from interface: Editable
      Bring up a Dialog for editing, for example
      Specified by:
      edit in interface Editable
    • getSuggestedOutputLatency

      public double getSuggestedOutputLatency()
    • setSuggestedOutputLatency

      public void setSuggestedOutputLatency​(double suggestedOutputLatency)
    • setEditEnabled

      public void setEditEnabled​(boolean flag)
      Description copied from interface: Editable
      Set a flag. For example you might setEditEnabled(false) after first edit(), or you might hard code values for some Editable class and so want to disable editing.
      Specified by:
      setEditEnabled in interface Editable
    • getEditEnabled

      public boolean getEditEnabled()
      Specified by:
      getEditEnabled in interface Editable
      Returns:
      flag
    • getInputDeviceID

      public int getInputDeviceID()
      Returns:
      Returns the inputDeviceID.
    • setInputDeviceID

      public void setInputDeviceID​(int inputDeviceID)
      Parameters:
      inputDeviceID - The inputDeviceID to set.
    • getOutputDeviceID

      public int getOutputDeviceID()
      Returns:
      Returns the outputDeviceID.
    • setOutputDeviceID

      public void setOutputDeviceID​(int outputDeviceID)
      Parameters:
      outputDeviceID - The outputDeviceID to set.
    • main

      public static void main​(java.lang.String[] args)