Search in sources :

Example 1 with BeatstepControlSurface

use of de.mossgrabers.controller.arturia.beatstep.controller.BeatstepControlSurface in project DrivenByMoss by git-moss.

the class BeatstepControllerSetup method registerTriggerCommands.

/**
 * {@inheritDoc}
 */
@Override
protected void registerTriggerCommands() {
    final BeatstepControlSurface surface = this.getSurface();
    final ViewManager viewManager = surface.getViewManager();
    this.addButton(ButtonID.SHIFT, "Shift", (event, value) -> {
        if (event == ButtonEvent.DOWN) {
            viewManager.setActive(Views.SHIFT);
            return;
        }
        if (event == ButtonEvent.UP) {
            if (viewManager.isActive(Views.SHIFT))
                viewManager.restore();
            // Red LED is turned off on button release, restore the correct color
            final BeatstepPadGrid beatstepPadGrid = (BeatstepPadGrid) surface.getPadGrid();
            for (int note = 36; note < 52; note++) {
                final LightInfo lightInfo = beatstepPadGrid.getLightInfo(note);
                beatstepPadGrid.lightPad(note, lightInfo.getColor());
            }
        }
    }, BeatstepControlSurface.BEATSTEP_SHIFT);
}
Also used : ViewManager(de.mossgrabers.framework.featuregroup.ViewManager) BeatstepControlSurface(de.mossgrabers.controller.arturia.beatstep.controller.BeatstepControlSurface) BeatstepPadGrid(de.mossgrabers.controller.arturia.beatstep.controller.BeatstepPadGrid) LightInfo(de.mossgrabers.framework.controller.grid.LightInfo)

Example 2 with BeatstepControlSurface

use of de.mossgrabers.controller.arturia.beatstep.controller.BeatstepControlSurface in project DrivenByMoss by git-moss.

the class BeatstepControllerSetup method layoutControls.

/**
 * {@inheritDoc}
 */
@Override
protected void layoutControls() {
    final BeatstepControlSurface surface = this.getSurface();
    surface.getButton(ButtonID.PAD1).setBounds(145.25, 232.75, 57.0, 55.5);
    surface.getButton(ButtonID.PAD2).setBounds(222.5, 232.75, 57.0, 55.5);
    surface.getButton(ButtonID.PAD3).setBounds(302.75, 232.75, 57.0, 55.5);
    surface.getButton(ButtonID.PAD4).setBounds(382.75, 232.75, 57.0, 55.5);
    surface.getButton(ButtonID.PAD5).setBounds(463.0, 232.75, 57.0, 55.5);
    surface.getButton(ButtonID.PAD6).setBounds(543.0, 232.75, 57.0, 55.5);
    surface.getButton(ButtonID.PAD7).setBounds(623.25, 232.75, 57.0, 55.5);
    surface.getButton(ButtonID.PAD8).setBounds(703.25, 232.75, 57.0, 55.5);
    surface.getButton(ButtonID.PAD9).setBounds(145.25, 151.75, 57.0, 55.5);
    surface.getButton(ButtonID.PAD10).setBounds(222.5, 151.75, 57.0, 55.5);
    surface.getButton(ButtonID.PAD11).setBounds(302.75, 151.75, 57.0, 55.5);
    surface.getButton(ButtonID.PAD12).setBounds(382.75, 151.75, 57.0, 55.5);
    surface.getButton(ButtonID.PAD13).setBounds(463.0, 151.75, 57.0, 55.5);
    surface.getButton(ButtonID.PAD14).setBounds(543.0, 151.75, 57.0, 55.5);
    surface.getButton(ButtonID.PAD15).setBounds(623.25, 151.75, 57.0, 55.5);
    surface.getButton(ButtonID.PAD16).setBounds(703.25, 151.75, 57.0, 55.5);
    surface.getButton(ButtonID.SHIFT).setBounds(45.5, 262.0, 30.25, 30.25);
    surface.getContinuous(ContinuousID.DEVICE_KNOB1).setBounds(155.25, 92.25, 35.0, 32.5);
    surface.getContinuous(ContinuousID.DEVICE_KNOB2).setBounds(237.0, 92.25, 35.0, 32.5);
    surface.getContinuous(ContinuousID.DEVICE_KNOB3).setBounds(318.75, 92.25, 35.0, 32.5);
    surface.getContinuous(ContinuousID.DEVICE_KNOB4).setBounds(400.5, 92.25, 35.0, 32.5);
    surface.getContinuous(ContinuousID.DEVICE_KNOB5).setBounds(482.25, 92.25, 35.0, 32.5);
    surface.getContinuous(ContinuousID.DEVICE_KNOB6).setBounds(564.0, 92.25, 35.0, 32.5);
    surface.getContinuous(ContinuousID.DEVICE_KNOB7).setBounds(646.0, 92.25, 35.0, 32.5);
    surface.getContinuous(ContinuousID.DEVICE_KNOB8).setBounds(727.75, 92.25, 35.0, 32.5);
    surface.getContinuous(ContinuousID.KNOB1).setBounds(155.25, 19.5, 35.0, 32.5);
    surface.getContinuous(ContinuousID.KNOB2).setBounds(237.0, 19.5, 35.0, 32.5);
    surface.getContinuous(ContinuousID.KNOB3).setBounds(318.75, 19.5, 35.0, 32.5);
    surface.getContinuous(ContinuousID.KNOB4).setBounds(400.5, 19.5, 35.0, 32.5);
    surface.getContinuous(ContinuousID.KNOB5).setBounds(482.25, 19.5, 35.0, 32.5);
    surface.getContinuous(ContinuousID.KNOB6).setBounds(564.0, 19.5, 35.0, 32.5);
    surface.getContinuous(ContinuousID.KNOB7).setBounds(646.0, 19.5, 35.0, 32.5);
    surface.getContinuous(ContinuousID.KNOB8).setBounds(727.75, 19.5, 35.0, 32.5);
    surface.getContinuous(ContinuousID.MASTER_KNOB).setBounds(39.75, 30.5, 75.5, 77.75);
}
Also used : BeatstepControlSurface(de.mossgrabers.controller.arturia.beatstep.controller.BeatstepControlSurface)

