Search in sources :

Example 1 with SLControlSurface

use of de.mossgrabers.controller.novation.sl.controller.SLControlSurface in project DrivenByMoss by git-moss.

the class SLControllerSetup method createModes.

/**
 * {@inheritDoc}
 */
@Override
protected void createModes() {
    final SLControlSurface surface = this.getSurface();
    final ModeManager modeManager = surface.getModeManager();
    modeManager.register(Modes.VOLUME, new SLVolumeMode(surface, this.model));
    modeManager.register(Modes.TRACK, new SLTrackMode(surface, this.model));
    modeManager.register(Modes.DEVICE_PARAMS, new SLParameterMode(surface, this.model));
    modeManager.register(Modes.FIXED, new FixedMode(surface, this.model));
    modeManager.register(Modes.FRAME, new FrameMode(surface, this.model));
    modeManager.register(Modes.FUNCTIONS, new FunctionMode(surface, this.model));
    modeManager.register(Modes.PLAY_OPTIONS, new PlayOptionsMode(surface, this.model));
    modeManager.register(Modes.SESSION, new SessionMode(surface, this.model));
    modeManager.register(Modes.TRACK_DETAILS, new TrackTogglesMode(surface, this.model));
    modeManager.register(Modes.VIEW_SELECT, new ViewSelectMode(surface, this.model));
    modeManager.register(Modes.BROWSER, new DevicePresetsMode(surface, this.model));
}
Also used : TrackTogglesMode(de.mossgrabers.controller.novation.sl.mode.TrackTogglesMode) SLParameterMode(de.mossgrabers.controller.novation.sl.mode.device.SLParameterMode) FunctionMode(de.mossgrabers.controller.novation.sl.mode.FunctionMode) SLControlSurface(de.mossgrabers.controller.novation.sl.controller.SLControlSurface) FixedMode(de.mossgrabers.controller.novation.sl.mode.FixedMode) SLVolumeMode(de.mossgrabers.controller.novation.sl.mode.SLVolumeMode) SessionMode(de.mossgrabers.controller.novation.sl.mode.SessionMode) SLTrackMode(de.mossgrabers.controller.novation.sl.mode.SLTrackMode) DevicePresetsMode(de.mossgrabers.controller.novation.sl.mode.device.DevicePresetsMode) ViewSelectMode(de.mossgrabers.controller.novation.sl.mode.ViewSelectMode) FrameMode(de.mossgrabers.controller.novation.sl.mode.FrameMode) PlayOptionsMode(de.mossgrabers.controller.novation.sl.mode.PlayOptionsMode) ModeManager(de.mossgrabers.framework.featuregroup.ModeManager)

Example 2 with SLControlSurface

use of de.mossgrabers.controller.novation.sl.controller.SLControlSurface in project DrivenByMoss by git-moss.

the class SLControllerSetup method layoutControls.

/**
 * {@inheritDoc}
 */
