Search in sources :

Example 1 with BeatstepControlSurface

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

the class BeatstepControllerSetup method updateIndication.

private void updateIndication() {
    final BeatstepControlSurface surface = this.getSurface();
    final ViewManager viewManager = surface.getViewManager();
    final boolean isTrack = viewManager.isActiveView(Views.VIEW_TRACK);
    final boolean isDevice = viewManager.isActiveView(Views.VIEW_DEVICE);
    final boolean isSession = viewManager.isActiveView(Views.VIEW_SESSION);
    final IMasterTrack mt = this.model.getMasterTrack();
    mt.setVolumeIndication(!isDevice);
    final ITrackBank tb = this.model.getTrackBank();
    final ITrack selectedTrack = tb.getSelectedTrack();
    final IChannelBank tbe = this.model.getEffectTrackBank();
    final ITrack selectedFXTrack = tbe.getSelectedTrack();
    final ICursorDevice cursorDevice = this.model.getCursorDevice();
    final boolean isEffect = this.model.isEffectTrackBankActive();
    tb.setIndication(!isEffect && isSession);
    tbe.setIndication(isEffect && isSession);
    for (int i = 0; i < 8; i++) {
        final boolean hasTrackSel = selectedTrack != null && selectedTrack.getIndex() == i;
        final ITrack track = tb.getTrack(i);
        track.setVolumeIndication(!isEffect && hasTrackSel && !isDevice);
        track.setPanIndication(!isEffect && hasTrackSel && !isDevice);
        for (int j = 0; j < 6; j++) track.getSend(j).setIndication(!isEffect && hasTrackSel && isTrack);
        final boolean hasFXTrackSel = selectedFXTrack != null && selectedFXTrack.getIndex() == i;
        final ITrack fxTrack = tbe.getTrack(i);
        fxTrack.setVolumeIndication(isEffect && hasFXTrackSel && isTrack);
        fxTrack.setPanIndication(isEffect && hasFXTrackSel && isTrack);
        cursorDevice.indicateParameter(i, isDevice);
    }
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) ITrackBank(de.mossgrabers.framework.daw.ITrackBank) IChannelBank(de.mossgrabers.framework.daw.IChannelBank) ViewManager(de.mossgrabers.framework.view.ViewManager) BeatstepControlSurface(de.mossgrabers.beatstep.controller.BeatstepControlSurface) IMasterTrack(de.mossgrabers.framework.daw.data.IMasterTrack) ICursorDevice(de.mossgrabers.framework.daw.ICursorDevice)

Example 2 with BeatstepControlSurface

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

the class BeatstepControllerSetup method startup.

/**
 * {@inheritDoc}
 */
@Override
public void startup() {
    // Enable Shift button to send Midi Note 07
    final BeatstepControlSurface surface = this.getSurface();
    surface.getOutput().sendSysex("F0 00 20 6B 7F 42 02 00 01 5E 09 F7");
    surface.getViewManager().setActiveView(Views.VIEW_TRACK);
}
Also used : BeatstepControlSurface(de.mossgrabers.beatstep.controller.BeatstepControlSurface)

Example 3 with BeatstepControlSurface

use of de.mossgrabers.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.registerView(Views.VIEW_TRACK, new TrackView(surface, this.model));
    viewManager.registerView(Views.VIEW_DEVICE, new DeviceView(surface, this.model));
    viewManager.registerView(Views.VIEW_PLAY, new PlayView(surface, this.model));
    viewManager.registerView(Views.VIEW_DRUM, new DrumView(surface, this.model));
    viewManager.registerView(Views.VIEW_SEQUENCER, new SequencerView(surface, this.model));
    viewManager.registerView(Views.VIEW_SESSION, new SessionView(surface, this.model));
    viewManager.registerView(Views.VIEW_BROWSER, new BrowserView(surface, this.model));
    viewManager.registerView(Views.VIEW_SHIFT, new ShiftView(surface, this.model));
}
Also used : SequencerView(de.mossgrabers.beatstep.view.SequencerView) TrackView(de.mossgrabers.beatstep.view.TrackView) ShiftView(de.mossgrabers.beatstep.view.ShiftView) ViewManager(de.mossgrabers.framework.view.ViewManager) SessionView(de.mossgrabers.beatstep.view.SessionView) DeviceView(de.mossgrabers.beatstep.view.DeviceView) BrowserView(de.mossgrabers.beatstep.view.BrowserView) BeatstepControlSurface(de.mossgrabers.beatstep.controller.BeatstepControlSurface) DrumView(de.mossgrabers.beatstep.view.DrumView) PlayView(de.mossgrabers.beatstep.view.PlayView)

Example 4 with BeatstepControlSurface

