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);
}
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();
}
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);
}
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));
}
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);
}
Aggregations