Enum Class InstrumentFamily

java.lang.Object
java.lang.Enum<InstrumentFamily>
org.jjazz.midi.api.synths.InstrumentFamily
All Implemented Interfaces:
Serializable, Comparable<InstrumentFamily>, Constable

public enum InstrumentFamily extends Enum<InstrumentFamily>
A family of similar instruments.

Based on the GM1 Standard: the values respect the order of the GM1 instruments, each family has 8 instruments in the GM1 bank.

  • Enum Constant Details

  • Method Details

    • values

      public static InstrumentFamily[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static InstrumentFamily valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getShortName

      public String getShortName()
      A 5 chars max. string.
      Returns:
    • toAbsolutePitch

      public int toAbsolutePitch(int relPitch)
      Get an appropriate absolute pitch corresponding to relPitch for this instrument family.

      E.g. for a BASS instrument pick the lowest note from E1.

      Parameters:
      relPitch -
      Returns:
    • toString

      public String toString()
      Overrides:
      toString in class Enum<InstrumentFamily>
    • getFirstProgramChange

      public int getFirstProgramChange()
      The GM1 ProgramChange of the first instrument which belongs to this family.
      Returns:
    • guessFamily

      public static InstrumentFamily guessFamily(String patchName)
      Try to guess the family from patchName.

      E.g. if patchName contains "piano", family is Piano.

      Parameters:
      patchName -
      Returns:
    • couldBeDrums

      public static boolean couldBeDrums(String patchName)
      Try to guess if patchName represents a drums/percussio patch.
      Parameters:
      patchName -
      Returns: