Search in sources :

Example 6 with PushControlSurface

use of de.mossgrabers.push.controller.PushControlSurface in project DrivenByMoss by git-moss.

the class PushControllerSetup method registerTriggerCommands.

/**
 * {@inheritDoc}
 */
@Override
protected void registerTriggerCommands() {
    final PushControlSurface surface = this.getSurface();
    final ViewManager viewManager = surface.getViewManager();
    this.addTriggerCommand(Commands.COMMAND_PLAY, PushControlSurface.PUSH_BUTTON_PLAY, new PlayCommand<>(this.model, surface));
    this.addTriggerCommand(Commands.COMMAND_RECORD, PushControlSurface.PUSH_BUTTON_RECORD, new RecordCommand<>(this.model, surface));
    this.addTriggerCommand(Commands.COMMAND_NEW, PushControlSurface.PUSH_BUTTON_NEW, new NewCommand<>(this.model, surface));
    this.addTriggerCommand(Commands.COMMAND_DUPLICATE, PushControlSurface.PUSH_BUTTON_DUPLICATE, new DuplicateCommand<>(this.model, surface));
    this.addTriggerCommand(Commands.COMMAND_AUTOMATION, PushControlSurface.PUSH_BUTTON_AUTOMATION, new AutomationCommand(this.model, surface));
    this.addTriggerCommand(Commands.COMMAND_FIXED_LENGTH, PushControlSurface.PUSH_BUTTON_FIXED_LENGTH, new FixedLengthCommand(this.model, surface));
    this.addTriggerCommand(Commands.COMMAND_QUANTIZE, PushControlSurface.PUSH_BUTTON_QUANTIZE, new PushQuantizeCommand(this.model, surface));
    this.addTriggerCommand(Commands.COMMAND_DELETE, PushControlSurface.PUSH_BUTTON_DELETE, new DeleteCommand<>(this.model, surface));
    this.addTriggerCommand(Commands.COMMAND_DOUBLE, PushControlSurface.PUSH_BUTTON_DOUBLE, new DoubleCommand<>(this.model, surface));
    this.addTriggerCommand(Commands.COMMAND_UNDO, PushControlSurface.PUSH_BUTTON_UNDO, new UndoCommand<>(this.model, surface));
    this.addTriggerCommand(Commands.COMMAND_DEVICE, PushControlSurface.PUSH_BUTTON_DEVICE, new DeviceCommand(this.model, surface));
    this.addTriggerCommand(Commands.COMMAND_BROWSE, PushControlSurface.PUSH_BUTTON_BROWSE, new BrowserCommand<>(Modes.MODE_BROWSER, this.model, surface));
    this.addTriggerCommand(Commands.COMMAND_TRACK, PushControlSurface.PUSH_BUTTON_TRACK, new TrackCommand(this.model, surface));
    this.addTriggerCommand(Commands.COMMAND_CLIP, PushControlSurface.PUSH_BUTTON_CLIP, new ClipCommand(this.model, surface));
    this.addTriggerCommand(Commands.COMMAND_VOLUME, PushControlSurface.PUSH_BUTTON_VOLUME, new VolumeCommand(this.model, surface));
    this.addTriggerCommand(Commands.COMMAND_PAN_SEND, PushControlSurface.PUSH_BUTTON_PAN_SEND, new PanSendCommand(this.model, surface));
    for (int i = 0; i < 8; i++) {
        this.addTriggerCommand(Integer.valueOf(Commands.COMMAND_ROW1_1.intValue() + i), PushControlSurface.PUSH_BUTTON_ROW1_1 + i, new ButtonRowModeCommand<>(0, i, this.model, surface));
        this.addTriggerCommand(Integer.valueOf(Commands.COMMAND_ROW2_1.intValue() + i), PushControlSurface.PUSH_BUTTON_ROW2_1 + i, new ButtonRowModeCommand<>(1, i, this.model, surface));
        this.addTriggerCommand(Integer.valueOf(Commands.COMMAND_SCENE1.intValue() + i), PushControlSurface.PUSH_BUTTON_SCENE1 + i, new SceneCommand<>(i, this.model, surface));
    }
    this.addTriggerCommand(Commands.COMMAND_SHIFT, PushControlSurface.PUSH_BUTTON_SHIFT, new ShiftCommand(this.model, surface));
    this.addTriggerCommand(Commands.COMMAND_LAYOUT, PushControlSurface.PUSH_BUTTON_LAYOUT, new LayoutCommand(this.model, surface));
    this.addTriggerCommand(Commands.COMMAND_SELECT, PushControlSurface.PUSH_BUTTON_SELECT, new SelectCommand(this.model, surface));
    this.addTriggerCommand(Commands.COMMAND_TAP_TEMPO, PushControlSurface.PUSH_BUTTON_TAP, new TapTempoCommand<>(this.model, surface));
    this.addTriggerCommand(Commands.COMMAND_METRONOME, PushControlSurface.PUSH_BUTTON_METRONOME, new MetronomeCommand<>(this.model, surface));
    this.addTriggerCommand(Commands.COMMAND_MASTERTRACK, PushControlSurface.PUSH_BUTTON_MASTER, new MastertrackCommand(this.model, surface));
    this.addTriggerCommand(Commands.COMMAND_PAGE_LEFT, PushControlSurface.PUSH_BUTTON_DEVICE_LEFT, new PageLeftCommand(this.model, surface));
    this.addTriggerCommand(Commands.COMMAND_PAGE_RIGHT, PushControlSurface.PUSH_BUTTON_DEVICE_RIGHT, new PageRightCommand(this.model, surface));
    this.addTriggerCommand(Commands.COMMAND_MUTE, PushControlSurface.PUSH_BUTTON_MUTE, new MuteCommand(this.model, surface));
    this.addTriggerCommand(Commands.COMMAND_SOLO, PushControlSurface.PUSH_BUTTON_SOLO, new SoloCommand(this.model, surface));
    this.addTriggerCommand(Commands.COMMAND_SCALES, PushControlSurface.PUSH_BUTTON_SCALES, new ScalesCommand(this.model, surface));
    this.addTriggerCommand(Commands.COMMAND_ACCENT, PushControlSurface.PUSH_BUTTON_ACCENT, new AccentCommand(this.model, surface));
    this.addTriggerCommand(Commands.COMMAND_ADD_EFFECT, PushControlSurface.PUSH_BUTTON_ADD_EFFECT, new AddEffectCommand(this.model, surface));
    this.addTriggerCommand(Commands.COMMAND_ADD_TRACK, PushControlSurface.PUSH_BUTTON_ADD_TRACK, new AddTrackCommand(this.model, surface));
    this.addTriggerCommand(Commands.COMMAND_SELECT_PLAY_VIEW, PushControlSurface.PUSH_BUTTON_NOTE, new SelectPlayViewCommand(this.model, surface));
    this.addTriggerCommand(Commands.COMMAND_ARROW_DOWN, PushControlSurface.PUSH_BUTTON_DOWN, new PushCursorCommand(Direction.DOWN, this.model, surface));
    this.addTriggerCommand(Commands.COMMAND_ARROW_UP, PushControlSurface.PUSH_BUTTON_UP, new PushCursorCommand(Direction.UP, this.model, surface));
    this.addTriggerCommand(Commands.COMMAND_ARROW_LEFT, PushControlSurface.PUSH_BUTTON_LEFT, new PushCursorCommand(Direction.LEFT, this.model, surface));
    this.addTriggerCommand(Commands.COMMAND_ARROW_RIGHT, PushControlSurface.PUSH_BUTTON_RIGHT, new PushCursorCommand(Direction.RIGHT, this.model, surface));
    this.addTriggerCommand(Commands.COMMAND_OCTAVE_DOWN, PushControlSurface.PUSH_BUTTON_OCTAVE_DOWN, new OctaveCommand(false, this.model, surface));
    this.addTriggerCommand(Commands.COMMAND_OCTAVE_UP, PushControlSurface.PUSH_BUTTON_OCTAVE_UP, new OctaveCommand(true, this.model, surface));
    viewManager.registerTriggerCommand(Commands.COMMAND_SETUP, new SetupCommand(this.isPush2, this.model, surface));
    if (this.isPush2) {
        surface.assignTriggerCommand(PushControlSurface.PUSH_BUTTON_SETUP, Commands.COMMAND_SETUP);
        this.addTriggerCommand(Commands.COMMAND_CONVERT, PushControlSurface.PUSH_BUTTON_CONVERT, new ConvertCommand<>(this.model, surface));
    } else
        surface.assignTriggerCommand(PushControlSurface.PUSH_BUTTON_USER_MODE, Commands.COMMAND_SETUP);
    if (this.host.hasClips()) {
        this.addTriggerCommand(Commands.COMMAND_STOP_CLIP, PushControlSurface.PUSH_BUTTON_CLIP_STOP, new StopClipCommand<>(this.model, surface));
        this.addTriggerCommand(Commands.COMMAND_SELECT_SESSION_VIEW, PushControlSurface.PUSH_BUTTON_SESSION, new SelectSessionViewCommand(this.model, surface));
    } else
        this.addTriggerCommand(Commands.COMMAND_SELECT_SESSION_VIEW, PushControlSurface.PUSH_BUTTON_SESSION, new NopCommand<>(this.model, surface));
}
Also used : PanSendCommand(de.mossgrabers.push.command.trigger.PanSendCommand) ShiftCommand(de.mossgrabers.push.command.trigger.ShiftCommand) MuteCommand(de.mossgrabers.push.command.trigger.MuteCommand) PageRightCommand(de.mossgrabers.push.command.trigger.PageRightCommand) ViewManager(de.mossgrabers.framework.view.ViewManager) TrackCommand(de.mossgrabers.push.command.trigger.TrackCommand) AddTrackCommand(de.mossgrabers.push.command.trigger.AddTrackCommand) AddEffectCommand(de.mossgrabers.push.command.trigger.AddEffectCommand) OctaveCommand(de.mossgrabers.push.command.trigger.OctaveCommand) SelectSessionViewCommand(de.mossgrabers.push.command.trigger.SelectSessionViewCommand) SoloCommand(de.mossgrabers.push.command.trigger.SoloCommand) AddTrackCommand(de.mossgrabers.push.command.trigger.AddTrackCommand) PushQuantizeCommand(de.mossgrabers.push.command.trigger.PushQuantizeCommand) ScalesCommand(de.mossgrabers.push.command.trigger.ScalesCommand) AutomationCommand(de.mossgrabers.push.command.trigger.AutomationCommand) FixedLengthCommand(de.mossgrabers.push.command.trigger.FixedLengthCommand) MasterVolumeCommand(de.mossgrabers.framework.command.continuous.MasterVolumeCommand) VolumeCommand(de.mossgrabers.push.command.trigger.VolumeCommand) MastertrackCommand(de.mossgrabers.push.command.trigger.MastertrackCommand) PageLeftCommand(de.mossgrabers.push.command.trigger.PageLeftCommand) SelectCommand(de.mossgrabers.push.command.trigger.SelectCommand) DeviceCommand(de.mossgrabers.push.command.trigger.DeviceCommand) SetupCommand(de.mossgrabers.push.command.trigger.SetupCommand) SelectPlayViewCommand(de.mossgrabers.push.command.trigger.SelectPlayViewCommand) PushCursorCommand(de.mossgrabers.push.command.trigger.PushCursorCommand) StopClipCommand(de.mossgrabers.framework.command.trigger.clip.StopClipCommand) ClipCommand(de.mossgrabers.push.command.trigger.ClipCommand) AccentCommand(de.mossgrabers.push.command.trigger.AccentCommand) LayoutCommand(de.mossgrabers.push.command.trigger.LayoutCommand) NopCommand(de.mossgrabers.framework.command.trigger.NopCommand) PushControlSurface(de.mossgrabers.push.controller.PushControlSurface)

