Class StandardInstrumentConverter

java.lang.Object
org.jjazz.midi.api.synths.StandardInstrumentConverter

public class StandardInstrumentConverter extends Object
Conversion methods between GM/GS/GM2/XG standard instruments.
  • Constructor Details

    • StandardInstrumentConverter

      public StandardInstrumentConverter()
  • Method Details

    • convertInstrument

      public static Instrument convertInstrument(Instrument srcIns, MidiSynth destSynth)
      Try to find the standard Instrument from destSynth which best matches srcIns.

      Parameters:
      srcIns - A standard instrument from a GM/GM2/XG/GS-compatible MidiSynth
      destSynth - Should be GM/GM2/XG/GS-compatible
      Returns:
      A GM/GM2/XG/GS standard instrument from destSynth. Null if destSynth is not GM/GM2/XG/GS-compatible, or if srcIns is not a standard instrument.
    • findDrumsInstrument

      public static Instrument findDrumsInstrument(DrumKit srcKit, MidiSynth midiSynth, boolean tryHarder)
      Try to find a GM2/XG/GS/drums percussion instrument from midiSynth which match, as much as possible, srcKit.

      Parameters:
      srcKit -
      midiSynth - Can't be null. Should be GM2/XG/GS compatible.
      tryHarder - If initial search did not yield any instrument, try again with a more flexible matching scheme.
      Returns:
      Can be null.