use of de.mossgrabers.framework.daw.INoteClip in project DrivenByMoss by git-moss.
the class AbstractPolySequencerView method drawGrid.
/**
* {@inheritDoc}
*/
@Override
public void drawGrid() {
final IPadGrid padGrid = this.surface.getPadGrid();
final boolean isKeyboardEnabled = this.model.canSelectedTrackHoldNotes();
if (!isKeyboardEnabled) {
padGrid.turnOff();
return;
}
final INoteClip clip = this.getClip();
final boolean isActive = this.isActive();
final int step = clip.getCurrentStep();
// Paint the sequencer steps
final int hiStep = this.isInXRange(step) ? step % this.sequencerSteps : -1;
final List<GridStep> editNotes = this.getEditNotes();
for (int col = 0; col < this.sequencerSteps; col++) {
final IStepInfo stepInfo = this.getStep(clip, col);
final boolean hilite = col == hiStep;
final int x = col % this.numColumns;
final int y = col / this.numColumns;
padGrid.lightEx(x, y, isActive ? this.getStepColor(stepInfo, hilite, col, editNotes) : AbstractSequencerView.COLOR_NO_CONTENT);
}
// Paint the play part
final boolean isRecording = this.model.hasRecordingState();
final ITrack cursorTrack = this.model.getCursorTrack();
final int startNote = this.scales.getStartNote();
for (int i = startNote; i < startNote + this.sequencerSteps; i++) padGrid.light(i, this.getGridColor(isKeyboardEnabled, isRecording, cursorTrack, i));
}
use of de.mossgrabers.framework.daw.INoteClip in project DrivenByMoss by git-moss.
the class AbstractRaindropsView method getNoteDistanceToTheRight.
protected int getNoteDistanceToTheRight(final int row, final int start, final int length) {
if (row < 0 || start < 0 || start >= length)
return -1;
int step = start;
int counter = 0;
final INoteClip clip = this.getClip();
final int editMidiChannel = this.configuration.getMidiEditChannel();
do {
if (clip.getStep(editMidiChannel, step, row).getState() != StepState.OFF)
return counter;
step++;
counter++;
if (step >= length)
step = 0;
} while (step != start);
return -1;
}
use of de.mossgrabers.framework.daw.INoteClip in project DrivenByMoss by git-moss.
the class Drum4View method onGridNoteLongPress.
/**
* {@inheritDoc}
*/
@Override
public void onGridNoteLongPress(final int note) {
if (!this.isActive())
return;
final int index = note - DRUM_START_KEY;
this.surface.getButton(ButtonID.get(ButtonID.PAD1, index)).setConsumed();
final int x = index % 8;
final int y = index / 8;
final int sound = y % 4;
final int stepX = 8 * (1 - y / 4) + x;
final int stepY = this.scales.getDrumOffset() + sound;
final int channel = this.configuration.getMidiEditChannel();
final INoteClip clip = this.getClip();
this.editNote(clip, channel, stepX, stepY, false);
}
use of de.mossgrabers.framework.daw.INoteClip in project DrivenByMoss by git-moss.
the class DrumView method onGridNoteLongPress.
/**
* {@inheritDoc}
*/
@Override
public void onGridNoteLongPress(final int note) {
if (!this.isActive() || this.isPlayMode)
return;
final int index = note - DRUM_START_KEY;
this.surface.getButton(ButtonID.get(ButtonID.PAD1, index)).setConsumed();
final int x = index % this.numColumns;
final int y = index / this.numColumns;
final int step = this.numColumns * (1 - y) + x;
final int row = this.scales.getDrumOffset() + this.getSelectedPad();
final int channel = this.configuration.getMidiEditChannel();
final INoteClip clip = this.getClip();
this.editNote(clip, channel, step, row, false);
}
use of de.mossgrabers.framework.daw.INoteClip in project DrivenByMoss by git-moss.
the class DrumView method drawGrid.
/**
* {@inheritDoc}
*/
@Override
public void drawGrid() {
final IPadGrid padGrid = this.surface.getPadGrid();
final IDrumDevice primary = this.model.getDrumDevice();
if (this.isPlayMode) {
for (int y = 0; y < 2; y++) {
for (int x = 0; x < 8; x++) {
final int index = 8 * y + x;
padGrid.lightEx(x, 1 - y, this.getDrumPadColor(index, primary, false));
}
}
return;
}
if (!this.isActive()) {
padGrid.turnOff();
return;
}
// Paint the sequencer steps
final INoteClip clip = this.getClip();
final int step = clip.getCurrentStep();
final int hiStep = this.isInXRange(step) ? step % this.sequencerSteps : -1;
final int offsetY = this.scales.getDrumOffset();
final int editMidiChannel = this.configuration.getMidiEditChannel();
final int selPad = this.getSelectedPad();
final List<GridStep> editNotes = this.getEditNotes();
for (int col = 0; col < DrumView.NUM_DISPLAY_COLS; col++) {
final int noteRow = offsetY + selPad;
final IStepInfo stepInfo = clip.getStep(editMidiChannel, col, noteRow);
final boolean hilite = col == hiStep;
final int x = col % GRID_COLUMNS;
final int y = col / GRID_COLUMNS;
final Optional<ColorEx> rowColor = this.getPadColor(primary, this.selectedPad);
padGrid.lightEx(x, y, this.getStepColor(stepInfo, hilite, rowColor, editMidiChannel, col, noteRow, editNotes));
}
}
Aggregations