@Override
protected void layoutControls() {
    final SLControlSurface surface = this.getSurface();
    surface.getButton(ButtonID.PAD1).setBounds(51.0, 179.75, 34.75, 33.25);
    surface.getButton(ButtonID.PAD2).setBounds(91.25, 179.75, 34.75, 33.25);
    surface.getButton(ButtonID.PAD3).setBounds(131.75, 179.75, 34.75, 33.25);
    surface.getButton(ButtonID.PAD4).setBounds(172.0, 179.75, 34.75, 33.25);
    surface.getButton(ButtonID.PAD5).setBounds(212.25, 179.75, 34.75, 33.25);
    surface.getButton(ButtonID.PAD6).setBounds(252.5, 179.75, 34.75, 33.25);
    surface.getButton(ButtonID.PAD7).setBounds(293.0, 179.75, 34.75, 33.25);
    surface.getButton(ButtonID.PAD8).setBounds(333.25, 179.75, 34.75, 33.25);
    surface.getButton(ButtonID.ROW1_1).setBounds(56.25, 57.25, 31.5, 14.25);
    surface.getButton(ButtonID.ROW2_1).setBounds(54.75, 121.25, 31.5, 14.25);
    surface.getButton(ButtonID.ROW3_1).setBounds(434.25, 141.0, 29.75, 15.0);
    surface.getButton(ButtonID.ROW4_1).setBounds(434.75, 163.0, 29.75, 15.0);
    surface.getButton(ButtonID.ROW_SELECT_1).setBounds(13.5, 57.75, 17.5, 15.0);
    surface.getButton(ButtonID.ROW1_2).setBounds(96.0, 57.25, 31.5, 14.25);
    surface.getButton(ButtonID.ROW2_2).setBounds(95.0, 121.25, 31.5, 14.25);
    surface.getButton(ButtonID.ROW3_2).setBounds(474.25, 141.0, 29.75, 15.0);
    surface.getButton(ButtonID.ROW4_2).setBounds(475.0, 163.0, 29.75, 15.0);
    surface.getButton(ButtonID.ROW_SELECT_2).setBounds(13.5, 90.5, 17.5, 15.0);
    surface.getButton(ButtonID.ROW1_3).setBounds(135.5, 57.25, 31.5, 14.25);
    surface.getButton(ButtonID.ROW2_3).setBounds(135.0, 121.25, 31.5, 14.25);
    surface.getButton(ButtonID.ROW3_3).setBounds(514.5, 141.0, 29.75, 15.0);
    surface.getButton(ButtonID.ROW4_3).setBounds(515.25, 163.0, 29.75, 15.0);
    surface.getButton(ButtonID.ROW_SELECT_3).setBounds(13.5, 119.75, 17.5, 15.0);
    surface.getButton(ButtonID.ROW1_4).setBounds(175.25, 57.25, 31.5, 14.25);
    surface.getButton(ButtonID.ROW2_4).setBounds(175.25, 121.25, 31.5, 14.25);
    surface.getButton(ButtonID.ROW3_4).setBounds(554.5, 141.0, 29.75, 15.0);
    surface.getButton(ButtonID.ROW4_4).setBounds(555.5, 163.0, 29.75, 15.0);
    surface.getButton(ButtonID.ROW_SELECT_4).setBounds(13.5, 152.0, 17.5, 15.0);
    surface.getButton(ButtonID.ROW1_5).setBounds(214.75, 57.25, 31.5, 14.25);
    surface.getButton(ButtonID.ROW2_5).setBounds(215.5, 121.25, 31.5, 14.25);
    surface.getButton(ButtonID.ROW3_5).setBounds(594.75, 141.0, 29.75, 15.0);
    surface.getButton(ButtonID.ROW4_5).setBounds(595.75, 163.0, 29.75, 15.0);
    surface.getButton(ButtonID.ROW_SELECT_5).setBounds(13.5, 189.25, 17.5, 15.0);
    surface.getButton(ButtonID.ROW1_6).setBounds(254.5, 57.25, 31.5, 14.25);
    surface.getButton(ButtonID.ROW2_6).setBounds(255.75, 121.25, 31.5, 14.25);
    surface.getButton(ButtonID.ROW3_6).setBounds(634.75, 141.0, 29.75, 15.0);
    surface.getButton(ButtonID.ROW4_6).setBounds(636.0, 163.0, 29.75, 15.0);
    surface.getButton(ButtonID.ROW_SELECT_6).setBounds(768.5, 90.0, 19.0, 16.0);
    surface.getButton(ButtonID.ROW1_7).setBounds(294.0, 57.25, 31.5, 14.25);
    surface.getButton(ButtonID.ROW2_7).setBounds(295.75, 121.25, 31.5, 14.25);
    surface.getButton(ButtonID.ROW3_7).setBounds(675.0, 141.0, 29.75, 15.0);
    surface.getButton(ButtonID.ROW4_7).setBounds(676.25, 163.0, 29.75, 15.0);
    surface.getButton(ButtonID.ROW_SELECT_7).setBounds(768.5, 139.5, 19.0, 16.0);
    surface.getButton(ButtonID.ROW1_8).setBounds(333.75, 57.25, 31.5, 14.25);
    surface.getButton(ButtonID.ROW2_8).setBounds(336.0, 121.25, 31.5, 14.25);
    surface.getButton(ButtonID.ROW3_8).setBounds(715.0, 141.0, 29.75, 15.0);
    surface.getButton(ButtonID.ROW4_8).setBounds(716.5, 163.0, 29.75, 15.0);
    surface.getButton(ButtonID.ROW_SELECT_8).setBounds(768.5, 162.0, 19.0, 16.0);
    surface.getButton(ButtonID.REWIND).setBounds(532.5, 193.5, 25.0, 22.75);
    surface.getButton(ButtonID.FORWARD).setBounds(564.0, 193.5, 25.0, 22.75);
    surface.getButton(ButtonID.STOP).setBounds(595.25, 193.5, 25.0, 22.75);
    surface.getButton(ButtonID.PLAY).setBounds(626.5, 193.5, 25.0, 22.75);
    surface.getButton(ButtonID.LOOP).setBounds(657.75, 193.5, 25.0, 22.75);
    surface.getButton(ButtonID.RECORD).setBounds(689.25, 193.5, 25.0, 22.75);
    surface.getButton(ButtonID.ARROW_LEFT).setBounds(12.5, 16.25, 25.0, 15.75);
    surface.getButton(ButtonID.ARROW_RIGHT).setBounds(12.5, 33.5, 25.0, 15.75);
    surface.getButton(ButtonID.ARROW_UP).setBounds(762.5, 11.0, 25.0, 16.5);
    surface.getButton(ButtonID.ARROW_DOWN).setBounds(762.5, 30.0, 25.0, 16.5);
    surface.getButton(ButtonID.NOTE).setBounds(385.75, 161.75, 24.25, 17.0);
    surface.getButton(ButtonID.CONTROL).setBounds(767.75, 328.75, 22.75, 18.25);
    surface.getContinuous(ContinuousID.DEVICE_KNOB1).setBounds(55.0, 83.5, 23.5, 24.25);
    surface.getContinuous(ContinuousID.KNOB1).setBounds(53.75, 146.0, 25.0, 25.0);
    surface.getContinuous(ContinuousID.DEVICE_KNOB2).setBounds(95.75, 83.5, 23.5, 23.5);
    surface.getContinuous(ContinuousID.KNOB2).setBounds(94.25, 146.0, 25.0, 25.0);
    surface.getContinuous(ContinuousID.DEVICE_KNOB3).setBounds(136.25, 83.5, 23.5, 23.5);
    surface.getContinuous(ContinuousID.KNOB3).setBounds(134.75, 146.0, 25.0, 25.0);
    surface.getContinuous(ContinuousID.DEVICE_KNOB4).setBounds(177.0, 83.5, 23.5, 23.5);
    surface.getContinuous(ContinuousID.KNOB4).setBounds(175.25, 146.0, 25.0, 25.0);
    surface.getContinuous(ContinuousID.DEVICE_KNOB5).setBounds(217.5, 83.5, 23.5, 23.5);
    surface.getContinuous(ContinuousID.KNOB5).setBounds(215.75, 146.0, 25.0, 25.0);
    surface.getContinuous(ContinuousID.DEVICE_KNOB6).setBounds(258.25, 83.5, 23.5, 23.5);
    surface.getContinuous(ContinuousID.KNOB6).setBounds(256.25, 146.0, 25.0, 25.0);
    surface.getContinuous(ContinuousID.DEVICE_KNOB7).setBounds(298.75, 83.5, 23.5, 23.5);
    surface.getContinuous(ContinuousID.KNOB7).setBounds(296.75, 146.0, 25.0, 25.0);
    surface.getContinuous(ContinuousID.DEVICE_KNOB8).setBounds(339.5, 83.5, 23.5, 23.5);
    surface.getContinuous(ContinuousID.KNOB8).setBounds(337.5, 146.0, 25.0, 25.0);
    surface.getContinuous(ContinuousID.FADER1).setBounds(435.5, 55.75, 23.25, 75.75);
    surface.getContinuous(ContinuousID.FADER2).setBounds(476.25, 55.75, 23.25, 75.75);
    surface.getContinuous(ContinuousID.FADER3).setBounds(517.0, 55.75, 23.25, 75.75);
    surface.getContinuous(ContinuousID.FADER4).setBounds(557.75, 55.75, 23.25, 75.75);
    surface.getContinuous(ContinuousID.FADER5).setBounds(598.5, 55.75, 23.25, 75.75);
    surface.getContinuous(ContinuousID.FADER6).setBounds(639.25, 55.75, 23.25, 75.75);
    surface.getContinuous(ContinuousID.FADER7).setBounds(680.0, 55.75, 23.25, 75.75);
    surface.getContinuous(ContinuousID.FADER8).setBounds(720.75, 55.75, 23.25, 75.75);
    surface.getContinuous(ContinuousID.TOUCHPAD_X).setBounds(25.0, 375.25, 49.0, 90.25);
    surface.getContinuous(ContinuousID.TOUCHPAD_Y).setBounds(90.75, 375.25, 49.0, 90.25);
    surface.getContinuous(ContinuousID.HELLO).setBounds(767.75, 268.25, 10.0, 50.0);
    surface.getContinuous(ContinuousID.TEMPO).setBounds(780.5, 268.25, 10.0, 50.0);
    final SLDisplay textDisplay = (SLDisplay) surface.getTextDisplay();
    textDisplay.getHwTextDisplay1().setBounds(55.5, 17.5, 316.25, 34.75);
    textDisplay.getHwTextDisplay2().setBounds(431.75, 17.5, 317.75, 34.75);
    surface.getContinuous(ContinuousID.PITCHBEND_WHEEL).setBounds(25.0, 262.75, 49.0, 90.25);
    surface.getContinuous(ContinuousID.MODULATION_WHEEL).setBounds(90.75, 262.75, 49.0, 90.25);
    surface.getPianoKeyboard().setBounds(163.75, 262.0, 593.5, 224.25);
}
Also used : SLControlSurface(de.mossgrabers.controller.novation.sl.controller.SLControlSurface) SLDisplay(de.mossgrabers.controller.novation.sl.controller.SLDisplay)

