Search in sources :

Example 11 with MaschineControlSurface

use of de.mossgrabers.controller.ni.maschine.mk3.controller.MaschineControlSurface in project DrivenByMoss by git-moss.

the class MaschineControllerSetup method registerTriggerCommands.

/**
 * {@inheritDoc}
 */
@Override
protected void registerTriggerCommands() {
    final MaschineControlSurface surface = this.getSurface();
    final ModeManager modeManager = surface.getModeManager();
    final ViewManager viewManager = surface.getViewManager();
    final ITransport t = this.model.getTransport();
    this.addButton(ButtonID.SHIFT, "SHIFT", new ToggleShiftViewCommand<>(this.model, surface), this.maschine == Maschine.STUDIO ? MaschineControlSurface.NAVIGATE_BACK : -1, () -> viewManager.isActive(Views.SHIFT) || surface.isShiftPressed());
    // Transport
    this.addButton(ButtonID.PLAY, "PLAY", new PlayCommand<>(this.model, surface), MaschineControlSurface.PLAY, t::isPlaying);
    final ConfiguredRecordCommand<MaschineControlSurface, MaschineConfiguration> recordCommand = new ConfiguredRecordCommand<>(this.model, surface);
    this.addButton(ButtonID.RECORD, "RECORD", recordCommand, MaschineControlSurface.REC, recordCommand::isLit);
    this.addButton(ButtonID.STOP, "STOP", new MaschineStopCommand(this.model, surface), MaschineControlSurface.STOP, () -> !t.isPlaying());
    this.addButton(ButtonID.LOOP, "LOOP", new ToggleLoopCommand<>(this.model, surface), MaschineControlSurface.RESTART, t::isLoop);
    this.addButton(ButtonID.DELETE, "ERASE", NopCommand.INSTANCE, MaschineControlSurface.ERASE);
    final MetronomeCommand<MaschineControlSurface, MaschineConfiguration> metroCommand = new MetronomeCommand<>(this.model, surface, false);
    final TapTempoCommand<MaschineControlSurface, MaschineConfiguration> tapTempoCommand = new TapTempoCommand<>(this.model, surface);
    this.addButton(ButtonID.TAP_TEMPO, "TAP/METRO", (event, velocity) -> {
        if (event != ButtonEvent.UP)
            return;
        if (surface.isShiftPressed()) {
            surface.setStopConsumed();
            metroCommand.executeNormal(event);
        } else
            tapTempoCommand.execute(ButtonEvent.DOWN, velocity);
    }, MaschineControlSurface.TAP_METRO, t::isMetronomeOn);
    this.addButton(ButtonID.FLIP, this.maschine == Maschine.STUDIO || this.maschine == Maschine.MK2 ? "GRID" : "FOLLOW", (event, velocity) -> {
        if (event != ButtonEvent.UP)
            return;
        if (viewManager.isActive(Views.DRUM, Views.PLAY))
            ((DrumView) viewManager.get(Views.DRUM)).toggleGridEditor();
    }, MaschineControlSurface.FOLLOW, () -> viewManager.isActive(Views.DRUM, Views.PLAY) && ((DrumView) viewManager.get(Views.DRUM)).isGridEditor());
    this.addButton(ButtonID.NEW, this.maschine.hasCursorKeys() ? "MACRO" : "GROUP", new NewCommand<>(this.model, surface), MaschineControlSurface.GROUP);
    final AutomationCommand<MaschineControlSurface, MaschineConfiguration> automationCommand = new AutomationCommand<>(this.model, surface) {

        @Override
        protected void cleanupShift() {
            this.surface.setStopConsumed();
        }
    };
    this.addButton(ButtonID.AUTOMATION, "AUTO", automationCommand, MaschineControlSurface.AUTO, automationCommand::isLit);
    this.addButton(ButtonID.OVERDUB, this.maschine == Maschine.STUDIO || this.maschine == Maschine.MK2 ? "ENTER" : "LOCK", new OverdubCommand<>(this.model, surface) {

        @Override
        protected void shiftedFunction() {
            this.surface.setStopConsumed();
            super.shiftedFunction();
        }
    }, MaschineControlSurface.LOCK, () -> surface.isShiftPressed() ? t.isLauncherOverdub() : t.isArrangerOverdub());
    this.addButton(ButtonID.REPEAT, "NOTE REPEAT", new FillModeNoteRepeatCommand<>(this.model, surface, this.maschine.hasMCUDisplay()), MaschineControlSurface.NOTE_REPEAT, this.configuration::isNoteRepeatActive);
    // Ribbon
    this.addButton(ButtonID.F1, "PITCH", new RibbonCommand(this.model, surface, RIBBON_MODES_PITCH), MaschineControlSurface.PITCH, () -> this.isRibbonMode(new HashSet<>(RIBBON_MODES_PITCH)));
    this.addButton(ButtonID.F2, "MOD", new RibbonCommand(this.model, surface, RIBBON_MODES_CC), MaschineControlSurface.MOD, () -> this.isRibbonMode(new HashSet<>(RIBBON_MODES_CC)));
    this.addButton(ButtonID.F3, "PERFORM", new RibbonCommand(this.model, surface, RIBBON_MODES_MASTER_VOLUME), MaschineControlSurface.PERFORM, () -> this.isRibbonMode(new HashSet<>(RIBBON_MODES_MASTER_VOLUME)));
    this.addButton(ButtonID.F4, "NOTES", new RibbonCommand(this.model, surface, RIBBON_MODES_NOTE_REPEAT), MaschineControlSurface.NOTES, () -> this.isRibbonMode(new HashSet<>(RIBBON_MODES_NOTE_REPEAT)));
    this.addButton(ButtonID.FADER_TOUCH_1, "ENCODER PRESS", (event, velocity) -> {
        if (event != ButtonEvent.DOWN)
            return;
        if (modeManager.getActiveID() == Modes.BROWSER) {
            this.model.getBrowser().stopBrowsing(true);
            modeManager.restore();
        } else {
            final boolean isSlow = !surface.isKnobSensitivitySlow();
            surface.setKnobSensitivityIsSlow(isSlow);
            surface.getDisplay().notify("Value change speed: " + (isSlow ? "Slow" : "Fast"));
        }
    }, MaschineControlSurface.ENCODER_PUSH);
    // Encoder Modes
    this.addButton(ButtonID.VOLUME, "VOLUME", new VolumePanSendCommand(this.model, surface), MaschineControlSurface.VOLUME, () -> Modes.isTrackMode(modeManager.getActiveID()));
    this.addButton(ButtonID.SWING, "SWING", new SwingCommand(this.model, surface), MaschineControlSurface.SWING, () -> modeManager.isActive(Modes.POSITION, Modes.LOOP_START, Modes.LOOP_LENGTH));
    this.addButton(ButtonID.TEMPO_TOUCH, "TEMPO", new TempoCommand(this.model, surface), MaschineControlSurface.TEMPO, () -> modeManager.isActive(Modes.TEMPO));
    this.addButton(ButtonID.DEVICE, "PLUG-IN", (event, velocity) -> {
        if (this.maschine.hasMCUDisplay() || surface.isShiftPressed())
            new PanelLayoutCommand<>(this.model, surface).executeNormal(event);
        else
            new ModeSelectCommand<>(this.model, surface, Modes.DEVICE_PARAMS).execute(event, velocity);
    }, MaschineControlSurface.PLUGIN, () -> this.maschine.hasMCUDisplay() || surface.isShiftPressed() ? this.model.getCursorDevice().isWindowOpen() : modeManager.isActive(Modes.DEVICE_PARAMS));
    this.addButton(ButtonID.DEVICE_ON_OFF, "SAMPLING", new ConvertCommand<>(this.model, surface) {

        @Override
        protected void sliceToSampler() {
            this.surface.setStopConsumed();
            super.sliceToSampler();
        }
    }, MaschineControlSurface.SAMPLING);
    // Browser
    final String fileLabel;
    if (this.maschine.hasCursorKeys()) {
        if (this.maschine == Maschine.STUDIO || this.maschine == Maschine.MK2)
            fileLabel = "ALL/SAVE";
        else
            fileLabel = "FILE";
    } else
        fileLabel = "PROJECT";
    this.addButton(ButtonID.ADD_TRACK, fileLabel, new ProjectButtonCommand(this.model, surface), MaschineControlSurface.PROJECT);
    this.addButton(ButtonID.ADD_EFFECT, this.maschine.hasCursorKeys() ? "SETTINGS" : "FAVORITES", new AddDeviceCommand(this.model, surface), MaschineControlSurface.FAVORITES);
    this.addButton(ButtonID.BROWSE, this.maschine == Maschine.STUDIO || this.maschine == Maschine.MK2 ? "BROWSE" : "BROWSER", new BrowserCommand<>(this.model, surface, ButtonID.SHIFT, ButtonID.SELECT) {

        /**
         * {@inheritDoc}
         */
        @Override
        protected boolean getCommit() {
            // Discard browser, confirmation is via encoder
            return false;
        }
    }, MaschineControlSurface.BROWSER, this.model.getBrowser()::isActive);
    // Pad modes
    this.addButton(ButtonID.ACCENT, "ACCENT", new ToggleFixedVelCommand(this.model, surface), MaschineControlSurface.FIXED_VEL, this.configuration::isAccentActive);
    this.addButton(ButtonID.SCENE1, "SCENE", new ViewMultiSelectCommand<>(this.model, surface, true, Views.SCENE_PLAY), MaschineControlSurface.SCENE, () -> viewManager.isActive(Views.SCENE_PLAY));
    this.addButton(ButtonID.CLIP, "PATTERN", new ViewMultiSelectCommand<>(this.model, surface, true, Views.CLIP), MaschineControlSurface.PATTERN, () -> viewManager.isActive(Views.CLIP));
    this.addButton(ButtonID.NOTE, "EVENTS", new ModeSelectCommand<>(this.model, surface, Modes.NOTE, true), MaschineControlSurface.EVENTS, () -> modeManager.isActive(Modes.NOTE));
    this.addButton(ButtonID.TOGGLE_DEVICE, this.maschine == Maschine.STUDIO || this.maschine == Maschine.MK2 ? "NAVIGATE" : "VARIATION", new ViewMultiSelectCommand<>(this.model, surface, true, Views.DEVICE), MaschineControlSurface.VARIATION, () -> viewManager.isActive(Views.DEVICE));
    this.addButton(ButtonID.DUPLICATE, "DUPLICATE", NopCommand.INSTANCE, MaschineControlSurface.DUPLICATE);
    if (this.maschine.hasGroupButtons()) {
        this.addButton(ButtonID.SELECT, "SELECT", new MaschineSelectButtonCommand(this.model, surface), MaschineControlSurface.SELECT);
        this.addButton(ButtonID.SOLO, "SOLO", (event, velocity) -> {
            if (event == ButtonEvent.UP && surface.isShiftPressed()) {
                surface.setStopConsumed();
                this.model.getProject().clearSolo();
            }
        }, MaschineControlSurface.SOLO);
        this.addButton(ButtonID.MUTE, "MUTE", (event, velocity) -> {
            if (event == ButtonEvent.UP && surface.isShiftPressed()) {
                surface.setStopConsumed();
                this.model.getProject().clearMute();
            }
        }, MaschineControlSurface.MUTE);
    } else {
        this.addButton(ButtonID.SELECT, "SELECT", new ViewMultiSelectCommand<>(this.model, surface, true, Views.TRACK_SELECT), MaschineControlSurface.SELECT, () -> viewManager.isActive(Views.TRACK_SELECT));
        this.addButton(ButtonID.SOLO, "SOLO", new ViewMultiSelectCommand<>(this.model, surface, true, Views.TRACK_SOLO), MaschineControlSurface.SOLO, () -> viewManager.isActive(Views.TRACK_SOLO));
        this.addButton(ButtonID.MUTE, "MUTE", new ViewMultiSelectCommand<>(this.model, surface, true, Views.TRACK_MUTE), MaschineControlSurface.MUTE, () -> viewManager.isActive(Views.TRACK_MUTE));
    }
    final KeyboardCommand keyboardCommand = new KeyboardCommand(this.model, surface);
    this.addButton(ButtonID.ROW1_1, "PAD MODE", new PadModeCommand(keyboardCommand, this.model, surface), MaschineControlSurface.PAD_MODE, () -> viewManager.isActive(Views.DRUM));
    this.addButton(ButtonID.ROW1_2, "KEYBOARD", keyboardCommand, MaschineControlSurface.KEYBOARD, () -> viewManager.isActive(Views.PLAY));
    this.addButton(ButtonID.ROW1_3, "CHORDS", (event, velocity) -> {
        if (velocity == 0)
            ((PlayView) viewManager.get(Views.PLAY)).toggleChordMode();
    }, MaschineControlSurface.CHORDS, ((PlayView) viewManager.get(Views.PLAY))::isChordMode);
    final DrumView drumView = (DrumView) viewManager.get(Views.DRUM);
    this.addButton(ButtonID.ROW1_4, "STEP", (event, velocity) -> {
        if (event == ButtonEvent.UP)
            drumView.toggleSequencerVisible();
    }, MaschineControlSurface.STEP, drumView::isSequencerVisible);
    this.registerCursorKeys(surface);
    this.registerDisplayButtons(surface, modeManager);
    this.registerGroupButtons(surface);
    if (this.maschine == Maschine.STUDIO)
        this.registerMaschineStudioButtons(surface);
    // Register foot switches
    final int footswitches = this.maschine.getFootswitches();
    if (footswitches >= 2) {
        this.addButton(ButtonID.FOOTSWITCH1, "Foot Controller (Tip)", new FootswitchCommand<>(this.model, surface, 0), MaschineControlSurface.FOOTSWITCH1_TIP);
        this.addButton(ButtonID.FOOTSWITCH2, "Foot Controller (Ring)", new FootswitchCommand<>(this.model, surface, 1), MaschineControlSurface.FOOTSWITCH1_RING);
        if (footswitches == 4) {
            this.addButton(ButtonID.FOOTSWITCH3, "Foot Controller 2 (Tip)", new FootswitchCommand<>(this.model, surface, 2), MaschineControlSurface.FOOTSWITCH2_TIP);
            this.addButton(ButtonID.FOOTSWITCH4, "Foot Controller 2 (Ring)", new FootswitchCommand<>(this.model, surface, 3), MaschineControlSurface.FOOTSWITCH2_RING);
        }
    }
}
Also used : TapTempoCommand(de.mossgrabers.framework.command.trigger.transport.TapTempoCommand) ITransport(de.mossgrabers.framework.daw.ITransport) KeyboardCommand(de.mossgrabers.controller.ni.maschine.mk3.command.trigger.KeyboardCommand) ToggleFixedVelCommand(de.mossgrabers.controller.ni.maschine.mk3.command.trigger.ToggleFixedVelCommand) ViewManager(de.mossgrabers.framework.featuregroup.ViewManager) MaschineControlSurface(de.mossgrabers.controller.ni.maschine.mk3.controller.MaschineControlSurface) ConfiguredRecordCommand(de.mossgrabers.framework.command.trigger.transport.ConfiguredRecordCommand) ProjectButtonCommand(de.mossgrabers.controller.ni.maschine.mk3.command.trigger.ProjectButtonCommand) AutomationCommand(de.mossgrabers.framework.command.trigger.transport.AutomationCommand) MetronomeCommand(de.mossgrabers.framework.command.trigger.transport.MetronomeCommand) VolumePanSendCommand(de.mossgrabers.controller.ni.maschine.mk3.command.trigger.VolumePanSendCommand) ModeSelectCommand(de.mossgrabers.framework.command.trigger.mode.ModeSelectCommand) PadModeCommand(de.mossgrabers.controller.ni.maschine.mk3.command.trigger.PadModeCommand) ModeManager(de.mossgrabers.framework.featuregroup.ModeManager) StudioEncoderModeManager(de.mossgrabers.controller.ni.maschine.mk3.controller.StudioEncoderModeManager) HashSet(java.util.HashSet) MaschineSelectButtonCommand(de.mossgrabers.controller.ni.maschine.mk3.command.trigger.MaschineSelectButtonCommand) SwingCommand(de.mossgrabers.controller.ni.maschine.mk3.command.trigger.SwingCommand) TempoCommand(de.mossgrabers.controller.ni.maschine.mk3.command.trigger.TempoCommand) TapTempoCommand(de.mossgrabers.framework.command.trigger.transport.TapTempoCommand) PanelLayoutCommand(de.mossgrabers.framework.command.trigger.application.PanelLayoutCommand) DrumView(de.mossgrabers.controller.ni.maschine.mk3.view.DrumView) AddDeviceCommand(de.mossgrabers.controller.ni.maschine.mk3.command.trigger.AddDeviceCommand) Set(java.util.Set) IMidiInput(de.mossgrabers.framework.daw.midi.IMidiInput) ITransport(de.mossgrabers.framework.daw.ITransport) IHost(de.mossgrabers.framework.daw.IHost) ButtonEvent(de.mossgrabers.framework.utils.ButtonEvent) List(java.util.List) HashSet(java.util.HashSet) IMidiOutput(de.mossgrabers.framework.daw.midi.IMidiOutput) MaschineStopCommand(de.mossgrabers.controller.ni.maschine.mk3.command.trigger.MaschineStopCommand) RibbonCommand(de.mossgrabers.controller.ni.maschine.mk3.command.trigger.RibbonCommand)

