Package org.jjazz.midi.api.synths
Class StandardInstrumentConverter
java.lang.Object
org.jjazz.midi.api.synths.StandardInstrumentConverter
Conversion methods between GM/GS/GM2/XG standard instruments.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic InstrumentconvertInstrument(Instrument srcIns, MidiSynth destSynth) Try to find the standard Instrument from destSynth which best matches srcIns.static InstrumentfindDrumsInstrument(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.
-
Constructor Details
-
StandardInstrumentConverter
public StandardInstrumentConverter()
-
-
Method Details
-
convertInstrument
Try to find the standard Instrument from destSynth which best matches srcIns.- Parameters:
srcIns- A standard instrument from a GM/GM2/XG/GS-compatible MidiSynthdestSynth- 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.
-