Example 3 with SLControlSurface

use of de.mossgrabers.controller.novation.sl.controller.SLControlSurface in project DrivenByMoss by git-moss.

the class SLControllerSetup method registerContinuousCommands.

/**
 * {@inheritDoc}
 */
@Override
protected void registerContinuousCommands() {
    final SLControlSurface surface = this.getSurface();
    for (int i = 0; i < 8; i++) {
        final int index = i;
        this.addFader(ContinuousID.get(ContinuousID.FADER1, i), "Fader " + (i + 1), null, BindType.CC, SLControlSurface.MKII_SLIDER1 + i);
        final IHwRelativeKnob relativeKnob = this.addRelativeKnob(ContinuousID.get(ContinuousID.DEVICE_KNOB1, i), "Device Knob " + (i + 1), null, SLControlSurface.MKII_KNOB_ROW1_1 + i, RelativeEncoding.SIGNED_BIT);
        relativeKnob.addOutput(() -> {
            final boolean hasDevice = this.model.hasSelectedDevice();
            final IParameterBank parameterBank = this.model.getCursorDevice().getParameterBank();
            return hasDevice ? parameterBank.getItem(index).getValue() : 0;
        }, value -> surface.getMidiOutput().sendCC(0x70 + index, Math.min(value * 11 / 127, 11)));
        this.addAbsoluteKnob(ContinuousID.get(ContinuousID.KNOB1, i), "Knob " + (i + 1), null, SLControlSurface.MKII_KNOB_ROW2_1 + i);
    }
    this.addFader(ContinuousID.TOUCHPAD_X, "Touchpad X", new TouchpadCommand(true, this.model, surface), BindType.CC, SLControlSurface.MKII_TOUCHPAD_X);
    this.addFader(ContinuousID.TOUCHPAD_Y, "Touchpad Y", new TouchpadCommand(false, this.model, surface), BindType.CC, SLControlSurface.MKII_TOUCHPAD_Y);
    // These are no faders but cannot be mapped to any meaningful control anyway
    this.addFader(ContinuousID.HELLO, "Tap Init", new TapTempoInitMkICommand(this.model, surface), BindType.CC, SLControlSurface.MKI_BUTTON_TAP_TEMPO);
    this.addFader(ContinuousID.TEMPO, "Tap Tempo", new TapTempoMkICommand(this.model, surface), BindType.CC, SLControlSurface.MKI_BUTTON_TAP_TEMPO_VALUE);
    // Volume, Track and Parameter modes are always bound since they have dedicated controls
    final ModeManager modeManager = surface.getModeManager();
    modeManager.get(Modes.VOLUME).onActivate();
    modeManager.get(Modes.TRACK).onActivate();
    modeManager.get(Modes.DEVICE_PARAMS).onActivate();
}
Also used : IHwRelativeKnob(de.mossgrabers.framework.controller.hardware.IHwRelativeKnob) TapTempoMkICommand(de.mossgrabers.controller.novation.sl.command.continuous.TapTempoMkICommand) TapTempoInitMkICommand(de.mossgrabers.controller.novation.sl.command.continuous.TapTempoInitMkICommand) SLControlSurface(de.mossgrabers.controller.novation.sl.controller.SLControlSurface) IParameterBank(de.mossgrabers.framework.daw.data.bank.IParameterBank) TouchpadCommand(de.mossgrabers.controller.novation.sl.command.continuous.TouchpadCommand) ModeManager(de.mossgrabers.framework.featuregroup.ModeManager)