Example 12 with MaschineControlSurface

use of de.mossgrabers.controller.ni.maschine.mk3.controller.MaschineControlSurface in project DrivenByMoss by git-moss.

the class MaschineControllerSetup method layoutMk2.

private void layoutMk2() {
    final MaschineControlSurface surface = this.getSurface();
    surface.getButton(ButtonID.PAD1).setBounds(425.5, 604.5, 76.25, 79.0);
    surface.getButton(ButtonID.PAD2).setBounds(516.25, 605.25, 76.25, 79.0);
    surface.getButton(ButtonID.PAD3).setBounds(606.75, 605.25, 76.25, 79.0);
    surface.getButton(ButtonID.PAD4).setBounds(694.75, 605.25, 76.25, 79.0);
    surface.getButton(ButtonID.PAD5).setBounds(425.5, 515.0, 76.25, 79.0);
    surface.getButton(ButtonID.PAD6).setBounds(516.25, 515.5, 76.25, 79.0);
    surface.getButton(ButtonID.PAD7).setBounds(606.75, 515.75, 76.25, 79.0);
    surface.getButton(ButtonID.PAD8).setBounds(694.75, 515.5, 76.25, 79.0);
    surface.getButton(ButtonID.PAD9).setBounds(425.5, 425.25, 76.25, 79.0);
    surface.getButton(ButtonID.PAD10).setBounds(516.25, 426.0, 76.25, 79.0);
    surface.getButton(ButtonID.PAD11).setBounds(606.75, 426.25, 76.25, 79.0);
    surface.getButton(ButtonID.PAD12).setBounds(694.75, 425.5, 76.25, 79.0);
    surface.getButton(ButtonID.PAD13).setBounds(425.5, 335.75, 76.25, 79.0);
    surface.getButton(ButtonID.PAD14).setBounds(516.25, 336.25, 76.25, 79.0);
    surface.getButton(ButtonID.PAD15).setBounds(606.75, 336.75, 76.25, 79.0);
    surface.getButton(ButtonID.PAD16).setBounds(694.75, 335.75, 76.25, 79.0);
    surface.getButton(ButtonID.SHIFT).setBounds(96.75, 619.0, 56.0, 18.0);
    surface.getButton(ButtonID.PLAY).setBounds(24.75, 650.0, 55.75, 32.0);
    surface.getButton(ButtonID.RECORD).setBounds(96.75, 650.0, 55.75, 32.0);
    surface.getButton(ButtonID.LOOP).setBounds(24.75, 619.0, 56.0, 18.0);
    surface.getButton(ButtonID.DELETE).setBounds(166.25, 650.0, 55.75, 32.0);
    surface.getButton(ButtonID.TAP_TEMPO).setBounds(166.25, 619.0, 56.0, 18.0);
    surface.getButton(ButtonID.FLIP).setBounds(236.5, 619.0, 56.0, 18.0);
    surface.getButton(ButtonID.AUTOMATION).setBounds(94.0, 236.25, 55.75, 32.0);
    surface.getButton(ButtonID.OVERDUB).setBounds(231.5, 406.75, 58.0, 19.0);
    surface.getButton(ButtonID.REPEAT).setBounds(231.5, 337.25, 58.0, 46.25);
    surface.getButton(ButtonID.FADER_TOUCH_1).setBounds(123.25, 303.25, 69.5, 22.75);
    surface.getButton(ButtonID.VOLUME).setBounds(27.75, 337.25, 58.0, 18.0);
    surface.getButton(ButtonID.SWING).setBounds(27.75, 373.0, 58.0, 18.0);
    surface.getButton(ButtonID.TEMPO_TOUCH).setBounds(27.75, 407.75, 58.0, 18.0);
    surface.getButton(ButtonID.DEVICE_ON_OFF).setBounds(95.75, 107.25, 55.75, 38.5);
    surface.getButton(ButtonID.ADD_TRACK).setBounds(27.25, 236.25, 55.75, 32.0);
    surface.getButton(ButtonID.BROWSE).setBounds(28.75, 107.25, 55.75, 38.5);
    surface.getButton(ButtonID.SCENE1).setBounds(346.5, 335.5, 58.0, 34.0);
    surface.getButton(ButtonID.CLIP).setBounds(346.5, 379.25, 58.0, 34.0);
    surface.getButton(ButtonID.NOTE).setBounds(346.5, 561.5, 58.0, 34.0);
    surface.getButton(ButtonID.TOGGLE_DEVICE).setBounds(346.5, 466.75, 58.0, 41.25);
    surface.getButton(ButtonID.DUPLICATE).setBounds(347.25, 515.0, 58.0, 34.0);
    surface.getButton(ButtonID.SOLO).setBounds(346.5, 605.25, 58.0, 34.0);
    surface.getButton(ButtonID.MUTE).setBounds(346.5, 649.0, 58.0, 34.0);
    surface.getButton(ButtonID.ROW1_1).setBounds(346.5, 423.0, 58.0, 34.0);
    surface.getButton(ButtonID.ROW1_4).setBounds(95.75, 21.25, 55.75, 23.0);
    surface.getButton(ButtonID.ARROW_LEFT).setBounds(121.5, 408.25, 32.75, 17.5);
    surface.getButton(ButtonID.ARROW_RIGHT).setBounds(157.0, 408.25, 32.75, 17.5);
    surface.getButton(ButtonID.PAGE_LEFT).setBounds(28.75, 157.75, 55.75, 23.0);
    surface.getButton(ButtonID.PAGE_RIGHT).setBounds(95.75, 157.75, 55.75, 23.0);
    surface.getButton(ButtonID.DRUM).setBounds(28.75, 21.25, 55.75, 23.0);
    surface.getButton(ButtonID.ROW2_1).setBounds(179.25, 21.25, 66.25, 27.25);
    surface.getButton(ButtonID.ROW2_2).setBounds(254.25, 21.25, 66.25, 27.25);
    surface.getButton(ButtonID.ROW2_3).setBounds(329.25, 21.25, 66.25, 27.25);
    surface.getButton(ButtonID.ROW2_4).setBounds(404.0, 21.25, 66.25, 27.25);
    surface.getButton(ButtonID.ROW2_5).setBounds(479.0, 21.25, 66.25, 27.25);
    surface.getButton(ButtonID.ROW2_6).setBounds(554.0, 21.25, 66.25, 27.25);
    surface.getButton(ButtonID.ROW2_7).setBounds(629.0, 21.25, 66.25, 27.25);
    surface.getButton(ButtonID.ROW2_8).setBounds(704.0, 21.25, 66.25, 27.25);
    surface.getButton(ButtonID.ROW3_1).setBounds(26.25, 480.0, 53.75, 35.0);
    surface.getButton(ButtonID.ROW3_2).setBounds(96.75, 480.0, 53.75, 35.0);
    surface.getButton(ButtonID.ROW3_3).setBounds(167.0, 480.0, 53.75, 35.0);
    surface.getButton(ButtonID.ROW3_4).setBounds(237.5, 480.0, 53.75, 35.0);
    surface.getButton(ButtonID.ROW3_5).setBounds(26.25, 526.0, 53.75, 35.0);
    surface.getButton(ButtonID.ROW3_6).setBounds(96.75, 526.0, 53.75, 35.0);
    surface.getButton(ButtonID.ROW3_7).setBounds(167.0, 526.0, 53.75, 35.0);
    surface.getButton(ButtonID.ROW3_8).setBounds(237.5, 526.0, 53.75, 35.0);
    surface.getContinuous(ContinuousID.MASTER_KNOB).setBounds(125.0, 337.25, 64.0, 63.0);
    surface.getContinuous(ContinuousID.KNOB1).setBounds(183.5, 226.25, 53.75, 49.25);
    surface.getContinuous(ContinuousID.KNOB2).setBounds(259.0, 226.25, 53.75, 49.25);
    surface.getContinuous(ContinuousID.KNOB3).setBounds(334.75, 226.25, 53.75, 49.25);
    surface.getContinuous(ContinuousID.KNOB4).setBounds(410.25, 226.25, 53.75, 49.25);
    surface.getContinuous(ContinuousID.KNOB5).setBounds(486.0, 226.25, 53.75, 49.25);
    surface.getContinuous(ContinuousID.KNOB6).setBounds(561.5, 226.25, 53.75, 49.25);
    surface.getContinuous(ContinuousID.KNOB7).setBounds(637.0, 226.25, 53.75, 49.25);
    surface.getContinuous(ContinuousID.KNOB8).setBounds(712.75, 226.25, 53.75, 49.25);
    surface.getTextDisplay().getHardwareDisplay().setBounds(182.75, 111.75, 591.75, 64.5);
}
Also used : MaschineControlSurface(de.mossgrabers.controller.ni.maschine.mk3.controller.MaschineControlSurface)

