Class OutputSynth

java.lang.Object
org.jjazz.outputsynth.api.OutputSynth
Direct Known Subclasses:
OS_YamahaRef

public class OutputSynth extends Object
An OutputSynth describes the capabilities of the synth connected to an output Midi device.

It is made of a MidiSynth and UserSettings.

  • Constructor Details

    • OutputSynth

      public OutputSynth(MidiSynth mSynth)
      Construct an OutputSynth with the specified midiSynth and default UserSettings.

      Parameters:
      mSynth -
  • Method Details

    • clone

      public OutputSynth clone()
      Get a copy.

      Copy will use to the same MidiSynth instance, but UserSettings will be duplicated.

      Returns:
    • getMidiSynth

      public MidiSynth getMidiSynth()
      Get the MidiSynth of this OutputSynth.
      Returns:
    • getUserSettings

      public OutputSynth.UserSettings getUserSettings()
      Get the UserSettings of this OutputSynth.
      Returns:
    • findInstrument

      public Instrument findInstrument(RhythmVoice rv)
      Find an instrument from this OutputSynth matching (as much as possible) the specified rhythm voice's preferred instrument.

      Parameters:
      rv -
      Returns:
      Can't be null. It may be the VoidInstrument for drums/percussion.
    • getNeedFixInstruments

      public HashMap<Integer,Instrument> getNeedFixInstruments(MidiMix mm)
      Get the instruments that should be used in the specified MidiMix to make it consistent with this OutputSynth.

      Parameters:
      mm -
      Returns:
      The channels which need to be fixed and the associated new instrument. Can't be null but returned HashMap can be empty.
      See Also:
      • #fixInstruments(org.jjazz.midimix.api.MidiMix)
    • fixInstruments

      public void fixInstruments(MidiMix mm, boolean fixDrumsRerouting)
      Fix the specified MidiMix so that it uses instruments from this OutputSynth.
      Parameters:
      mm -
      fixDrumsRerouting - If true also try to fix the drums rerouting status of each channel
      See Also:
    • saveAsString

      public String saveAsString()
      Save this OutputSynth as a string so that it can be retrieved by loadFromString().

      If a

      Returns:
      See Also:
    • loadFromString

      public static OutputSynth loadFromString(String s) throws IOException
      Get an OutputSynth corresponding to the string produced by saveAsString().

      Parameters:
      s -
      Returns:
      Throws:
      IOException
      See Also:
    • toString

      public String toString()
      Overrides:
      toString in class Object