use of de.mossgrabers.framework.daw.ITransport in project DrivenByMoss by git-moss.
the class TapTempoCommand method executeNormal.
/**
* {@inheritDoc}
*/
@Override
public void executeNormal(final ButtonEvent event) {
if (event != ButtonEvent.DOWN)
return;
final ITransport transport = this.model.getTransport();
transport.tapTempo();
final IDisplay display = this.surface.getDisplay();
if (display != null)
display.notify(String.format("Tempo: %.02f", Double.valueOf(transport.getTempo())));
}
use of de.mossgrabers.framework.daw.ITransport in project DrivenByMoss by git-moss.
the class ShiftView method drawGrid.
/**
* {@inheritDoc}
*/
@Override
public void drawGrid() {
final IPadGrid padGrid = this.surface.getPadGrid();
final LaunchpadConfiguration configuration = this.surface.getConfiguration();
final ITransport transport = this.model.getTransport();
// Add tracks
padGrid.light(97, LaunchpadColorManager.LAUNCHPAD_COLOR_GREEN);
padGrid.light(98, LaunchpadColorManager.LAUNCHPAD_COLOR_GREEN_SPRING);
padGrid.light(99, LaunchpadColorManager.LAUNCHPAD_COLOR_TURQUOISE_CYAN);
// Accent on/off
padGrid.light(91, configuration.isAccentActive() ? LaunchpadColorManager.LAUNCHPAD_COLOR_YELLOW_HI : LaunchpadColorManager.LAUNCHPAD_COLOR_YELLOW_LO);
// New clip length
final int clipLengthIndex = this.surface.getConfiguration().getNewClipLength();
for (int i = 0; i < 8; i++) padGrid.light(36 + i, i == clipLengthIndex ? LaunchpadColorManager.LAUNCHPAD_COLOR_WHITE : LaunchpadColorManager.LAUNCHPAD_COLOR_GREY_LO);
// Note Repeat
final INoteRepeat noteRepeat = this.surface.getMidiInput().getDefaultNoteInput().getNoteRepeat();
padGrid.light(87, noteRepeat.isActive() ? LaunchpadColorManager.LAUNCHPAD_COLOR_ORCHID_HI : LaunchpadColorManager.LAUNCHPAD_COLOR_ORCHID_LO);
// Note Repeat period
final int periodIndex = Resolution.getMatch(noteRepeat.getPeriod());
padGrid.light(79, periodIndex == 0 ? LaunchpadColorManager.LAUNCHPAD_COLOR_SKY_HI : LaunchpadColorManager.LAUNCHPAD_COLOR_SKY_LO);
padGrid.light(71, periodIndex == 2 ? LaunchpadColorManager.LAUNCHPAD_COLOR_SKY_HI : LaunchpadColorManager.LAUNCHPAD_COLOR_SKY_LO);
padGrid.light(63, periodIndex == 4 ? LaunchpadColorManager.LAUNCHPAD_COLOR_SKY_HI : LaunchpadColorManager.LAUNCHPAD_COLOR_SKY_LO);
padGrid.light(55, periodIndex == 6 ? LaunchpadColorManager.LAUNCHPAD_COLOR_SKY_HI : LaunchpadColorManager.LAUNCHPAD_COLOR_SKY_LO);
padGrid.light(80, periodIndex == 1 ? LaunchpadColorManager.LAUNCHPAD_COLOR_PINK_HI : LaunchpadColorManager.LAUNCHPAD_COLOR_PINK_LO);
padGrid.light(72, periodIndex == 3 ? LaunchpadColorManager.LAUNCHPAD_COLOR_PINK_HI : LaunchpadColorManager.LAUNCHPAD_COLOR_PINK_LO);
padGrid.light(64, periodIndex == 5 ? LaunchpadColorManager.LAUNCHPAD_COLOR_PINK_HI : LaunchpadColorManager.LAUNCHPAD_COLOR_PINK_LO);
padGrid.light(56, periodIndex == 7 ? LaunchpadColorManager.LAUNCHPAD_COLOR_PINK_HI : LaunchpadColorManager.LAUNCHPAD_COLOR_PINK_LO);
// Note Repeat length
final int lengthIndex = Resolution.getMatch(noteRepeat.getNoteLength());
padGrid.light(81, lengthIndex == 0 ? LaunchpadColorManager.LAUNCHPAD_COLOR_SKY_HI : LaunchpadColorManager.LAUNCHPAD_COLOR_SKY_LO);
padGrid.light(73, lengthIndex == 2 ? LaunchpadColorManager.LAUNCHPAD_COLOR_SKY_HI : LaunchpadColorManager.LAUNCHPAD_COLOR_SKY_LO);
padGrid.light(65, lengthIndex == 4 ? LaunchpadColorManager.LAUNCHPAD_COLOR_SKY_HI : LaunchpadColorManager.LAUNCHPAD_COLOR_SKY_LO);
padGrid.light(57, lengthIndex == 6 ? LaunchpadColorManager.LAUNCHPAD_COLOR_SKY_HI : LaunchpadColorManager.LAUNCHPAD_COLOR_SKY_LO);
padGrid.light(82, lengthIndex == 1 ? LaunchpadColorManager.LAUNCHPAD_COLOR_PINK_HI : LaunchpadColorManager.LAUNCHPAD_COLOR_PINK_LO);
padGrid.light(74, lengthIndex == 3 ? LaunchpadColorManager.LAUNCHPAD_COLOR_PINK_HI : LaunchpadColorManager.LAUNCHPAD_COLOR_PINK_LO);
padGrid.light(66, lengthIndex == 5 ? LaunchpadColorManager.LAUNCHPAD_COLOR_PINK_HI : LaunchpadColorManager.LAUNCHPAD_COLOR_PINK_LO);
padGrid.light(58, lengthIndex == 7 ? LaunchpadColorManager.LAUNCHPAD_COLOR_PINK_HI : LaunchpadColorManager.LAUNCHPAD_COLOR_PINK_LO);
// Stop all
padGrid.light(51, LaunchpadColorManager.LAUNCHPAD_COLOR_RED);
// Note Repeat Octave Range up/down
padGrid.light(88, LaunchpadColorManager.LAUNCHPAD_COLOR_RED);
padGrid.light(89, LaunchpadColorManager.LAUNCHPAD_COLOR_RED);
for (int i = 90; i < 91; i++) padGrid.light(i, LaunchpadColorManager.LAUNCHPAD_COLOR_BLACK);
if (this.surface.isPro()) {
for (int i = 44; i < 51; i++) padGrid.light(i, LaunchpadColorManager.LAUNCHPAD_COLOR_BLACK);
for (int i = 52; i < 55; i++) padGrid.light(i, LaunchpadColorManager.LAUNCHPAD_COLOR_BLACK);
for (int i = 59; i < 63; i++) padGrid.light(i, LaunchpadColorManager.LAUNCHPAD_COLOR_BLACK);
for (int i = 67; i < 71; i++) padGrid.light(i, LaunchpadColorManager.LAUNCHPAD_COLOR_BLACK);
for (int i = 75; i < 79; i++) padGrid.light(i, LaunchpadColorManager.LAUNCHPAD_COLOR_BLACK);
for (int i = 83; i < 87; i++) padGrid.light(i, LaunchpadColorManager.LAUNCHPAD_COLOR_BLACK);
for (int i = 92; i < 97; i++) padGrid.light(i, LaunchpadColorManager.LAUNCHPAD_COLOR_BLACK);
return;
}
// Record
padGrid.light(44, transport.isRecording() ? LaunchpadColorManager.LAUNCHPAD_COLOR_RED_HI : LaunchpadColorManager.LAUNCHPAD_COLOR_RED_LO);
padGrid.light(45, transport.isLauncherOverdub() ? LaunchpadColorManager.LAUNCHPAD_COLOR_ROSE : LaunchpadColorManager.LAUNCHPAD_COLOR_WHITE);
for (int i = 46; i < 51; i++) padGrid.light(i, LaunchpadColorManager.LAUNCHPAD_COLOR_BLACK);
// Play / New
padGrid.light(52, transport.isPlaying() ? LaunchpadColorManager.LAUNCHPAD_COLOR_GREEN_HI : LaunchpadColorManager.LAUNCHPAD_COLOR_GREEN_LO);
padGrid.light(53, LaunchpadColorManager.LAUNCHPAD_COLOR_GREEN_SPRING);
padGrid.light(54, LaunchpadColorManager.LAUNCHPAD_COLOR_BLACK);
padGrid.light(59, LaunchpadColorManager.LAUNCHPAD_COLOR_BLACK);
// Duplicate
if (configuration.isDuplicateModeActive())
padGrid.light(60, LaunchpadColorManager.LAUNCHPAD_COLOR_BLUE, LaunchpadColorManager.LAUNCHPAD_COLOR_OCEAN_BLUE, true);
else
padGrid.light(60, LaunchpadColorManager.LAUNCHPAD_COLOR_BLUE);
// Double
padGrid.light(61, LaunchpadColorManager.LAUNCHPAD_COLOR_BLUE_ORCHID);
padGrid.light(62, LaunchpadColorManager.LAUNCHPAD_COLOR_BLACK);
padGrid.light(67, LaunchpadColorManager.LAUNCHPAD_COLOR_BLACK);
// Quantize
padGrid.light(68, LaunchpadColorManager.LAUNCHPAD_COLOR_GREEN);
// Record Quantization
padGrid.light(69, LaunchpadColorManager.LAUNCHPAD_COLOR_GREEN_SPRING);
padGrid.light(70, LaunchpadColorManager.LAUNCHPAD_COLOR_BLACK);
padGrid.light(75, LaunchpadColorManager.LAUNCHPAD_COLOR_BLACK);
// Delete
if (configuration.isDeleteModeActive())
padGrid.light(76, LaunchpadColorManager.LAUNCHPAD_COLOR_MAGENTA, LaunchpadColorManager.LAUNCHPAD_COLOR_MAGENTA_PINK, true);
else
padGrid.light(76, LaunchpadColorManager.LAUNCHPAD_COLOR_MAGENTA);
padGrid.light(77, transport.isLoop() ? LaunchpadColorManager.LAUNCHPAD_COLOR_BLUE_HI : LaunchpadColorManager.LAUNCHPAD_COLOR_BLUE_LO);
padGrid.light(78, LaunchpadColorManager.LAUNCHPAD_COLOR_BLACK);
padGrid.light(83, LaunchpadColorManager.LAUNCHPAD_COLOR_BLACK);
// Undo / Redo
padGrid.light(84, LaunchpadColorManager.LAUNCHPAD_COLOR_AMBER);
padGrid.light(85, LaunchpadColorManager.LAUNCHPAD_COLOR_AMBER_YELLOW);
padGrid.light(86, LaunchpadColorManager.LAUNCHPAD_COLOR_BLACK);
// Metronome
padGrid.light(92, transport.isMetronomeOn() ? LaunchpadColorManager.LAUNCHPAD_COLOR_GREEN_HI : LaunchpadColorManager.LAUNCHPAD_COLOR_GREEN_LO);
// Tap Tempo
padGrid.light(93, LaunchpadColorManager.LAUNCHPAD_COLOR_GREEN_SPRING);
for (int i = 94; i < 97; i++) padGrid.light(i, LaunchpadColorManager.LAUNCHPAD_COLOR_BLACK);
}
Aggregations