Example 7 with PushControlSurface

use of de.mossgrabers.push.controller.PushControlSurface in project DrivenByMoss by git-moss.

the class PushControllerSetup method createModel.

/**
 * {@inheritDoc}
 */
@Override
protected void createModel() {
    this.model = this.factory.createModel(this.colorManager, this.valueChanger, this.scales, 8, 8, this.isPush2 ? 8 : 6, this.isPush2 ? 48 : 16, this.isPush2 ? 48 : 16, false, -1, -1, -1, -1);
    final ITrackBank trackBank = this.model.getTrackBank();
    trackBank.setIndication(true);
    trackBank.addTrackSelectionObserver(this::handleTrackChange);
    final IChannelBank effectTrackBank = this.model.getEffectTrackBank();
    if (effectTrackBank != null)
        effectTrackBank.addTrackSelectionObserver(this::handleTrackChange);
    this.model.getMasterTrack().addTrackSelectionObserver((index, isSelected) -> {
        final PushControlSurface surface = this.getSurface();
        final ModeManager modeManager = surface.getModeManager();
        if (isSelected)
            modeManager.setActiveMode(Modes.MODE_MASTER);
        else if (modeManager.isActiveMode(Modes.MODE_MASTER))
            modeManager.restoreMode();
    });
}
Also used : ITrackBank(de.mossgrabers.framework.daw.ITrackBank) IChannelBank(de.mossgrabers.framework.daw.IChannelBank) PushControlSurface(de.mossgrabers.push.controller.PushControlSurface) ModeManager(de.mossgrabers.framework.mode.ModeManager)