Example 13 with MaschineControlSurface

use of de.mossgrabers.controller.ni.maschine.mk3.controller.MaschineControlSurface in project DrivenByMoss by git-moss.

the class MaschineControllerSetup method createViews.

/**
 * {@inheritDoc}
 */
@Override
protected void createViews() {
    final MaschineControlSurface surface = this.getSurface();
    final ViewManager viewManager = surface.getViewManager();
    viewManager.register(Views.SCENE_PLAY, new SceneView(surface, this.model));
    viewManager.register(Views.CLIP, new ClipView(surface, this.model));
    final DrumView drumView = new DrumView(surface, this.model);
    viewManager.register(Views.DRUM, drumView);
    viewManager.register(Views.PLAY, new PlayView(surface, this.model, drumView));
    viewManager.register(Views.DEVICE, new ParameterView(surface, this.model));
    if (!this.maschine.hasGroupButtons()) {
        viewManager.register(Views.TRACK_SELECT, new SelectView(surface, this.model));
        viewManager.register(Views.TRACK_SOLO, new SoloView(surface, this.model));
        viewManager.register(Views.TRACK_MUTE, new MuteView(surface, this.model));
    }
    viewManager.register(Views.REPEAT_NOTE, new NoteRepeatView(surface, this.model));
    this.shiftView = new ShiftView(surface, this.model);
    viewManager.register(Views.SHIFT, this.shiftView);
}
Also used : SoloView(de.mossgrabers.controller.ni.maschine.mk3.view.SoloView) MuteView(de.mossgrabers.controller.ni.maschine.mk3.view.MuteView) ShiftView(de.mossgrabers.controller.ni.maschine.mk3.view.ShiftView) SceneView(de.mossgrabers.controller.ni.maschine.mk3.view.SceneView) ViewManager(de.mossgrabers.framework.featuregroup.ViewManager) ClipView(de.mossgrabers.controller.ni.maschine.mk3.view.ClipView) MaschineControlSurface(de.mossgrabers.controller.ni.maschine.mk3.controller.MaschineControlSurface) ParameterView(de.mossgrabers.controller.ni.maschine.mk3.view.ParameterView) DrumView(de.mossgrabers.controller.ni.maschine.mk3.view.DrumView) PlayView(de.mossgrabers.controller.ni.maschine.mk3.view.PlayView) SelectView(de.mossgrabers.controller.ni.maschine.mk3.view.SelectView) NoteRepeatView(de.mossgrabers.controller.ni.maschine.mk3.view.NoteRepeatView)

