Search in sources :

Example 1 with LaunchkeyMk3ControlSurface

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

the class LaunchkeyMk3ControllerSetup method createFaderModeButton.

private void createFaderModeButton(final ButtonID buttonID, final OutputID outputID, final String label, final Modes mode, final int modeIndex) {
    final LaunchkeyMk3ControlSurface surface = this.getSurface();
    final ModeSelectCommand<LaunchkeyMk3ControlSurface, LaunchkeyMk3Configuration> modeSelectCommand = new ModeSelectCommand<>(surface.getFaderModeManager(), this.model, surface, mode);
    this.addButton(surface, buttonID, label, (event, velocity) -> modeSelectCommand.executeNormal(event), 15, LaunchkeyMk3ControlSurface.LAUNCHKEY_FADER_SELECT, modeIndex, false, null);
    final IHwLight light = surface.createLight(outputID, () -> surface.getFaderModeManager().isActive(mode) ? ColorEx.BLUE : ColorEx.DARK_BLUE, color -> {
    // Intentionally empty
    });
    surface.getButton(buttonID).addLight(light);
}
Also used : LaunchkeyMk3ControlSurface(de.mossgrabers.controller.novation.launchkey.maxi.controller.LaunchkeyMk3ControlSurface) IHwLight(de.mossgrabers.framework.controller.hardware.IHwLight) ModeSelectCommand(de.mossgrabers.framework.command.trigger.mode.ModeSelectCommand)

Example 2 with LaunchkeyMk3ControlSurface

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

the class LaunchkeyMk3ControllerSetup method startup2.

/**
 * DAW mode is ready. Update all states on the device.
 */
private void startup2() {
    final LaunchkeyMk3ControlSurface surface = this.getSurface();
    // Sync modes to device
    final IMidiOutput midiOutput = surface.getMidiOutput();
    midiOutput.sendCCEx(15, LaunchkeyMk3ControlSurface.LAUNCHKEY_MODE_SELECT, LaunchkeyMk3ControlSurface.KNOB_MODE_PAN);
    midiOutput.sendCCEx(15, LaunchkeyMk3ControlSurface.LAUNCHKEY_FADER_SELECT, LaunchkeyMk3ControlSurface.FADER_MODE_VOLUME);
    // Flush display and LEDs
    surface.forceFlush();
}
Also used : IMidiOutput(de.mossgrabers.framework.daw.midi.IMidiOutput) LaunchkeyMk3ControlSurface(de.mossgrabers.controller.novation.launchkey.maxi.controller.LaunchkeyMk3ControlSurface)

Example 3 with LaunchkeyMk3ControlSurface

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

the class LaunchkeyMk3ControllerSetup method waitForConnection.

/**
 * Check if the DAW mode is ready in the Launchkey.
 */
private void waitForConnection() {
    final LaunchkeyMk3ControlSurface surface = this.getSurface();
    if (surface.isDAWConnected()) {
        this.startup2();
        return;
    }
    this.host.scheduleTask(this::waitForConnection, 200);
}
Also used : LaunchkeyMk3ControlSurface(de.mossgrabers.controller.novation.launchkey.maxi.controller.LaunchkeyMk3ControlSurface)

Example 4 with LaunchkeyMk3ControlSurface

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

the class LaunchkeyMk3ControllerSetup method createModes.

/**
 * {@inheritDoc}
 */
