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);
}
}
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);
}
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));
}
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));
}
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));
}
Aggregations