Class InstrumentMix

java.lang.Object
org.jjazz.midi.api.InstrumentMix
All Implemented Interfaces:
Serializable

public class InstrumentMix extends Object implements Serializable
An Instrument with its InstrumentSettings.

Manage the Mute/Solo status: Mute ON turns Solo OFF and inversely.

See Also:
  • Field Details

  • Constructor Details

    • InstrumentMix

      public InstrumentMix(Instrument instrument, InstrumentSettings settings)
    • InstrumentMix

      public InstrumentMix(InstrumentMix im)
      Create a copy of specified InstrumentMix.

      Instrument is directly reused. InstrumentSettings are deeply copied.

      Parameters:
      im -
  • Method Details

    • getInstrument

      public Instrument getInstrument()
      Get the instrument.
      Returns:
      Can't be null.
    • setInstrument

      public final void setInstrument(Instrument instrument)
      Set the instrument.
      Parameters:
      instrument - Can't be null.
    • getSettings

      public InstrumentSettings getSettings()
      Returns:
      the settings
    • setInstrumentEnabled

      public final void setInstrumentEnabled(boolean b)
      Enable or disable the instrument setting.
    • isInstrumentEnabled

      public boolean isInstrumentEnabled()
    • setMute

      public final void setMute(boolean mute)
      Parameters:
      mute - If true also switch off the Solo status
    • getAllMidiMessages

      public MidiMessage[] getAllMidiMessages(int channel)
      Get all the midi messages to initialize this InstrumentMix: bank/program change, volume, reverb, chorus, pan.

      No message returned for disabled parameters.

      Parameters:
      channel -
      Returns:
    • getInstrumentMidiMessages

      public MidiMessage[] getInstrumentMidiMessages(int channel)
      Get only the Midi messages to be sent to initialize the instrument (patch/bank changes).

      If instrument is not enabled return an empty array.

      Parameters:
      channel -
      Returns:
    • isSolo

      public boolean isSolo()
      Returns:
      the solo
    • setSolo

      public final void setSolo(boolean solo)
      Parameters:
      solo - If true also switch off the Mute status
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • addPropertyChangeListener

      public void addPropertyChangeListener(PropertyChangeListener l)
    • removePropertyChangeListener

      public void removePropertyChangeListener(PropertyChangeListener l)
    • isMute

      public boolean isMute()
      Returns:
      the mute