use of de.mossgrabers.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", "82????", "92????", "A2????", "B2????");
    // Sequencer 1 is on channel 1
    input.createNoteInput("Seq. 1", "90????", "80????");
    // Setup the 2 note sequencers and 1 drum sequencer
    if (this.isPro) {
        // Sequencer 2 is on channel 2
        input.createNoteInput("Seq. 2", "91????", "81????");
        // Drum Sequencer is on channel 10
        input.createNoteInput("Drums", "99????", "89????");
    }
    final BeatstepControlSurface surface = new BeatstepControlSurface(this.model.getHost(), this.colorManager, this.configuration, output, input, this.isPro);
    this.surfaces.add(surface);
    surface.setDisplay(new DummyDisplay(this.host));
}
Also used : IMidiAccess(de.mossgrabers.framework.daw.midi.IMidiAccess) IMidiOutput(de.mossgrabers.framework.daw.midi.IMidiOutput) DummyDisplay(de.mossgrabers.framework.controller.display.DummyDisplay) IMidiInput(de.mossgrabers.framework.daw.midi.IMidiInput) BeatstepControlSurface(de.mossgrabers.beatstep.controller.BeatstepControlSurface)

Example 5 with BeatstepControlSurface

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

the class BeatstepControllerSetup method registerContinuousCommands.

/**
 * {@inheritDoc}
 */
@Override
protected void registerContinuousCommands() {
    final BeatstepControlSurface surface = this.getSurface();
    final ViewManager viewManager = surface.getViewManager();
    for (int i = 0; i < 8; i++) {
        this.addContinuousCommand(Integer.valueOf(Commands.CONT_COMMAND_KNOB1.intValue() + i), BeatstepControlSurface.BEATSTEP_KNOB_1 + i, new KnobRowViewCommand(i, this.model, surface));
        this.addContinuousCommand(Integer.valueOf(Commands.CONT_COMMAND_DEVICE_KNOB1.intValue() + i), BeatstepControlSurface.BEATSTEP_KNOB_9 + i, new KnobRowViewCommand(i + 8, this.model, surface));
    }
    this.addContinuousCommand(Commands.CONT_COMMAND_MASTER_KNOB, BeatstepControlSurface.BEATSTEP_KNOB_MAIN, new BeatstepPlayPositionCommand(this.model, surface));
    final PlayView playView = (PlayView) viewManager.getView(Views.VIEW_PLAY);
    playView.registerAftertouchCommand(new AftertouchAbstractPlayViewCommand<>(playView, this.model, surface));
}
Also used : KnobRowViewCommand(de.mossgrabers.beatstep.command.continuous.KnobRowViewCommand) ViewManager(de.mossgrabers.framework.view.ViewManager) BeatstepPlayPositionCommand(de.mossgrabers.beatstep.command.continuous.BeatstepPlayPositionCommand) BeatstepControlSurface(de.mossgrabers.beatstep.controller.BeatstepControlSurface) PlayView(de.mossgrabers.beatstep.view.PlayView)

Aggregations

BeatstepControlSurface (de.mossgrabers.beatstep.controller.BeatstepControlSurface)5 ViewManager (de.mossgrabers.framework.view.ViewManager)3 PlayView (de.mossgrabers.beatstep.view.PlayView)2 BeatstepPlayPositionCommand (de.mossgrabers.beatstep.command.continuous.BeatstepPlayPositionCommand)1 KnobRowViewCommand (de.mossgrabers.beatstep.command.continuous.KnobRowViewCommand)1 BrowserView (de.mossgrabers.beatstep.view.BrowserView)1 DeviceView (de.mossgrabers.beatstep.view.DeviceView)1 DrumView (de.mossgrabers.beatstep.view.DrumView)1 SequencerView (de.mossgrabers.beatstep.view.SequencerView)1 SessionView (de.mossgrabers.beatstep.view.SessionView)1 ShiftView (de.mossgrabers.beatstep.view.ShiftView)1 TrackView (de.mossgrabers.beatstep.view.TrackView)1 DummyDisplay (de.mossgrabers.framework.controller.display.DummyDisplay)1 IChannelBank (de.mossgrabers.framework.daw.IChannelBank)1 ICursorDevice (de.mossgrabers.framework.daw.ICursorDevice)1 ITrackBank (de.mossgrabers.framework.daw.ITrackBank)1 IMasterTrack (de.mossgrabers.framework.daw.data.IMasterTrack)1 ITrack (de.mossgrabers.framework.daw.data.ITrack)1 IMidiAccess (de.mossgrabers.framework.daw.midi.IMidiAccess)1 IMidiInput (de.mossgrabers.framework.daw.midi.IMidiInput)1