Example 4 with SLControlSurface

use of de.mossgrabers.controller.novation.sl.controller.SLControlSurface in project DrivenByMoss by git-moss.

the class SLControllerSetup method createObservers.

/**
 * {@inheritDoc}
 */
@Override
protected void createObservers() {
    super.createObservers();
    this.createScaleObservers(this.configuration);
    this.configuration.registerDeactivatedItemsHandler(this.model);
    this.activateBrowserObserver(Modes.BROWSER);
    final SLControlSurface surface = this.getSurface();
    surface.getModeManager().addChangeListener((oldMode, newMode) -> surface.getTextDisplay().forceFlush());
}
Also used : SLControlSurface(de.mossgrabers.controller.novation.sl.controller.SLControlSurface)

Example 5 with SLControlSurface

use of de.mossgrabers.controller.novation.sl.controller.SLControlSurface in project DrivenByMoss by git-moss.

the class SLControllerSetup method registerTriggerCommands.

/**
 * {@inheritDoc}
 */
@Override
protected void registerTriggerCommands() {
    final SLControlSurface surface = this.getSurface();
    // Needs to be before the switch to Automap to catch the success response
    this.addButton(ButtonID.CONTROL, "DAW Online", (event, velocity) -> surface.setDAWConnected(velocity > 0), SLControlSurface.MKI_CC_OFF_ONLINE_MESSAGE, surface::isDAWConnected);
    surface.sendStartup();
    for (int i = 0; i < 8; i++) {
        final int index = i + 1;
        final ButtonID buttonID1 = ButtonID.get(ButtonID.ROW1_1, i);
        final ButtonID buttonID2 = ButtonID.get(ButtonID.ROW2_1, i);
        final ButtonID buttonID3 = ButtonID.get(ButtonID.ROW3_1, i);
        final ButtonID buttonID4 = ButtonID.get(ButtonID.ROW4_1, i);
        final ButtonID buttonID5 = ButtonID.get(ButtonID.ROW_SELECT_1, i);
        this.addButton(buttonID1, "Row 1-" + index, new ButtonRowViewCommand<>(0, i, this.model, surface), SLControlSurface.MKII_BUTTON_ROW1_1 + i, () -> this.getViewButtonColor(buttonID1));
        this.addButton(buttonID2, "Row 2-" + index, new ButtonRowViewCommand<>(1, i, this.model, surface), SLControlSurface.MKII_BUTTON_ROW2_1 + i, () -> this.getViewButtonColor(buttonID2));
        this.addButton(buttonID3, "Row 3-" + index, new ButtonRowViewCommand<>(2, i, this.model, surface), SLControlSurface.MKII_BUTTON_ROW3_1 + i, () -> this.getViewButtonColor(buttonID3));
        this.addButton(buttonID4, "Row 4-" + index, new ButtonRowViewCommand<>(3, i, this.model, surface), SLControlSurface.MKII_BUTTON_ROW4_1 + i, () -> this.getViewButtonColor(buttonID4));
        this.addButton(buttonID5, "Select " + index, new ButtonRowSelectCommand<>(i, this.model, surface), SLControlSurface.MKII_BUTTON_ROWSEL1 + i, () -> this.getViewButtonColor(buttonID5));
    }
    this.addButton(ButtonID.REWIND, "<<", new ButtonRowViewCommand<>(4, 0, this.model, surface), SLControlSurface.MKII_BUTTON_REWIND);
    this.addButton(ButtonID.FORWARD, ">>", new ButtonRowViewCommand<>(4, 1, this.model, surface), SLControlSurface.MKII_BUTTON_FORWARD);
    this.addButton(ButtonID.STOP, "Stop", new ButtonRowViewCommand<>(4, 2, this.model, surface), SLControlSurface.MKII_BUTTON_STOP);
    this.addButton(ButtonID.PLAY, "Play", new ButtonRowViewCommand<>(4, 3, this.model, surface), SLControlSurface.MKII_BUTTON_PLAY);
    this.addButton(ButtonID.LOOP, "Loop", new ButtonRowViewCommand<>(4, 4, this.model, surface), SLControlSurface.MKII_BUTTON_LOOP);
    this.addButton(ButtonID.RECORD, "Record", new ButtonRowViewCommand<>(4, 6, this.model, surface), SLControlSurface.MKII_BUTTON_RECORD);
    this.addButton(ButtonID.ARROW_LEFT, "Left", new P1ButtonCommand(true, this.model, surface), SLControlSurface.MKII_BUTTON_P1_UP);
    this.addButton(ButtonID.ARROW_RIGHT, "Right", new P1ButtonCommand(false, this.model, surface), SLControlSurface.MKII_BUTTON_P1_DOWN);
    this.addButton(ButtonID.ARROW_UP, "Up", new P2ButtonCommand(true, this.model, surface), SLControlSurface.MKII_BUTTON_P2_UP);
    this.addButton(ButtonID.ARROW_DOWN, "Down", new P2ButtonCommand(false, this.model, surface), SLControlSurface.MKII_BUTTON_P2_DOWN);
    this.addButton(ButtonID.NOTE, "Play View", new TransportButtonCommand(this.model, surface), SLControlSurface.MKII_BUTTON_TRANSPORT);
}
Also used : TransportButtonCommand(de.mossgrabers.controller.novation.sl.command.trigger.TransportButtonCommand) ButtonID(de.mossgrabers.framework.controller.ButtonID) P1ButtonCommand(de.mossgrabers.controller.novation.sl.command.trigger.P1ButtonCommand) P2ButtonCommand(de.mossgrabers.controller.novation.sl.command.trigger.P2ButtonCommand) SLControlSurface(de.mossgrabers.controller.novation.sl.controller.SLControlSurface)

