Search in sources :

Example 1 with IGroove

use of de.mossgrabers.framework.daw.IGroove in project DrivenByMoss by git-moss.

the class GrooveMode method setActive.

private void setActive(final boolean enable) {
    final IGroove groove = this.model.getGroove();
    groove.enableObservers(enable);
    groove.setIndication(enable);
}
Also used : IGroove(de.mossgrabers.framework.daw.IGroove)

Example 2 with IGroove

use of de.mossgrabers.framework.daw.IGroove in project DrivenByMoss by git-moss.

the class NoteRepeatMode method updateDisplay2.

/**
 * {@inheritDoc}
 */
@Override
public void updateDisplay2(final IGraphicDisplay display) {
    if (this.noteRepeat == null)
        return;
    display.addOptionElement("Period", "", false, "", "", false, false);
    final int selPeriodIndex = this.getSelectedPeriodIndex();
    display.addListElement(6, Resolution.getNames(), selPeriodIndex);
    if (this.host.supports(Capability.NOTE_REPEAT_LENGTH)) {
        display.addOptionElement("  Length", "", false, "", "", false, false);
        final int selLengthIndex = this.getSelectedNoteLengthIndex();
        display.addListElement(6, Resolution.getNames(), selLengthIndex);
    } else {
        display.addEmptyElement();
        display.addEmptyElement();
    }
    display.addEmptyElement();
    final int upperBound = this.model.getValueChanger().getUpperBound();
    if (this.host.supports(Capability.NOTE_REPEAT_MODE)) {
        final String bottomMenu = this.host.supports(Capability.NOTE_REPEAT_USE_PRESSURE_TO_VELOCITY) ? "Use Pressure" : "";
        final boolean isBottomMenuEnabled = this.noteRepeat.usePressure();
        final ArpeggiatorMode mode = this.noteRepeat.getMode();
        final Configuration configuration = this.surface.getConfiguration();
        final List<ArpeggiatorMode> arpeggiatorModes = configuration.getArpeggiatorModes();
        final int modeIndex = configuration.lookupArpeggiatorModeIndex(mode);
        final int value = modeIndex * upperBound / (arpeggiatorModes.size() - 1);
        display.addParameterElementWithPlainMenu("", false, bottomMenu, null, isBottomMenuEnabled, "Mode", value, StringUtils.optimizeName(mode.getName(), 8), this.isKnobTouched[5], -1);
    } else
        display.addEmptyElement();
    if (this.host.supports(Capability.NOTE_REPEAT_OCTAVES)) {
        final String bottomMenu = this.host.supports(Capability.NOTE_REPEAT_IS_FREE_RUNNING) ? "Sync" : "";
        final boolean isBottomMenuEnabled = !this.noteRepeat.isFreeRunning();
        final int octaves = this.noteRepeat.getOctaves();
        final int value = octaves * upperBound / 8;
        display.addParameterElementWithPlainMenu("", false, bottomMenu, null, isBottomMenuEnabled, "Octaves", value, Integer.toString(octaves), this.isKnobTouched[6], -1);
    } else
        display.addEmptyElement();
    if (this.host.supports(Capability.NOTE_REPEAT_SWING)) {
        final IGroove groove = this.model.getGroove();
        final IParameter shuffleParam = groove.getParameter(GrooveParameterID.SHUFFLE_AMOUNT);
        final IParameter enabledParam = groove.getParameter(GrooveParameterID.ENABLED);
        final int value = enabledParam.getValue();
        display.addParameterElementWithPlainMenu("Groove " + enabledParam.getDisplayedValue(8), value != 0, "Shuffle", null, this.noteRepeat.isShuffle(), shuffleParam.getName(10), shuffleParam.getValue(), shuffleParam.getDisplayedValue(8), this.isKnobTouched[7], -1);
    } else
        display.addEmptyElement();
}
Also used : ArpeggiatorMode(de.mossgrabers.framework.daw.midi.ArpeggiatorMode) IParameter(de.mossgrabers.framework.daw.data.IParameter) Configuration(de.mossgrabers.framework.configuration.Configuration) PushConfiguration(de.mossgrabers.controller.ableton.push.PushConfiguration) IGroove(de.mossgrabers.framework.daw.IGroove)

Example 3 with IGroove

use of de.mossgrabers.framework.daw.IGroove in project DrivenByMoss by git-moss.

the class GrooveMode method updateDisplay1.

/**
 * {@inheritDoc}
 */
