Search in sources :

Example 1 with LaunchkeyMk3Display

use of de.mossgrabers.controller.novation.launchkey.maxi.controller.LaunchkeyMk3Display in project DrivenByMoss by git-moss.

the class LaunchkeyMk3ControllerSetup method createSurface.

/**
 * {@inheritDoc}
 */
@Override
protected void createSurface() {
    final IMidiAccess midiAccess = this.factory.createMidiAccess();
    final IMidiOutput output = midiAccess.createOutput();
    // A bit tricky to exclude only channel 16...
    final List<String> filters = new ArrayList<>();
    for (int i = 0; i < 15; i++) {
        filters.add(StringUtils.toHexStr(0x80 + i) + "????");
        filters.add(StringUtils.toHexStr(0x90 + i) + "????");
    }
    final IMidiInput input = midiAccess.createInput("Pads", filters.toArray(new String[filters.size()]));
    final IMidiInput inputKeys = midiAccess.createInput(1, "Keyboard", "8?????", /* Note off */
    "9?????", /* Note on */
    "A?????", /* Polyphonic After-touch */
    "B?01??", /* Modulation */
    "C?????", /* Program change */
    "B?40??", /* Sustain pedal */
    "D?????", /* Channel After-touch */
    "E?????");
    final LaunchkeyMk3ControlSurface surface = new LaunchkeyMk3ControlSurface(this.host, this.colorManager, this.configuration, output, input);
    this.surfaces.add(surface);
    surface.addTextDisplay(new LaunchkeyMk3Display(this.host, output));
    surface.addPianoKeyboard(25, inputKeys, true);
}
Also used : IMidiAccess(de.mossgrabers.framework.daw.midi.IMidiAccess) IMidiOutput(de.mossgrabers.framework.daw.midi.IMidiOutput) LaunchkeyMk3ControlSurface(de.mossgrabers.controller.novation.launchkey.maxi.controller.LaunchkeyMk3ControlSurface) LaunchkeyMk3Display(de.mossgrabers.controller.novation.launchkey.maxi.controller.LaunchkeyMk3Display) IMidiInput(de.mossgrabers.framework.daw.midi.IMidiInput) ArrayList(java.util.ArrayList)

Aggregations

LaunchkeyMk3ControlSurface (de.mossgrabers.controller.novation.launchkey.maxi.controller.LaunchkeyMk3ControlSurface)1 LaunchkeyMk3Display (de.mossgrabers.controller.novation.launchkey.maxi.controller.LaunchkeyMk3Display)1 IMidiAccess (de.mossgrabers.framework.daw.midi.IMidiAccess)1 IMidiInput (de.mossgrabers.framework.daw.midi.IMidiInput)1 IMidiOutput (de.mossgrabers.framework.daw.midi.IMidiOutput)1 ArrayList (java.util.ArrayList)1