Search in sources :

Example 6 with Kontrol1ControlSurface

use of de.mossgrabers.controller.ni.kontrol.mki.controller.Kontrol1ControlSurface in project DrivenByMoss by git-moss.

the class Kontrol1ControllerSetup method registerContinuousCommands.

/**
 * {@inheritDoc}
 */
@Override
protected void registerContinuousCommands() {
    final Kontrol1ControlSurface surface = this.getSurface();
    final IMidiInput input = surface.getMidiInput();
    for (int i = 0; i < 8; i++) {
        final IHwRelativeKnob knob = this.addRelativeKnob(ContinuousID.get(ContinuousID.KNOB1, i), "Knob " + (i + 1), new KnobRowModeCommand<>(i, this.model, surface), Kontrol1ControlSurface.ENCODER_1 + i);
        knob.bindTouch(new KnobRowTouchModeCommand<>(i, this.model, surface), input, BindType.CC, 0, Kontrol1ControlSurface.TOUCH_ENCODER_1 + i);
        knob.setIndexInGroup(i);
    }
    this.addRelativeKnob(ContinuousID.MASTER_KNOB, "Master", new MainEncoderCommand(this.model, surface), Kontrol1ControlSurface.MAIN_ENCODER);
    surface.addPianoKeyboard(25, input, true);
}
Also used : IHwRelativeKnob(de.mossgrabers.framework.controller.hardware.IHwRelativeKnob) Kontrol1ControlSurface(de.mossgrabers.controller.ni.kontrol.mki.controller.Kontrol1ControlSurface) IMidiInput(de.mossgrabers.framework.daw.midi.IMidiInput) MainEncoderCommand(de.mossgrabers.controller.ni.kontrol.mki.command.continuous.MainEncoderCommand)

Example 7 with Kontrol1ControlSurface

use of de.mossgrabers.controller.ni.kontrol.mki.controller.Kontrol1ControlSurface in project DrivenByMoss by git-moss.

the class Kontrol1ControllerSetup method startup.

/**
 * {@inheritDoc}
 */
@Override
public void startup() {
    final Kontrol1ControlSurface surface = this.getSurface();
    surface.getViewManager().setActive(Views.CONTROL);
    surface.getModeManager().setActive(Modes.TRACK);
}
Also used : Kontrol1ControlSurface(de.mossgrabers.controller.ni.kontrol.mki.controller.Kontrol1ControlSurface)

Example 8 with Kontrol1ControlSurface

use of de.mossgrabers.controller.ni.kontrol.mki.controller.Kontrol1ControlSurface in project DrivenByMoss by git-moss.

the class Kontrol1ControllerSetup method registerTriggerCommands.

/**
 * {@inheritDoc}
 */
