Search in sources :

Example 1 with LaunchkeyMiniMk3ControlSurface

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);
}
Also used : LaunchkeyMiniMk3ControlSurface(de.mossgrabers.controller.novation.launchkey.mini.controller.LaunchkeyMiniMk3ControlSurface)

Example 2 with LaunchkeyMiniMk3ControlSurface

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);
    }
}
Also used : LaunchkeyMiniMk3ControlSurface(de.mossgrabers.controller.novation.launchkey.mini.controller.LaunchkeyMiniMk3ControlSurface) IHwAbsoluteKnob(de.mossgrabers.framework.controller.hardware.IHwAbsoluteKnob)

Example 3 with LaunchkeyMiniMk3ControlSurface

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);
}
Also used : ITransport(de.mossgrabers.framework.daw.ITransport) LaunchkeyMiniMk3ControlSurface(de.mossgrabers.controller.novation.launchkey.mini.controller.LaunchkeyMiniMk3ControlSurface) ViewManager(de.mossgrabers.framework.featuregroup.ViewManager) ConfiguredRecordCommand(de.mossgrabers.framework.command.trigger.transport.ConfiguredRecordCommand) IMidiInput(de.mossgrabers.framework.daw.midi.IMidiInput) ITransport(de.mossgrabers.framework.daw.ITransport) IHost(de.mossgrabers.framework.daw.IHost) IHwLight(de.mossgrabers.framework.controller.hardware.IHwLight) IMidiOutput(de.mossgrabers.framework.daw.midi.IMidiOutput) ModeCursorCommand(de.mossgrabers.framework.command.trigger.mode.ModeCursorCommand) FeatureGroupButtonColorSupplier(de.mossgrabers.framework.command.trigger.view.FeatureGroupButtonColorSupplier)

Example 4 with LaunchkeyMiniMk3ControlSurface

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));
}
Also used : PadModeSelectView(de.mossgrabers.controller.novation.launchkey.mini.view.PadModeSelectView) LaunchkeyMiniMk3ControlSurface(de.mossgrabers.controller.novation.launchkey.mini.controller.LaunchkeyMiniMk3ControlSurface) ViewManager(de.mossgrabers.framework.featuregroup.ViewManager) SessionView(de.mossgrabers.controller.novation.launchkey.mini.view.SessionView) UserPadView(de.mossgrabers.controller.novation.launchkey.mini.view.UserPadView) DrumConfigView(de.mossgrabers.controller.novation.launchkey.mini.view.DrumConfigView) DrumView(de.mossgrabers.controller.novation.launchkey.mini.view.DrumView)

Example 5 with LaunchkeyMiniMk3ControlSurface

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));
}
Also used : LaunchkeyMiniMk3ControlSurface(de.mossgrabers.controller.novation.launchkey.mini.controller.LaunchkeyMiniMk3ControlSurface) BooleanSupplier(java.util.function.BooleanSupplier) ModeManager(de.mossgrabers.framework.featuregroup.ModeManager)

Aggregations

LaunchkeyMiniMk3ControlSurface (de.mossgrabers.controller.novation.launchkey.mini.controller.LaunchkeyMiniMk3ControlSurface)9 IHwLight (de.mossgrabers.framework.controller.hardware.IHwLight)3 IMidiInput (de.mossgrabers.framework.daw.midi.IMidiInput)2 IMidiOutput (de.mossgrabers.framework.daw.midi.IMidiOutput)2 ViewManager (de.mossgrabers.framework.featuregroup.ViewManager)2 DrumConfigView (de.mossgrabers.controller.novation.launchkey.mini.view.DrumConfigView)1 DrumView (de.mossgrabers.controller.novation.launchkey.mini.view.DrumView)1 PadModeSelectView (de.mossgrabers.controller.novation.launchkey.mini.view.PadModeSelectView)1 SessionView (de.mossgrabers.controller.novation.launchkey.mini.view.SessionView)1 UserPadView (de.mossgrabers.controller.novation.launchkey.mini.view.UserPadView)1 ModeCursorCommand (de.mossgrabers.framework.command.trigger.mode.ModeCursorCommand)1 ModeSelectCommand (de.mossgrabers.framework.command.trigger.mode.ModeSelectCommand)1 ConfiguredRecordCommand (de.mossgrabers.framework.command.trigger.transport.ConfiguredRecordCommand)1 FeatureGroupButtonColorSupplier (de.mossgrabers.framework.command.trigger.view.FeatureGroupButtonColorSupplier)1 ViewMultiSelectCommand (de.mossgrabers.framework.command.trigger.view.ViewMultiSelectCommand)1 IHwAbsoluteKnob (de.mossgrabers.framework.controller.hardware.IHwAbsoluteKnob)1 IHost (de.mossgrabers.framework.daw.IHost)1 ITransport (de.mossgrabers.framework.daw.ITransport)1 IMidiAccess (de.mossgrabers.framework.daw.midi.IMidiAccess)1 ModeManager (de.mossgrabers.framework.featuregroup.ModeManager)1