Example 8 with PushControlSurface

use of de.mossgrabers.push.controller.PushControlSurface in project DrivenByMoss by git-moss.

the class PushControllerSetup method createViews.

/**
 * {@inheritDoc}
 */
@Override
protected void createViews() {
    final PushControlSurface surface = this.getSurface();
    final ViewManager viewManager = surface.getViewManager();
    viewManager.registerView(Views.VIEW_PLAY, new PlayView(surface, this.model));
    viewManager.registerView(Views.VIEW_PIANO, new PianoView(surface, this.model));
    viewManager.registerView(Views.VIEW_PRG_CHANGE, new PrgChangeView(surface, this.model));
    viewManager.registerView(Views.VIEW_CLIP, new ClipView(surface, this.model));
    viewManager.registerView(Views.VIEW_COLOR, new ColorView(surface, this.model));
    if (this.host.hasClips()) {
        viewManager.registerView(Views.VIEW_SESSION, new SessionView(surface, this.model));
        viewManager.registerView(Views.VIEW_SEQUENCER, new SequencerView(surface, this.model));
        viewManager.registerView(Views.VIEW_DRUM, new DrumView(surface, this.model));
        viewManager.registerView(Views.VIEW_DRUM4, new DrumView4(surface, this.model));
        viewManager.registerView(Views.VIEW_DRUM8, new DrumView8(surface, this.model));
        viewManager.registerView(Views.VIEW_DRUM64, new DrumView64(surface, this.model));
        viewManager.registerView(Views.VIEW_RAINDROPS, new RaindropsView(surface, this.model));
        viewManager.registerView(Views.VIEW_SCENE_PLAY, new ScenePlayView(surface, this.model));
    }
}
Also used : RaindropsView(de.mossgrabers.push.view.RaindropsView) ViewManager(de.mossgrabers.framework.view.ViewManager) SessionView(de.mossgrabers.push.view.SessionView) ScenePlayView(de.mossgrabers.push.view.ScenePlayView) PrgChangeView(de.mossgrabers.push.view.PrgChangeView) ColorView(de.mossgrabers.push.view.ColorView) DrumView64(de.mossgrabers.push.view.DrumView64) DrumView(de.mossgrabers.push.view.DrumView) PlayView(de.mossgrabers.push.view.PlayView) ScenePlayView(de.mossgrabers.push.view.ScenePlayView) DrumView4(de.mossgrabers.push.view.DrumView4) SequencerView(de.mossgrabers.push.view.SequencerView) AbstractSequencerView(de.mossgrabers.framework.view.AbstractSequencerView) DrumView8(de.mossgrabers.push.view.DrumView8) PianoView(de.mossgrabers.push.view.PianoView) ClipView(de.mossgrabers.push.view.ClipView) PushControlSurface(de.mossgrabers.push.controller.PushControlSurface)