@Override
protected void registerTriggerCommands() {
    final Kontrol1ControlSurface surface = this.getSurface();
    final ITransport t = this.model.getTransport();
    this.addButton(ButtonID.SCALES, "Scales", new ScaleButtonCommand(this.model, surface), Kontrol1ControlSurface.BUTTON_SCALE, this.configuration::isScaleIsActive);
    this.addButton(ButtonID.METRONOME, "Metronome", new MetronomeCommand<>(this.model, surface, false), Kontrol1ControlSurface.BUTTON_ARP, () -> surface.isShiftPressed() && t.isMetronomeTicksOn() || !surface.isShiftPressed() && t.isMetronomeOn());
    this.addButton(ButtonID.PLAY, "PLAY", new Kontrol1PlayCommand(this.model, surface), Kontrol1ControlSurface.BUTTON_PLAY, t::isPlaying);
    this.addButton(ButtonID.RECORD, "REC", new RecordCommand<>(this.model, surface), Kontrol1ControlSurface.BUTTON_REC, t::isRecording);
    this.addButton(ButtonID.STOP, "STOP", new StopCommand<>(this.model, surface), Kontrol1ControlSurface.BUTTON_STOP, () -> !t.isPlaying());
    this.addButton(ButtonID.REWIND, "RWD", new WindCommand<>(this.model, surface, false), Kontrol1ControlSurface.BUTTON_RWD, () -> surface.isPressed(ButtonID.REWIND));
    this.addButton(ButtonID.FORWARD, "FFW", new WindCommand<>(this.model, surface, true), Kontrol1ControlSurface.BUTTON_FWD, () -> surface.isPressed(ButtonID.FORWARD));
    this.addButton(ButtonID.LOOP, "LOOP", new ToggleLoopCommand<>(this.model, surface), Kontrol1ControlSurface.BUTTON_LOOP, t::isLoop);
    this.addButton(ButtonID.PAGE_LEFT, "Left", new ModeMultiSelectCommand<>(this.model, surface, Modes.DEVICE_PARAMS, Modes.VOLUME, Modes.TRACK), Kontrol1ControlSurface.BUTTON_PAGE_LEFT);
    this.addButton(ButtonID.PAGE_RIGHT, "Right", new ModeMultiSelectCommand<>(this.model, surface, Modes.TRACK, Modes.VOLUME, Modes.DEVICE_PARAMS), Kontrol1ControlSurface.BUTTON_PAGE_RIGHT);
    // Put this on channel 16 to not conflict with the modulation wheel
    this.addButton(ButtonID.MASTERTRACK, "Encoder", new MainEncoderButtonCommand(this.model, surface), 15, Kontrol1ControlSurface.BUTTON_MAIN_ENCODER);
    final Kontrol1CursorCommand commandDown = new Kontrol1CursorCommand(Direction.DOWN, this.model, surface);
    this.addButton(ButtonID.ARROW_DOWN, "Down", commandDown, Kontrol1ControlSurface.BUTTON_NAVIGATE_DOWN, commandDown::canScroll);
    final Kontrol1CursorCommand commandUp = new Kontrol1CursorCommand(Direction.UP, this.model, surface);
    this.addButton(ButtonID.ARROW_UP, "Up", commandUp, Kontrol1ControlSurface.BUTTON_NAVIGATE_UP, commandUp::canScroll);
    final Kontrol1CursorCommand commandLeft = new Kontrol1CursorCommand(Direction.LEFT, this.model, surface);
    this.addButton(ButtonID.ARROW_LEFT, "Left", commandLeft, Kontrol1ControlSurface.BUTTON_NAVIGATE_LEFT, commandLeft::canScroll);
    final Kontrol1CursorCommand commandRight = new Kontrol1CursorCommand(Direction.RIGHT, this.model, surface);
    this.addButton(ButtonID.ARROW_RIGHT, "Right", commandRight, Kontrol1ControlSurface.BUTTON_NAVIGATE_RIGHT, commandRight::canScroll);
    this.addButton(ButtonID.MUTE, "Back", new BackButtonCommand(this.model, surface), Kontrol1ControlSurface.BUTTON_BACK, () -> this.getModeColor(ButtonID.MUTE));
    this.addButton(ButtonID.SOLO, "Enter", new EnterButtonCommand(this.model, surface), Kontrol1ControlSurface.BUTTON_ENTER, () -> this.getModeColor(ButtonID.SOLO));
    this.addButton(ButtonID.BROWSE, "Browse", new BrowserCommand<>(this.model, surface, ButtonID.SHIFT, null), Kontrol1ControlSurface.BUTTON_BROWSE, () -> this.getModeColor(ButtonID.BROWSE));
    this.addButton(ButtonID.SHIFT, "Shift", NopCommand.INSTANCE, Kontrol1ControlSurface.BUTTON_SHIFT);
}
Also used : Kontrol1ControlSurface(de.mossgrabers.controller.ni.kontrol.mki.controller.Kontrol1ControlSurface) ITransport(de.mossgrabers.framework.daw.ITransport) EnterButtonCommand(de.mossgrabers.controller.ni.kontrol.mki.command.trigger.EnterButtonCommand) MainEncoderButtonCommand(de.mossgrabers.controller.ni.kontrol.mki.command.trigger.MainEncoderButtonCommand) ScaleButtonCommand(de.mossgrabers.controller.ni.kontrol.mki.command.trigger.ScaleButtonCommand) IMidiInput(de.mossgrabers.framework.daw.midi.IMidiInput) ITransport(de.mossgrabers.framework.daw.ITransport) IHost(de.mossgrabers.framework.daw.IHost) BackButtonCommand(de.mossgrabers.controller.ni.kontrol.mki.command.trigger.BackButtonCommand) Kontrol1PlayCommand(de.mossgrabers.controller.ni.kontrol.mki.command.trigger.Kontrol1PlayCommand) Kontrol1CursorCommand(de.mossgrabers.controller.ni.kontrol.mki.command.trigger.Kontrol1CursorCommand)

Aggregations

Kontrol1ControlSurface (de.mossgrabers.controller.ni.kontrol.mki.controller.Kontrol1ControlSurface)8 IMidiInput (de.mossgrabers.framework.daw.midi.IMidiInput)3 MainEncoderCommand (de.mossgrabers.controller.ni.kontrol.mki.command.continuous.MainEncoderCommand)1 BackButtonCommand (de.mossgrabers.controller.ni.kontrol.mki.command.trigger.BackButtonCommand)1 EnterButtonCommand (de.mossgrabers.controller.ni.kontrol.mki.command.trigger.EnterButtonCommand)1 Kontrol1CursorCommand (de.mossgrabers.controller.ni.kontrol.mki.command.trigger.Kontrol1CursorCommand)1 Kontrol1PlayCommand (de.mossgrabers.controller.ni.kontrol.mki.command.trigger.Kontrol1PlayCommand)1 MainEncoderButtonCommand (de.mossgrabers.controller.ni.kontrol.mki.command.trigger.MainEncoderButtonCommand)1 ScaleButtonCommand (de.mossgrabers.controller.ni.kontrol.mki.command.trigger.ScaleButtonCommand)1 Kontrol1Display (de.mossgrabers.controller.ni.kontrol.mki.controller.Kontrol1Display)1 Kontrol1UsbDevice (de.mossgrabers.controller.ni.kontrol.mki.controller.Kontrol1UsbDevice)1 ScaleMode (de.mossgrabers.controller.ni.kontrol.mki.mode.ScaleMode)1 BrowseMode (de.mossgrabers.controller.ni.kontrol.mki.mode.device.BrowseMode)1 ParamsMode (de.mossgrabers.controller.ni.kontrol.mki.mode.device.ParamsMode)1 TrackMode (de.mossgrabers.controller.ni.kontrol.mki.mode.track.TrackMode)1 VolumeMode (de.mossgrabers.controller.ni.kontrol.mki.mode.track.VolumeMode)1 ControlView (de.mossgrabers.controller.ni.kontrol.mki.view.ControlView)1 IHwRelativeKnob (de.mossgrabers.framework.controller.hardware.IHwRelativeKnob)1 IHost (de.mossgrabers.framework.daw.IHost)1 ITransport (de.mossgrabers.framework.daw.ITransport)1