@Override
protected void createModes() {
    final LaunchkeyMk3ControlSurface surface = this.getSurface();
    final ModeManager modeManager = surface.getModeManager();
    modeManager.register(Modes.VOLUME, new LaunchkeyMk3VolumeMode(surface, this.model, AbstractMode.DEFAULT_KNOB_IDS));
    modeManager.register(Modes.PAN, new LaunchkeyMk3PanoramaMode(surface, this.model, AbstractMode.DEFAULT_KNOB_IDS));
    modeManager.register(Modes.SEND1, new LaunchkeyMk3SendMode(0, surface, this.model, AbstractMode.DEFAULT_KNOB_IDS));
    modeManager.register(Modes.SEND2, new LaunchkeyMk3SendMode(1, surface, this.model, AbstractMode.DEFAULT_KNOB_IDS));
    modeManager.register(Modes.DEVICE_PARAMS, new LaunchkeyMk3ParameterMode(surface, this.model, AbstractMode.DEFAULT_KNOB_IDS));
    // Layer send X IDs are used for custom modes
    modeManager.register(Modes.DEVICE_LAYER_SEND1, new CustomMode(1, surface, this.model));
    modeManager.register(Modes.DEVICE_LAYER_SEND2, new CustomMode(2, surface, this.model));
    modeManager.register(Modes.DEVICE_LAYER_SEND3, new CustomMode(3, surface, this.model));
    modeManager.register(Modes.DEVICE_LAYER_SEND4, new CustomMode(4, surface, this.model));
    final ModeManager faderModeManager = surface.getFaderModeManager();
    faderModeManager.register(Modes.DEVICE_PARAMS, new LaunchkeyMk3ParameterMode(surface, this.model, DEFAULT_FADER_IDS));
    faderModeManager.register(Modes.VOLUME, new LaunchkeyMk3VolumeMode(surface, this.model, DEFAULT_FADER_IDS));
    faderModeManager.register(Modes.SEND1, new LaunchkeyMk3SendMode(0, surface, this.model, DEFAULT_FADER_IDS));
    faderModeManager.register(Modes.SEND2, new LaunchkeyMk3SendMode(1, surface, this.model, DEFAULT_FADER_IDS));
    faderModeManager.register(Modes.DEVICE_LAYER_SEND1, new CustomMode(1, surface, this.model));
    faderModeManager.register(Modes.DEVICE_LAYER_SEND2, new CustomMode(2, surface, this.model));
    faderModeManager.register(Modes.DEVICE_LAYER_SEND3, new CustomMode(3, surface, this.model));
    faderModeManager.register(Modes.DEVICE_LAYER_SEND4, new CustomMode(4, surface, this.model));
}
Also used : CustomMode(de.mossgrabers.controller.novation.launchkey.maxi.mode.CustomMode) LaunchkeyMk3ControlSurface(de.mossgrabers.controller.novation.launchkey.maxi.controller.LaunchkeyMk3ControlSurface) LaunchkeyMk3ParameterMode(de.mossgrabers.controller.novation.launchkey.maxi.mode.LaunchkeyMk3ParameterMode) LaunchkeyMk3PanoramaMode(de.mossgrabers.controller.novation.launchkey.maxi.mode.LaunchkeyMk3PanoramaMode) LaunchkeyMk3SendMode(de.mossgrabers.controller.novation.launchkey.maxi.mode.LaunchkeyMk3SendMode) LaunchkeyMk3VolumeMode(de.mossgrabers.controller.novation.launchkey.maxi.mode.LaunchkeyMk3VolumeMode) ModeManager(de.mossgrabers.framework.featuregroup.ModeManager)

Example 5 with LaunchkeyMk3ControlSurface

use of de.mossgrabers.controller.novation.launchkey.maxi.controller.LaunchkeyMk3ControlSurface 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)11 IHwLight (de.mossgrabers.framework.controller.hardware.IHwLight)4 IMidiOutput (de.mossgrabers.framework.daw.midi.IMidiOutput)3 ModeSelectCommand (de.mossgrabers.framework.command.trigger.mode.ModeSelectCommand)2 IMidiInput (de.mossgrabers.framework.daw.midi.IMidiInput)2 ViewManager (de.mossgrabers.framework.featuregroup.ViewManager)2 ArrayList (java.util.ArrayList)2 ButtonAreaCommand (de.mossgrabers.controller.novation.launchkey.maxi.command.trigger.ButtonAreaCommand)1 DeviceLockCommand (de.mossgrabers.controller.novation.launchkey.maxi.command.trigger.DeviceLockCommand)1 LaunchkeyMk3PlayCommand (de.mossgrabers.controller.novation.launchkey.maxi.command.trigger.LaunchkeyMk3PlayCommand)1 LaunchkeyMk3Display (de.mossgrabers.controller.novation.launchkey.maxi.controller.LaunchkeyMk3Display)1 CustomMode (de.mossgrabers.controller.novation.launchkey.maxi.mode.CustomMode)1 LaunchkeyMk3PanoramaMode (de.mossgrabers.controller.novation.launchkey.maxi.mode.LaunchkeyMk3PanoramaMode)1 LaunchkeyMk3ParameterMode (de.mossgrabers.controller.novation.launchkey.maxi.mode.LaunchkeyMk3ParameterMode)1 LaunchkeyMk3SendMode (de.mossgrabers.controller.novation.launchkey.maxi.mode.LaunchkeyMk3SendMode)1 LaunchkeyMk3VolumeMode (de.mossgrabers.controller.novation.launchkey.maxi.mode.LaunchkeyMk3VolumeMode)1 BrowserView (de.mossgrabers.controller.novation.launchkey.maxi.view.BrowserView)1 DeviceConfigView (de.mossgrabers.controller.novation.launchkey.maxi.view.DeviceConfigView)1 DrumConfigView (de.mossgrabers.controller.novation.launchkey.maxi.view.DrumConfigView)1 DrumView (de.mossgrabers.controller.novation.launchkey.maxi.view.DrumView)1