Search in sources :

Example 21 with Scales

use of de.mossgrabers.framework.scale.Scales in project DrivenByMoss by git-moss.

the class DrumConfigurationMode method onKnobValue.

/**
 * {@inheritDoc}
 */
@Override
public void onKnobValue(final int index, final int value) {
    if (!this.model.canSelectedTrackHoldNotes())
        return;
    final int idx = index < 0 ? this.selectedParam : index;
    final Scales scales = this.model.getScales();
    final boolean inc = this.model.getValueChanger().isIncrease(value);
    final ViewManager viewManager = this.surface.getViewManager();
    switch(idx) {
        case 6:
        case 7:
            ((DrumView) viewManager.get(Views.DRUM)).changeOctave(ButtonEvent.DOWN, inc, scales.getDrumDefaultOffset(), true, false);
            viewManager.get(Views.DRUM).updateNoteMapping();
            ((INoteMode) this.surface.getModeManager().get(Modes.NOTE)).clearNotes();
            break;
        default:
            // Not used
            break;
    }
}
Also used : INoteMode(de.mossgrabers.framework.mode.INoteMode) ViewManager(de.mossgrabers.framework.featuregroup.ViewManager) Scales(de.mossgrabers.framework.scale.Scales) DrumView(de.mossgrabers.controller.ni.maschine.mk3.view.DrumView)

Example 22 with Scales

use of de.mossgrabers.framework.scale.Scales in project DrivenByMoss by git-moss.

the class PlayConfigurationMode method update.

private void update() {
    this.surface.getViewManager().get(Views.PLAY).updateNoteMapping();
    final MaschineConfiguration config = this.surface.getConfiguration();
    final Scales scales = this.model.getScales();
    config.setScale(scales.getScale().getName());
    config.setScaleBase(Scales.BASES.get(scales.getScaleOffset()));
    config.setScaleLayout(scales.getScaleLayout().getName());
}
Also used : MaschineConfiguration(de.mossgrabers.controller.ni.maschine.mk3.MaschineConfiguration) Scales(de.mossgrabers.framework.scale.Scales)

Example 23 with Scales

use of de.mossgrabers.framework.scale.Scales in project DrivenByMoss by git-moss.

the class PlayConfigurationMode method onKnobValue.

/**
 * {@inheritDoc}
 */
@Override
public void onKnobValue(final int index, final int value) {
    if (!this.model.canSelectedTrackHoldNotes())
        return;
    final int idx = index < 0 ? this.selectedParam : index;
    final Scales scales = this.model.getScales();
    final boolean inc = this.model.getValueChanger().isIncrease(value);
    switch(idx) {
        case 0:
        case 1:
        case 2:
            if (inc)
                scales.nextScale();
            else
                scales.prevScale();
            if (!this.surface.getMaschine().hasMCUDisplay())
                this.surface.getDisplay().notify(scales.getScale().getName());
            break;
        case 3:
            if (inc)
                scales.nextScaleOffset();
            else
                scales.prevScaleOffset();
            break;
        case 4:
        case 5:
            if (inc)
                scales.nextScaleLayout();
            else
                scales.prevScaleLayout();
            break;
        case 6:
            scales.setChromatic(!inc);
            this.surface.getConfiguration().setScaleInKey(!scales.isChromatic());
            break;
        case 7:
            final PlayView playView = (PlayView) this.surface.getViewManager().get(Views.PLAY);
            if (inc)
                playView.onOctaveUp(ButtonEvent.DOWN);
            else
                playView.onOctaveDown(ButtonEvent.DOWN);
            ((INoteMode) this.surface.getModeManager().get(Modes.NOTE)).clearNotes();
            break;
        default:
            // Not used
            break;
    }
    this.update();
}
Also used : INoteMode(de.mossgrabers.framework.mode.INoteMode) Scales(de.mossgrabers.framework.scale.Scales) PlayView(de.mossgrabers.controller.ni.maschine.mk3.view.PlayView)

Example 24 with Scales

use of de.mossgrabers.framework.scale.Scales in project DrivenByMoss by git-moss.

the class PlayConfigurationMode method onKnobTouch.

/**
 * {@inheritDoc}
 */
@Override
public void onKnobTouch(final int index, final boolean isTouched) {
    if (isTouched && this.surface.isDeletePressed()) {
        this.surface.setTriggerConsumed(ButtonID.DELETE);
        final Scales scales = this.model.getScales();
        final int idx = index < 0 ? this.selectedParam : index;
        switch(idx) {
            case 0:
            case 1:
            case 2:
                scales.setScale(Scale.MAJOR);
                if (!this.surface.getMaschine().hasMCUDisplay())
                    this.surface.getDisplay().notify(scales.getScale().getName());
                break;
            case 3:
                scales.setScaleOffset(0);
                break;
            case 4:
            case 5:
                scales.setScaleLayout(ScaleLayout.SEQUENT_UP);
                break;
            case 6:
                scales.setChromatic(false);
                this.surface.getConfiguration().setScaleInKey(!scales.isChromatic());
                break;
            case 7:
                ((PlayView) this.surface.getViewManager().get(Views.PLAY)).resetOctave();
                break;
            default:
                // Not used
                break;
        }
        this.update();
    }
}
Also used : Scales(de.mossgrabers.framework.scale.Scales) PlayView(de.mossgrabers.controller.ni.maschine.mk3.view.PlayView)

Example 25 with Scales

use of de.mossgrabers.framework.scale.Scales in project DrivenByMoss by git-moss.

the class Kontrol1ControllerSetup method createScales.

/**
 * {@inheritDoc}
 */
@Override
protected void createScales() {
    this.scales = new Scales(this.valueChanger, 0, 127, 128, 1);
    this.scales.setChromatic(true);
}
Also used : Scales(de.mossgrabers.framework.scale.Scales)

Aggregations

Scales (de.mossgrabers.framework.scale.Scales)26 ICursorDevice (de.mossgrabers.framework.daw.ICursorDevice)3 ViewManager (de.mossgrabers.framework.view.ViewManager)3 PlayView (de.mossgrabers.controller.ni.maschine.mk3.view.PlayView)2 ITextDisplay (de.mossgrabers.framework.controller.display.ITextDisplay)2 ITrack (de.mossgrabers.framework.daw.data.ITrack)2 INoteMode (de.mossgrabers.framework.mode.INoteMode)2 AbstractSequencerView (de.mossgrabers.framework.view.AbstractSequencerView)2 View (de.mossgrabers.framework.view.View)2 DrumView (de.mossgrabers.launchpad.view.DrumView)2 PlayView (de.mossgrabers.launchpad.view.PlayView)2 RaindropsView (de.mossgrabers.launchpad.view.RaindropsView)2 SequencerView (de.mossgrabers.launchpad.view.SequencerView)2 OscAddressSpace (com.bitwig.extension.api.opensoundcontrol.OscAddressSpace)1 OscModule (com.bitwig.extension.api.opensoundcontrol.OscModule)1 ControllerHost (com.bitwig.extension.controller.api.ControllerHost)1 GenericFlexiConfiguration (de.mossgrabers.controller.generic.GenericFlexiConfiguration)1 FlexiHandlerException (de.mossgrabers.controller.generic.flexihandler.utils.FlexiHandlerException)1 MaschineConfiguration (de.mossgrabers.controller.ni.maschine.mk3.MaschineConfiguration)1 DrumView (de.mossgrabers.controller.ni.maschine.mk3.view.DrumView)1