use of de.mossgrabers.controller.novation.launchkey.mini.controller.LaunchkeyMiniMk3ControlSurface in project DrivenByMoss by git-moss.
the class LaunchkeyMiniMk3ControllerSetup method startup.
/**
* {@inheritDoc}
*/
@Override
public void startup() {
final LaunchkeyMiniMk3ControlSurface surface = this.getSurface();
surface.setLaunchpadToDAW(true);
surface.getPadGrid().setView(Views.SESSION);
surface.getViewManager().setActive(Views.SESSION);
surface.getModeManager().setActive(Modes.VOLUME);
surface.setKnobMode(LaunchkeyMiniMk3ControlSurface.KNOB_MODE_VOLUME);
surface.setPadMode(LaunchkeyMiniMk3ControlSurface.PAD_MODE_SESSION);
}
use of de.mossgrabers.controller.novation.launchkey.mini.controller.LaunchkeyMiniMk3ControlSurface in project DrivenByMoss by git-moss.
the class LaunchkeyMiniMk3ControllerSetup method registerContinuousCommands.
/**
* {@inheritDoc}
*/
@Override
protected void registerContinuousCommands() {
final LaunchkeyMiniMk3ControlSurface surface = this.getSurface();
for (int i = 0; i < 8; i++) {
this.addAbsoluteKnob(ContinuousID.get(ContinuousID.KNOB1, i), "Knob " + (i + 1), null, BindType.CC, 15, LaunchkeyMiniMk3ControlSurface.LAUNCHKEY_KNOB_1 + i).setIndexInGroup(i);
// Knobs in user mode send on the keys input on MIDI channel 1 (instead of 16), command
// is not needed since it is mapped to IParameter when user mode is activated
final IHwAbsoluteKnob userKnob = surface.createAbsoluteKnob(ContinuousID.get(ContinuousID.DEVICE_KNOB1, i), "User Knob " + (i + 1));
userKnob.bind(this.inputKeys, BindType.CC, 0, LaunchkeyMiniMk3ControlSurface.LAUNCHKEY_KNOB_1 + i);
userKnob.setIndexInGroup(i);
}
}
use of de.mossgrabers.controller.novation.launchkey.mini.controller.LaunchkeyMiniMk3ControlSurface in project DrivenByMoss by git-moss.
the class LaunchkeyMiniMk3ControllerSetup method registerTriggerCommands.
/**
* {@inheritDoc}
*/
@Override
protected void registerTriggerCommands() {
final LaunchkeyMiniMk3ControlSurface surface = this.getSurface();
final ITransport t = this.model.getTransport();
final ViewManager viewManager = surface.getViewManager();
this.addButton(ButtonID.SHIFT, "Shift", NopCommand.INSTANCE, LaunchkeyMiniMk3ControlSurface.LAUNCHKEY_SHIFT);
this.addButton(ButtonID.PLAY, "Play", new PlayCommand<>(this.model, surface), 15, LaunchkeyMiniMk3ControlSurface.LAUNCHKEY_PLAY, t::isPlaying);
final ConfiguredRecordCommand<LaunchkeyMiniMk3ControlSurface, LaunchkeyMiniMk3Configuration> recordCommand = new ConfiguredRecordCommand<>(this.model, surface);
this.addButton(ButtonID.RECORD, "Record", recordCommand, 15, LaunchkeyMiniMk3ControlSurface.LAUNCHKEY_RECORD, recordCommand::isLit);
final ModeCursorCommand<LaunchkeyMiniMk3ControlSurface, LaunchkeyMiniMk3Configuration> leftCommand = new ModeCursorCommand<>(Direction.LEFT, this.model, surface, true);
this.addButton(ButtonID.MOVE_TRACK_LEFT, "Previous", leftCommand, 15, LaunchkeyMiniMk3ControlSurface.LAUNCHKEY_LEFT, leftCommand::canScroll);
final ModeCursorCommand<LaunchkeyMiniMk3ControlSurface, LaunchkeyMiniMk3Configuration> rightCommand = new ModeCursorCommand<>(Direction.RIGHT, this.model, surface, true);
this.addButton(ButtonID.MOVE_TRACK_RIGHT, "Next", rightCommand, 15, LaunchkeyMiniMk3ControlSurface.LAUNCHKEY_RIGHT, rightCommand::canScroll);
// Scene buttons
this.addButton(ButtonID.SCENE1, "Scene 1", new ViewButtonCommand<>(ButtonID.SCENE1, surface), LaunchkeyMiniMk3ControlSurface.LAUNCHKEY_SCENE1, new FeatureGroupButtonColorSupplier(viewManager, ButtonID.SCENE1));
this.addButton(ButtonID.SCENE2, "Scene 2", new ViewButtonCommand<>(ButtonID.SCENE2, surface), LaunchkeyMiniMk3ControlSurface.LAUNCHKEY_SCENE2, new FeatureGroupButtonColorSupplier(viewManager, ButtonID.SCENE2));
// View selection with Pads in Shift mode
this.createViewButton(ButtonID.ROW2_1, OutputID.LED_RING1, "Session", Views.SESSION, LaunchkeyMiniMk3ControlSurface.PAD_MODE_SESSION);
this.createViewButton(ButtonID.ROW2_2, OutputID.LED_RING2, "Drum", Views.DRUM, LaunchkeyMiniMk3ControlSurface.PAD_MODE_DRUM);
this.createViewButton(ButtonID.ROW2_3, OutputID.LED_RING3, "Custom", Views.PLAY, LaunchkeyMiniMk3ControlSurface.PAD_MODE_CUSTOM);
// Knob mode selection with Pads in Shift mode
this.createModeButton(ButtonID.ROW1_1, OutputID.LED1, "Device", Modes.DEVICE_PARAMS, LaunchkeyMiniMk3ControlSurface.KNOB_MODE_PARAMS);
this.createModeButton(ButtonID.ROW1_2, OutputID.LED2, "Volume", Modes.VOLUME, LaunchkeyMiniMk3ControlSurface.KNOB_MODE_VOLUME);
this.createModeButton(ButtonID.ROW1_3, OutputID.LED3, "Pan", Modes.PAN, LaunchkeyMiniMk3ControlSurface.KNOB_MODE_PAN);
this.createModeButton(ButtonID.ROW1_4, OutputID.LED4, "Send 1", Modes.SEND1, LaunchkeyMiniMk3ControlSurface.KNOB_MODE_SEND1);
this.createModeButton(ButtonID.ROW1_5, OutputID.LED5, "Send 2", Modes.SEND2, LaunchkeyMiniMk3ControlSurface.KNOB_MODE_SEND2);
this.createModeButton(ButtonID.ROW1_6, OutputID.LED6, "Custom", Modes.USER, LaunchkeyMiniMk3ControlSurface.KNOB_MODE_CUSTOM);
// Online state
this.addButton(ButtonID.CONTROL, "DAW Online", (event, velocity) -> surface.setDAWConnected(velocity > 0), 15, LaunchkeyMiniMk3ControlSurface.LAUNCHKEY_DAW_ONLINE, surface::isDAWConnected);
}
use of de.mossgrabers.controller.novation.launchkey.mini.controller.LaunchkeyMiniMk3ControlSurface in project DrivenByMoss by git-moss.
the class LaunchkeyMiniMk3ControllerSetup method createViews.
/**
* {@inheritDoc}
*/
@Override
protected void createViews() {
final LaunchkeyMiniMk3ControlSurface surface = this.getSurface();
final ViewManager viewManager = surface.getViewManager();
viewManager.register(Views.SESSION, new SessionView(surface, this.model));
viewManager.register(Views.CONTROL, new PadModeSelectView(surface, this.model));
viewManager.register(Views.DRUM, new DrumView(surface, this.model));
viewManager.register(Views.PLAY, new UserPadView(surface, this.model));
viewManager.register(Views.SHIFT, new DrumConfigView(surface, this.model));
}
use of de.mossgrabers.controller.novation.launchkey.mini.controller.LaunchkeyMiniMk3ControlSurface in project DrivenByMoss by git-moss.
the class LaunchkeyMiniMk3ControllerSetup method createModes.
/**
* {@inheritDoc}
*/
@Override
protected void createModes() {
final LaunchkeyMiniMk3ControlSurface surface = this.getSurface();
final ModeManager modeManager = surface.getModeManager();
final BooleanSupplier offSupplier = () -> false;
modeManager.register(Modes.VOLUME, new TrackVolumeMode<>(surface, this.model, true, AbstractMode.DEFAULT_KNOB_IDS, offSupplier));
modeManager.register(Modes.PAN, new TrackPanMode<>(surface, this.model, true, AbstractMode.DEFAULT_KNOB_IDS, offSupplier));
modeManager.register(Modes.SEND1, new TrackSendMode<>(0, surface, this.model, true, AbstractMode.DEFAULT_KNOB_IDS, offSupplier));
modeManager.register(Modes.SEND2, new TrackSendMode<>(1, surface, this.model, true, AbstractMode.DEFAULT_KNOB_IDS, offSupplier));
modeManager.register(Modes.DEVICE_PARAMS, new ParameterMode<>(surface, this.model, true, AbstractMode.DEFAULT_KNOB_IDS, offSupplier));
modeManager.register(Modes.USER, new UserMode<>(surface, this.model, true, ContinuousID.createSequentialList(ContinuousID.DEVICE_KNOB1, 8), offSupplier));
}
Aggregations