Example 14 with MaschineControlSurface

use of de.mossgrabers.controller.ni.maschine.mk3.controller.MaschineControlSurface in project DrivenByMoss by git-moss.

the class MaschineControllerSetup method createModes.

/**
 * {@inheritDoc}
 */
@Override
protected void createModes() {
    final MaschineControlSurface surface = this.getSurface();
    final ModeManager modeManager = surface.getModeManager();
    modeManager.register(Modes.BROWSER, new BrowseMode(surface, this.model));
    modeManager.register(Modes.VOLUME, new MaschineVolumeMode(surface, this.model));
    modeManager.register(Modes.PAN, new MaschinePanMode(surface, this.model));
    for (int i = 0; i < 8; i++) modeManager.register(Modes.get(Modes.SEND1, i), new MaschineSendMode(i, surface, this.model));
    modeManager.register(Modes.TEMPO, new TempoMode(surface, this.model));
    modeManager.register(Modes.POSITION, new PositionMode(surface, this.model));
    modeManager.register(Modes.LOOP_START, new LoopStartMode(surface, this.model));
    modeManager.register(Modes.LOOP_LENGTH, new LoopLengthMode(surface, this.model));
    modeManager.register(Modes.REPEAT_NOTE, new NoteRepeatMode(surface, this.model));
    modeManager.register(Modes.SCALES, new PlayConfigurationMode(surface, this.model));
    modeManager.register(Modes.PLAY_OPTIONS, new DrumConfigurationMode(surface, this.model));
    modeManager.register(Modes.NOTE, new EditNoteMode(surface, this.model));
    modeManager.register(Modes.DEVICE_PARAMS, new MaschineParametersMode(surface, this.model));
    if (this.maschine.hasMCUDisplay())
        modeManager.register(Modes.USER, new MaschineUserMode(surface, this.model));
    modeManager.setDefaultID(Modes.VOLUME);
}
Also used : PositionMode(de.mossgrabers.controller.ni.maschine.mk3.mode.PositionMode) PlayConfigurationMode(de.mossgrabers.controller.ni.maschine.mk3.mode.PlayConfigurationMode) MaschineParametersMode(de.mossgrabers.controller.ni.maschine.mk3.mode.MaschineParametersMode) MaschineUserMode(de.mossgrabers.controller.ni.maschine.mk3.mode.MaschineUserMode) DrumConfigurationMode(de.mossgrabers.controller.ni.maschine.mk3.mode.DrumConfigurationMode) MaschineControlSurface(de.mossgrabers.controller.ni.maschine.mk3.controller.MaschineControlSurface) BrowseMode(de.mossgrabers.controller.ni.maschine.mk3.mode.BrowseMode) MaschinePanMode(de.mossgrabers.controller.ni.maschine.mk3.mode.MaschinePanMode) MaschineSendMode(de.mossgrabers.controller.ni.maschine.mk3.mode.MaschineSendMode) TempoMode(de.mossgrabers.controller.ni.maschine.mk3.mode.TempoMode) LoopLengthMode(de.mossgrabers.controller.ni.maschine.mk3.mode.LoopLengthMode) EditNoteMode(de.mossgrabers.controller.ni.maschine.mk3.mode.EditNoteMode) MaschineVolumeMode(de.mossgrabers.controller.ni.maschine.mk3.mode.MaschineVolumeMode) NoteRepeatMode(de.mossgrabers.controller.ni.maschine.mk3.mode.NoteRepeatMode) LoopStartMode(de.mossgrabers.controller.ni.maschine.mk3.mode.LoopStartMode) ModeManager(de.mossgrabers.framework.featuregroup.ModeManager) StudioEncoderModeManager(de.mossgrabers.controller.ni.maschine.mk3.controller.StudioEncoderModeManager)