Example 3 with BeatstepControlSurface

use of de.mossgrabers.controller.arturia.beatstep.controller.BeatstepControlSurface in project DrivenByMoss by git-moss.

the class BeatstepControllerSetup method createSurface.

/**
 * {@inheritDoc}
 */
@Override
protected void createSurface() {
    final IMidiAccess midiAccess = this.factory.createMidiAccess();
    final IMidiOutput output = midiAccess.createOutput();
    final IMidiInput input = midiAccess.createInput("Control/Pads", "82????", "92????", "A2????");
    // Sequencer 1 is on channel 1
    final INoteInput seqNoteInput = input.createNoteInput("Hardware Sequencer", "90????", "80????");
    final Integer[] table = new Integer[128];
    for (int i = 0; i < 128; i++) {
        // Block the Shift key
        table[i] = Integer.valueOf(i == 7 ? -1 : i);
    }
    seqNoteInput.setKeyTranslationTable(table);
    this.surfaces.add(new BeatstepControlSurface(this.host, this.colorManager, this.configuration, output, input));
}
Also used : IMidiAccess(de.mossgrabers.framework.daw.midi.IMidiAccess) IMidiOutput(de.mossgrabers.framework.daw.midi.IMidiOutput) IMidiInput(de.mossgrabers.framework.daw.midi.IMidiInput) BeatstepControlSurface(de.mossgrabers.controller.arturia.beatstep.controller.BeatstepControlSurface) INoteInput(de.mossgrabers.framework.daw.midi.INoteInput)

Example 4 with BeatstepControlSurface

use of de.mossgrabers.controller.arturia.beatstep.controller.BeatstepControlSurface in project DrivenByMoss by git-moss.

the class BeatstepControllerSetup method updateIndication.

protected void updateIndication() {
    final BeatstepControlSurface surface = this.getSurface();
    final ViewManager viewManager = surface.getViewManager();
    final boolean isTrack = viewManager.isActive(Views.TRACK);
    final boolean isDevice = viewManager.isActive(Views.DEVICE);
    final boolean isSession = viewManager.isActive(Views.SESSION);
    final IMasterTrack mt = this.model.getMasterTrack();
    mt.setVolumeIndication(!isDevice);
    final ITrackBank tb = this.model.getTrackBank();
    final Optional<ITrack> selectedTrack = tb.getSelectedItem();
    final ITrackBank tbe = this.model.getEffectTrackBank();
    final ICursorDevice cursorDevice = this.model.getCursorDevice();
    final boolean isEffect = this.model.isEffectTrackBankActive();
    tb.setIndication(!isEffect && isSession);
    if (tbe != null)
        tbe.setIndication(isEffect && isSession);
    final IParameterBank parameterBank = cursorDevice.getParameterBank();
    for (int i = 0; i < 8; i++) {
        final boolean hasTrackSel = selectedTrack.isPresent() && selectedTrack.get().getIndex() == i;
        final ITrack track = tb.getItem(i);
        track.setVolumeIndication(!isEffect && hasTrackSel && !isDevice);
        track.setPanIndication(!isEffect && hasTrackSel && !isDevice);
        final ISendBank sendBank = track.getSendBank();
        for (int j = 0; j < 6; j++) sendBank.getItem(j).setIndication(!isEffect && hasTrackSel && isTrack);
        if (tbe != null) {
            final Optional<ITrack> selectedFXTrack = tbe.getSelectedItem();
            final boolean hasFXTrackSel = selectedFXTrack.isPresent() && selectedFXTrack.get().getIndex() == i;
            final ITrack fxTrack = tbe.getItem(i);
            fxTrack.setVolumeIndication(isEffect && hasFXTrackSel && isTrack);
            fxTrack.setPanIndication(isEffect && hasFXTrackSel && isTrack);
        }
        parameterBank.getItem(i).setIndication(isDevice);
    }
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) ITrackBank(de.mossgrabers.framework.daw.data.bank.ITrackBank) ViewManager(de.mossgrabers.framework.featuregroup.ViewManager) BeatstepControlSurface(de.mossgrabers.controller.arturia.beatstep.controller.BeatstepControlSurface) IParameterBank(de.mossgrabers.framework.daw.data.bank.IParameterBank) ISendBank(de.mossgrabers.framework.daw.data.bank.ISendBank) IMasterTrack(de.mossgrabers.framework.daw.data.IMasterTrack) ICursorDevice(de.mossgrabers.framework.daw.data.ICursorDevice)

