ixfx
    Preparing search index...

    Class MidiFighter

    Connects to a DJ Tech Tools Midi Fighter controller.

    Use the 'state' event and wait for state to be 'ready'.

    const mf = new MidiFighter();
    mf.addEventListener(`state`, event => {
    if (event.state === `ready`) {
    // Can work with device now
    mf.bank = 1;
    }
    });
    mf.addEventListener(`encoder`, event => {
    // Do something with encoder value
    });
    mf.setPort(someMidiInputPort);
    mf.setPort(someMidiOutputPort);

    Assumes default settings are loaded on the controller

    Supports

    • Listening for encoder moves and button presses
    • Changing colour pip below each encoder
    • Setting LED bar for each encoder
    • Changing banks, or detecting when the user has done so via the physical buttons

    Events:

    • bankChange: Current bank has changed
    • sideButton: Side button pressed
    • switch: Encoder has been pressed
    • encoder: Encoder has been moved
    • state: Midi Fighter has both input/output ports or not.

    Hierarchy (View Summary)

    Index

    Accessors

    Constructors

    Methods

    • Gets an encoder by its index and bank. If no bank is specified, the current is used.

      mf.getEncoder(4);    // Get encoder #4 on current bank
      mf.getEncoder(4, 2); // Get encoder #4 from bank #2

      Parameters

      • encoder: number

        Encoder number (1..16)

      • Optionalbank: number

        Bank number (1..4)

      Returns undefined | MidiFighterEncoder

      Encoder

    • Sets a port for this instance to use. This will need to be called separately for the input and output ports

      Parameters

      • port: MIDIPort

      Returns void

    Properties

    bankChangeChannel: number = 4

    Channel bank change events are received on

    encoders: MidiFighterEncoder[] = []
    logOutgoing: boolean = false

    If true, messages sent to Midi Fighter are printed to console

    sideButtonChannel: number = 4

    Channel side button press events are received on