Example 15 with MaschineControlSurface

use of de.mossgrabers.controller.ni.maschine.mk3.controller.MaschineControlSurface in project DrivenByMoss by git-moss.

the class MaschineControllerSetup method createSurface.

/**
 * {@inheritDoc}
 */
@Override
protected void createSurface() {
    final IMidiAccess midiAccess = this.factory.createMidiAccess();
    final IMidiOutput output = midiAccess.createOutput();
    final IMidiInput input = midiAccess.createInput(this.maschine.getName(), "80????", "90????", "A0????", "D0????");
    final MaschineControlSurface surface = new MaschineControlSurface(this.host, this.colorManager, this.maschine, this.configuration, output, input);
    this.surfaces.add(surface);
    if (this.maschine.hasMCUDisplay()) {
        final MCUDisplay display = new MCUDisplay(this.host, output, true, false, false);
        display.setCenterNotification(false);
        surface.addTextDisplay(display);
    }
}
Also used : IMidiAccess(de.mossgrabers.framework.daw.midi.IMidiAccess) IMidiOutput(de.mossgrabers.framework.daw.midi.IMidiOutput) MCUDisplay(de.mossgrabers.controller.mackie.mcu.controller.MCUDisplay) IMidiInput(de.mossgrabers.framework.daw.midi.IMidiInput) MaschineControlSurface(de.mossgrabers.controller.ni.maschine.mk3.controller.MaschineControlSurface)