Example 5 with BeatstepControlSurface

use of de.mossgrabers.controller.arturia.beatstep.controller.BeatstepControlSurface in project DrivenByMoss by git-moss.

the class BeatstepControllerSetup method createViews.

/**
 * {@inheritDoc}
 */
@Override
protected void createViews() {
    final BeatstepControlSurface surface = this.getSurface();
    final ViewManager viewManager = surface.getViewManager();
    viewManager.register(Views.TRACK, new TrackView(surface, this.model));
    viewManager.register(Views.DEVICE, new DeviceView(surface, this.model));
    viewManager.register(Views.PLAY, new PlayView(surface, this.model));
    viewManager.register(Views.DRUM, new DrumView(surface, this.model));
    viewManager.register(Views.SEQUENCER, new SequencerView(surface, this.model));
    viewManager.register(Views.SESSION, new SessionView(surface, this.model));
    viewManager.register(Views.BROWSER, new BrowserView(surface, this.model));
    viewManager.register(Views.SHIFT, new ShiftView(surface, this.model));
}
Also used : SequencerView(de.mossgrabers.controller.arturia.beatstep.view.SequencerView) TrackView(de.mossgrabers.controller.arturia.beatstep.view.TrackView) ShiftView(de.mossgrabers.controller.arturia.beatstep.view.ShiftView) ViewManager(de.mossgrabers.framework.featuregroup.ViewManager) SessionView(de.mossgrabers.controller.arturia.beatstep.view.SessionView) DeviceView(de.mossgrabers.controller.arturia.beatstep.view.DeviceView) BrowserView(de.mossgrabers.controller.arturia.beatstep.view.BrowserView) BeatstepControlSurface(de.mossgrabers.controller.arturia.beatstep.controller.BeatstepControlSurface) DrumView(de.mossgrabers.controller.arturia.beatstep.view.DrumView) PlayView(de.mossgrabers.controller.arturia.beatstep.view.PlayView)

Aggregations

BeatstepControlSurface (de.mossgrabers.controller.arturia.beatstep.controller.BeatstepControlSurface)7 ViewManager (de.mossgrabers.framework.featuregroup.ViewManager)4 PlayView (de.mossgrabers.controller.arturia.beatstep.view.PlayView)2 KnobRowViewCommand (de.mossgrabers.controller.arturia.beatstep.command.continuous.KnobRowViewCommand)1 BeatstepPadGrid (de.mossgrabers.controller.arturia.beatstep.controller.BeatstepPadGrid)1 BrowserView (de.mossgrabers.controller.arturia.beatstep.view.BrowserView)1 DeviceView (de.mossgrabers.controller.arturia.beatstep.view.DeviceView)1 DrumView (de.mossgrabers.controller.arturia.beatstep.view.DrumView)1 SequencerView (de.mossgrabers.controller.arturia.beatstep.view.SequencerView)1 SessionView (de.mossgrabers.controller.arturia.beatstep.view.SessionView)1 ShiftView (de.mossgrabers.controller.arturia.beatstep.view.ShiftView)1 TrackView (de.mossgrabers.controller.arturia.beatstep.view.TrackView)1 LightInfo (de.mossgrabers.framework.controller.grid.LightInfo)1 ICursorDevice (de.mossgrabers.framework.daw.data.ICursorDevice)1 IMasterTrack (de.mossgrabers.framework.daw.data.IMasterTrack)1 ITrack (de.mossgrabers.framework.daw.data.ITrack)1 IParameterBank (de.mossgrabers.framework.daw.data.bank.IParameterBank)1 ISendBank (de.mossgrabers.framework.daw.data.bank.ISendBank)1 ITrackBank (de.mossgrabers.framework.daw.data.bank.ITrackBank)1 IMidiAccess (de.mossgrabers.framework.daw.midi.IMidiAccess)1