Class LXMidiTemplate

java.lang.Object
heronarts.lx.LXComponent
heronarts.lx.midi.template.LXMidiTemplate
All Implemented Interfaces:
LXComponent.Renamable, LXPath, LXSerializable, LXMidiListener, LXParameterListener
Direct Known Subclasses:
AkaiMidiMix, AkaiMPD218, DJTTMidiFighterTwister, NovationLaunchkeyMk337

public abstract class LXMidiTemplate extends LXComponent implements LXComponent.Renamable, LXMidiListener
A MIDI template is a component that holds parameters for a known MIDI device, which does not implement a full MIDI surface implementation, but rather just exposes those parameters for modulation mapping via the UI.
  • Field Details

  • Constructor Details

    • LXMidiTemplate

      protected LXMidiTemplate(LX lx)
  • Method Details

    • getIndex

      public int getIndex()
    • getPath

      public String getPath()
      Description copied from class: LXComponent
      Accessor for the path of this object. Returns the path this component was registered with. Some subclasses may override this if path structure is dynamic.
      Specified by:
      getPath in interface LXPath
      Overrides:
      getPath in class LXComponent
      Returns:
      path of this component relative to its parent
    • initializeDefaultIO

      public LXMidiTemplate initializeDefaultIO()
    • getTemplateName

      public String getTemplateName()
    • getTemplateName

      public static String getTemplateName(Class<? extends LXMidiTemplate> templateClass)
    • initializeOutput

      protected void initializeOutput()
      Subclasses should override this to initialize output values in the case where device synchronization is needed
    • onParameterChanged

      public void onParameterChanged(LXParameter p)
      Description copied from class: LXComponent
      Subclasses are free to override this if desired. It will automatically fire for any listenable parameter that is registered with this component.
      Specified by:
      onParameterChanged in interface LXParameterListener
      Overrides:
      onParameterChanged in class LXComponent
      Parameters:
      p - Parameter that has a value change
    • sendNoteOn

      protected void sendNoteOn(int channel, int note, int velocity)
    • sendControlChange

      protected void sendControlChange(int channel, int cc, int value)
    • sendSysex

      protected void sendSysex(byte[] sysex)
    • dispose

      public void dispose()
      Description copied from class: LXComponent
      Invoked when a component is being removed from the system and will no longer be used at all. This unregisters the component and should free up any resources and parameter listeners. Ideally after this method is called the object should be eligible for garbage collection. Subclasses are generally expected to override this method to handle their particular cleanup work. They should also generally call super.dispose() at the appropriate time to perform the basic cleanup, which may need to happen either before or after cleaning up other objects.
      Overrides:
      dispose in class LXComponent