Aggregations

MaschineControlSurface (de.mossgrabers.controller.ni.maschine.mk3.controller.MaschineControlSurface)14 StudioEncoderModeManager (de.mossgrabers.controller.ni.maschine.mk3.controller.StudioEncoderModeManager)4 ModeManager (de.mossgrabers.framework.featuregroup.ModeManager)4 ViewManager (de.mossgrabers.framework.featuregroup.ViewManager)4 IMidiOutput (de.mossgrabers.framework.daw.midi.IMidiOutput)3 TouchstripCommand (de.mossgrabers.controller.ni.maschine.mk3.command.continuous.TouchstripCommand)2 DrumView (de.mossgrabers.controller.ni.maschine.mk3.view.DrumView)2 ITrack (de.mossgrabers.framework.daw.data.ITrack)2 IMidiInput (de.mossgrabers.framework.daw.midi.IMidiInput)2 IMode (de.mossgrabers.framework.featuregroup.IMode)2 MCUDisplay (de.mossgrabers.controller.mackie.mcu.controller.MCUDisplay)1 EncoderMode (de.mossgrabers.controller.ni.maschine.core.command.trigger.EncoderMode)1 MaschineMonitorEncoderCommand (de.mossgrabers.controller.ni.maschine.core.command.trigger.MaschineMonitorEncoderCommand)1 MainKnobRowModeCommand (de.mossgrabers.controller.ni.maschine.mk3.command.continuous.MainKnobRowModeCommand)1 AddDeviceCommand (de.mossgrabers.controller.ni.maschine.mk3.command.trigger.AddDeviceCommand)1 KeyboardCommand (de.mossgrabers.controller.ni.maschine.mk3.command.trigger.KeyboardCommand)1 MaschineCursorCommand (de.mossgrabers.controller.ni.maschine.mk3.command.trigger.MaschineCursorCommand)1 MaschineSelectButtonCommand (de.mossgrabers.controller.ni.maschine.mk3.command.trigger.MaschineSelectButtonCommand)1 MaschineSendSelectCommand (de.mossgrabers.controller.ni.maschine.mk3.command.trigger.MaschineSendSelectCommand)1 MaschineStopCommand (de.mossgrabers.controller.ni.maschine.mk3.command.trigger.MaschineStopCommand)1