Example 9 with PushControlSurface

use of de.mossgrabers.push.controller.PushControlSurface in project DrivenByMoss by git-moss.

the class PushControllerSetup method createSurface.

/**
 * {@inheritDoc}
 */
@Override
protected void createSurface() {
    final IMidiAccess midiAccess = this.factory.createMidiAccess();
    final IMidiOutput output = midiAccess.createOutput();
    final IMidiInput input = midiAccess.createInput(this.isPush2 ? "Ableton Push 2" : "Ableton Push 1", "80????", /* Note off */
    "90????", /* Note on */
    "B040??");
    final PushControlSurface surface = new PushControlSurface(this.model.getHost(), this.colorManager, this.configuration, output, input);
    this.surfaces.add(surface);
    surface.setDisplay(this.createDisplay(output));
    surface.getModeManager().setDefaultMode(Modes.MODE_TRACK);
}
Also used : IMidiAccess(de.mossgrabers.framework.daw.midi.IMidiAccess) IMidiOutput(de.mossgrabers.framework.daw.midi.IMidiOutput) IMidiInput(de.mossgrabers.framework.daw.midi.IMidiInput) PushControlSurface(de.mossgrabers.push.controller.PushControlSurface)

Example 10 with PushControlSurface

use of de.mossgrabers.push.controller.PushControlSurface in project DrivenByMoss by git-moss.