Aggregations

SLControlSurface (de.mossgrabers.controller.novation.sl.controller.SLControlSurface)8 ModeManager (de.mossgrabers.framework.featuregroup.ModeManager)3 TapTempoInitMkICommand (de.mossgrabers.controller.novation.sl.command.continuous.TapTempoInitMkICommand)1 TapTempoMkICommand (de.mossgrabers.controller.novation.sl.command.continuous.TapTempoMkICommand)1 TouchpadCommand (de.mossgrabers.controller.novation.sl.command.continuous.TouchpadCommand)1 P1ButtonCommand (de.mossgrabers.controller.novation.sl.command.trigger.P1ButtonCommand)1 P2ButtonCommand (de.mossgrabers.controller.novation.sl.command.trigger.P2ButtonCommand)1 TransportButtonCommand (de.mossgrabers.controller.novation.sl.command.trigger.TransportButtonCommand)1 SLDisplay (de.mossgrabers.controller.novation.sl.controller.SLDisplay)1 FixedMode (de.mossgrabers.controller.novation.sl.mode.FixedMode)1 FrameMode (de.mossgrabers.controller.novation.sl.mode.FrameMode)1 FunctionMode (de.mossgrabers.controller.novation.sl.mode.FunctionMode)1 PlayOptionsMode (de.mossgrabers.controller.novation.sl.mode.PlayOptionsMode)1 SLTrackMode (de.mossgrabers.controller.novation.sl.mode.SLTrackMode)1 SLVolumeMode (de.mossgrabers.controller.novation.sl.mode.SLVolumeMode)1 SessionMode (de.mossgrabers.controller.novation.sl.mode.SessionMode)1 TrackTogglesMode (de.mossgrabers.controller.novation.sl.mode.TrackTogglesMode)1 ViewSelectMode (de.mossgrabers.controller.novation.sl.mode.ViewSelectMode)1 DevicePresetsMode (de.mossgrabers.controller.novation.sl.mode.device.DevicePresetsMode)1 SLParameterMode (de.mossgrabers.controller.novation.sl.mode.device.SLParameterMode)1