Search in sources :

Example 1 with Configuration

use of de.mossgrabers.framework.configuration.Configuration in project DrivenByMoss by git-moss.

the class SelectSessionViewCommand method execute.

/**
 * {@inheritDoc}
 */
@Override
public void execute(final ButtonEvent event) {
    if (event != ButtonEvent.DOWN)
        return;
    final ViewManager viewManager = this.surface.getViewManager();
    if (viewManager.isActiveView(Views.VIEW_SESSION)) {
        final Configuration configuration = this.surface.getConfiguration();
        configuration.setFlipSession(!configuration.isFlipSession());
    } else
        viewManager.setActiveView(Views.VIEW_SESSION);
}
Also used : Configuration(de.mossgrabers.framework.configuration.Configuration) LaunchpadConfiguration(de.mossgrabers.launchpad.LaunchpadConfiguration) ViewManager(de.mossgrabers.framework.view.ViewManager)

Example 2 with Configuration

use of de.mossgrabers.framework.configuration.Configuration in project DrivenByMoss by git-moss.

the class FixedMode method updateFirstRow.

/**
 * {@inheritDoc}
 */
@Override
public void updateFirstRow() {
    final ColorManager colorManager = this.model.getColorManager();
    final Configuration configuration = this.surface.getConfiguration();
    for (int i = 0; i < 8; i++) this.surface.updateButton(20 + i, colorManager.getColor(configuration.getNewClipLength() == i ? AbstractMode.BUTTON_COLOR_HI : AbstractMode.BUTTON_COLOR_ON));
}
Also used : Configuration(de.mossgrabers.framework.configuration.Configuration) AbstractConfiguration(de.mossgrabers.framework.configuration.AbstractConfiguration) ColorManager(de.mossgrabers.framework.controller.color.ColorManager)

Example 3 with Configuration

use of de.mossgrabers.framework.configuration.Configuration 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 4 with Configuration

use of de.mossgrabers.framework.configuration.Configuration in project DrivenByMoss by git-moss.

the class NoteRepeatMode method updateDisplay1.

/**
 * {@inheritDoc}
 */
@Override
public void updateDisplay1(final ITextDisplay display) {
    display.setCell(0, 0, "Period:");
    final int selPeriodIndex = this.getSelectedPeriodIndex();
    int pos = 0;
    for (final Pair<String, Boolean> p : Push1Display.createMenuList(4, Resolution.getNames(), selPeriodIndex)) {
        display.setCell(pos, 1, (p.getValue().booleanValue() ? Push1Display.SELECT_ARROW : " ") + p.getKey());
        pos++;
    }
    if (this.host.supports(Capability.NOTE_REPEAT_LENGTH)) {
        display.setCell(0, 2, "Length:");
        final int selLengthIndex = this.getSelectedNoteLengthIndex();
        pos = 0;
        for (final Pair<String, Boolean> p : Push1Display.createMenuList(4, Resolution.getNames(), selLengthIndex)) {
            display.setCell(pos, 3, (p.getValue().booleanValue() ? Push1Display.SELECT_ARROW : " ") + p.getKey());
            pos++;
        }
    }
    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 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.setCell(0, 5, "Mode");
        display.setCell(1, 5, StringUtils.optimizeName(mode.getName(), 8));
        display.setCell(2, 5, value, Format.FORMAT_VALUE);
        display.setCell(3, 5, bottomMenu);
    }
    if (this.host.supports(Capability.NOTE_REPEAT_OCTAVES)) {
        final String bottomMenu = this.host.supports(Capability.NOTE_REPEAT_IS_FREE_RUNNING) ? "Sync" : "";
        final int octaves = this.noteRepeat.getOctaves();
        final int value = octaves * upperBound / 8;
        display.setCell(0, 6, "Octaves");
        display.setCell(1, 6, Integer.toString(octaves));
        display.setCell(2, 6, value, Format.FORMAT_VALUE);
        display.setCell(3, 6, bottomMenu);
    }
    if (this.host.supports(Capability.NOTE_REPEAT_SWING)) {
        final IParameter shuffleParam = this.model.getGroove().getParameter(GrooveParameterID.SHUFFLE_AMOUNT);
        display.setCell(0, 7, shuffleParam.getName(10));
        display.setCell(1, 7, shuffleParam.getDisplayedValue(8));
        display.setCell(2, 7, shuffleParam.getValue(), Format.FORMAT_VALUE);
        display.setCell(3, 7, "Shuffle");
    }
}
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)

Example 5 with Configuration

use of de.mossgrabers.framework.configuration.Configuration in project DrivenByMoss by git-moss.

the class AftertouchViewCommand method onPolyAftertouch.

/**
 * {@inheritDoc}
 */
@Override
public void onPolyAftertouch(final int note, final int value) {
    final Configuration config = this.surface.getConfiguration();
    final int convertAftertouch = config.getConvertAftertouch();
    switch(convertAftertouch) {
        case -3:
            // Filter poly aftertouch
            break;
        case -2:
            // Translate notes of Poly aftertouch to current note mapping and only allow
            // aftertouch for pads with notes
            final int n = this.view.getKeyManager().getMidiNoteFromGrid(note);
            if (n == -1)
                return;
            this.surface.sendMidiEvent(0xA0, n, value);
            break;
        case -1:
            // Convert to Channel Aftertouch
            this.surface.sendMidiEvent(0xD0, value, 0);
            break;
        default:
            // MIDI CC
            this.surface.sendMidiEvent(0xB0, convertAftertouch, value);
            break;
    }
}
Also used : Configuration(de.mossgrabers.framework.configuration.Configuration)

Aggregations

Configuration (de.mossgrabers.framework.configuration.Configuration)8 PushConfiguration (de.mossgrabers.controller.ableton.push.PushConfiguration)2 IParameter (de.mossgrabers.framework.daw.data.IParameter)2 ArpeggiatorMode (de.mossgrabers.framework.daw.midi.ArpeggiatorMode)2 ViewManager (de.mossgrabers.framework.featuregroup.ViewManager)2 MaschineJamConfiguration (de.mossgrabers.controller.ni.maschine.jam.MaschineJamConfiguration)1 SessionView (de.mossgrabers.controller.ni.maschine.jam.view.SessionView)1 LaunchpadConfiguration (de.mossgrabers.controller.novation.launchpad.LaunchpadConfiguration)1 SessionView (de.mossgrabers.controller.novation.launchpad.view.SessionView)1 AbstractConfiguration (de.mossgrabers.framework.configuration.AbstractConfiguration)1 ColorManager (de.mossgrabers.framework.controller.color.ColorManager)1 IApplication (de.mossgrabers.framework.daw.IApplication)1 IGroove (de.mossgrabers.framework.daw.IGroove)1 ViewManager (de.mossgrabers.framework.view.ViewManager)1 LaunchpadConfiguration (de.mossgrabers.launchpad.LaunchpadConfiguration)1