the class PushControllerSetup method registerContinuousCommands.

/**
 * {@inheritDoc}
 */
@Override
protected void registerContinuousCommands() {
    final PushControlSurface surface = this.getSurface();
    for (int i = 0; i < 8; i++) this.addContinuousCommand(Integer.valueOf(Commands.CONT_COMMAND_KNOB1.intValue() + i), PushControlSurface.PUSH_KNOB1 + i, new KnobRowModeCommand<>(i, this.model, surface));
    this.addContinuousCommand(Commands.CONT_COMMAND_MASTER_KNOB, PushControlSurface.PUSH_KNOB9, new MasterVolumeCommand<>(this.model, surface));
    this.addContinuousCommand(Commands.CONT_COMMAND_TEMPO, PushControlSurface.PUSH_SMALL_KNOB1, new RasteredKnobCommand(this.model, surface));
    this.addContinuousCommand(Commands.CONT_COMMAND_PLAY_POSITION, PushControlSurface.PUSH_SMALL_KNOB2, new PlayPositionCommand<>(this.model, surface));
    this.addContinuousCommand(Commands.COMMAND_FOOTSWITCH, PushControlSurface.PUSH_FOOTSWITCH2, new FootswitchCommand<>(this.model, surface));
    this.addNoteCommand(Commands.CONT_COMMAND_KNOB1_TOUCH, PushControlSurface.PUSH_KNOB1_TOUCH, new KnobRowTouchModeCommand<>(0, this.model, surface));
    this.addNoteCommand(Commands.CONT_COMMAND_KNOB2_TOUCH, PushControlSurface.PUSH_KNOB2_TOUCH, new KnobRowTouchModeCommand<>(1, this.model, surface));
    this.addNoteCommand(Commands.CONT_COMMAND_KNOB3_TOUCH, PushControlSurface.PUSH_KNOB3_TOUCH, new KnobRowTouchModeCommand<>(2, this.model, surface));
    this.addNoteCommand(Commands.CONT_COMMAND_KNOB4_TOUCH, PushControlSurface.PUSH_KNOB4_TOUCH, new KnobRowTouchModeCommand<>(3, this.model, surface));
    this.addNoteCommand(Commands.CONT_COMMAND_KNOB5_TOUCH, PushControlSurface.PUSH_KNOB5_TOUCH, new KnobRowTouchModeCommand<>(4, this.model, surface));
    this.addNoteCommand(Commands.CONT_COMMAND_KNOB6_TOUCH, PushControlSurface.PUSH_KNOB6_TOUCH, new KnobRowTouchModeCommand<>(5, this.model, surface));
    this.addNoteCommand(Commands.CONT_COMMAND_KNOB7_TOUCH, PushControlSurface.PUSH_KNOB7_TOUCH, new KnobRowTouchModeCommand<>(6, this.model, surface));
    this.addNoteCommand(Commands.CONT_COMMAND_KNOB8_TOUCH, PushControlSurface.PUSH_KNOB8_TOUCH, new KnobRowTouchModeCommand<>(7, this.model, surface));
    this.addNoteCommand(Commands.CONT_COMMAND_TEMPO_TOUCH, PushControlSurface.PUSH_SMALL_KNOB1_TOUCH, new SmallKnobTouchCommand(this.model, surface));
    this.addNoteCommand(Commands.CONT_COMMAND_PLAYCURSOR_TOUCH, PushControlSurface.PUSH_SMALL_KNOB2_TOUCH, new SmallKnobTouchCommand(this.model, surface));
    this.addNoteCommand(Commands.CONT_COMMAND_CONFIGURE_PITCHBEND, PushControlSurface.PUSH_RIBBON_TOUCH, new ConfigurePitchbendCommand(this.model, surface));
    this.addNoteCommand(Commands.CONT_COMMAND_MASTERTRACK_TOUCH, PushControlSurface.PUSH_KNOB9_TOUCH, new MastertrackTouchCommand(this.model, surface));
    final ViewManager viewManager = surface.getViewManager();
    viewManager.registerPitchbendCommand(new PitchbendCommand(this.model, surface));
    final PlayView playView = (PlayView) viewManager.getView(Views.VIEW_PLAY);
    playView.registerAftertouchCommand(new AftertouchAbstractPlayViewCommand<>(playView, this.model, surface));
    final PlayView pianoView = (PlayView) viewManager.getView(Views.VIEW_PIANO);
    pianoView.registerAftertouchCommand(new AftertouchAbstractPlayViewCommand<>(pianoView, this.model, surface));
    if (this.host.hasClips()) {
        viewManager.getView(Views.VIEW_SESSION).registerPitchbendCommand(new PitchbendSessionCommand(this.model, surface));
    }
}
Also used : RasteredKnobCommand(de.mossgrabers.push.command.trigger.RasteredKnobCommand) SmallKnobTouchCommand(de.mossgrabers.push.command.continuous.SmallKnobTouchCommand) ViewManager(de.mossgrabers.framework.view.ViewManager) MastertrackTouchCommand(de.mossgrabers.push.command.continuous.MastertrackTouchCommand) PitchbendSessionCommand(de.mossgrabers.push.command.pitchbend.PitchbendSessionCommand) PlayView(de.mossgrabers.push.view.PlayView) ScenePlayView(de.mossgrabers.push.view.ScenePlayView) ConfigurePitchbendCommand(de.mossgrabers.push.command.continuous.ConfigurePitchbendCommand) PitchbendCommand(de.mossgrabers.push.command.pitchbend.PitchbendCommand) ConfigurePitchbendCommand(de.mossgrabers.push.command.continuous.ConfigurePitchbendCommand) PushControlSurface(de.mossgrabers.push.controller.PushControlSurface) KnobRowModeCommand(de.mossgrabers.framework.command.continuous.KnobRowModeCommand)