@Override
public void updateDisplay1(final ITextDisplay display) {
    display.setCell(0, 0, "Quantize");
    display.setCell(0, 1, Push1Display.SELECT_ARROW + TAG_GROOVE);
    final IGroove groove = this.model.getGroove();
    final IParameter enabledParameter = groove.getParameter(GrooveParameterID.ENABLED);
    if (enabledParameter != null)
        display.setCell(3, 0, enabledParameter.getValue() == 0 ? "  Off" : "Enabled");
    display.setCell(2, 1, "Shuffle:");
    this.displayParameter(display, GrooveParameterID.SHUFFLE_AMOUNT, 2);
    this.displayParameter(display, GrooveParameterID.SHUFFLE_RATE, 3);
    final boolean hasAccent = groove.getParameter(GrooveParameterID.ACCENT_AMOUNT) != EmptyParameter.INSTANCE;
    display.setCell(2, 4, hasAccent ? " Accent:" : "");
    this.displayParameter(display, GrooveParameterID.ACCENT_AMOUNT, 5);
    this.displayParameter(display, GrooveParameterID.ACCENT_PHASE, 6);
    this.displayParameter(display, GrooveParameterID.ACCENT_RATE, 7);
}
Also used : IParameter(de.mossgrabers.framework.daw.data.IParameter) IGroove(de.mossgrabers.framework.daw.IGroove)

Example 4 with IGroove

use of de.mossgrabers.framework.daw.IGroove in project DrivenByMoss by git-moss.

the class GrooveMode method updateDisplay2.

/**
 * {@inheritDoc}
 */
@Override
public void updateDisplay2(final IGraphicDisplay display) {
    final IGroove groove = this.model.getGroove();
    final IParameter enabledParameter = groove.getParameter(GrooveParameterID.ENABLED);
    String paramText;
    if (enabledParameter == null)
        paramText = "";
    else
        paramText = enabledParameter.getValue() == 0 ? "Off" : "Enabled";
    display.addOptionElement("", "Quantize", false, null, "", paramText, enabledParameter != null && enabledParameter.getValue() > 0, null, true);
    display.addOptionElement("", TAG_GROOVE, true, null, "      Shuffle", "", false, null, true);
    this.displayParameter(display, GrooveParameterID.SHUFFLE_AMOUNT, 2);
    this.displayParameter(display, GrooveParameterID.SHUFFLE_RATE, 3);
    final boolean hasAccent = groove.getParameter(GrooveParameterID.ACCENT_AMOUNT) != EmptyParameter.INSTANCE;
    display.addOptionElement("", hasAccent ? "" : " ", false, null, hasAccent ? "      Accent" : "", "", false, null, true);
    this.displayParameter(display, GrooveParameterID.ACCENT_AMOUNT, 5);
    this.displayParameter(display, GrooveParameterID.ACCENT_PHASE, 6);
    this.displayParameter(display, GrooveParameterID.ACCENT_RATE, 7);
}
Also used : IParameter(de.mossgrabers.framework.daw.data.IParameter) IGroove(de.mossgrabers.framework.daw.IGroove)

Example 5 with IGroove

use of de.mossgrabers.framework.daw.IGroove in project DrivenByMoss by git-moss.

the class LaunchpadShuffleView method onGridNote.

/**
 * {@inheritDoc}}
 */
@Override
public void onGridNote(final int note, final int velocity) {
    if (velocity != 0)
        return;
    // Toggle shuffle on/off
    if (note == 36) {
        final IGroove groove = this.model.getGroove();
        final IParameter enabledParameter = groove.getParameter(GrooveParameterID.ENABLED);
        if (enabledParameter != null) {
            enabledParameter.setNormalizedValue(enabledParameter.getValue() == 0 ? 1 : 0);
            return;
        }
    }
    // Shuffle rate
    if (note == 38 || note == 39) {
        final IGroove groove = this.model.getGroove();
        final IParameter rateParameter = groove.getParameter(GrooveParameterID.SHUFFLE_RATE);
        if (rateParameter != null) {
            rateParameter.setNormalizedValue(rateParameter.getValue() == 0 ? 1 : 0);
            return;
        }
    }
    this.surface.getViewManager().restore();
}
Also used : IParameter(de.mossgrabers.framework.daw.data.IParameter) IGroove(de.mossgrabers.framework.daw.IGroove)

Aggregations

IGroove (de.mossgrabers.framework.daw.IGroove)7 IParameter (de.mossgrabers.framework.daw.data.IParameter)5 PushConfiguration (de.mossgrabers.controller.ableton.push.PushConfiguration)1 Configuration (de.mossgrabers.framework.configuration.Configuration)1 ArpeggiatorMode (de.mossgrabers.framework.daw.midi.ArpeggiatorMode)1