Aggregations

PushControlSurface (de.mossgrabers.push.controller.PushControlSurface)14 ModeManager (de.mossgrabers.framework.mode.ModeManager)5 ViewManager (de.mossgrabers.framework.view.ViewManager)5 PlayView (de.mossgrabers.push.view.PlayView)5 ScenePlayView (de.mossgrabers.push.view.ScenePlayView)5 AbstractSequencerView (de.mossgrabers.framework.view.AbstractSequencerView)4 ClipView (de.mossgrabers.push.view.ClipView)4 ColorView (de.mossgrabers.push.view.ColorView)4 DrumView (de.mossgrabers.push.view.DrumView)4 PianoView (de.mossgrabers.push.view.PianoView)4 PrgChangeView (de.mossgrabers.push.view.PrgChangeView)4 SceneView (de.mossgrabers.framework.view.SceneView)3 View (de.mossgrabers.framework.view.View)3 IChannelBank (de.mossgrabers.framework.daw.IChannelBank)2 ITrackBank (de.mossgrabers.framework.daw.ITrackBank)2 ITrack (de.mossgrabers.framework.daw.data.ITrack)2 AccentMode (de.mossgrabers.push.mode.AccentMode)2 AutomationMode (de.mossgrabers.push.mode.AutomationMode)2 ConfigurationMode (de.mossgrabers.push.mode.ConfigurationMode)2 FixedMode (de.mossgrabers.push.mode.FixedMode)2