Search in sources :

Example 1 with MaschineJamConfiguration

use of de.mossgrabers.controller.ni.maschine.jam.MaschineJamConfiguration in project DrivenByMoss by git-moss.

the class SequencerView method updateScaleConfig.

private void updateScaleConfig() {
    final MaschineJamConfiguration config = this.surface.getConfiguration();
    config.setScale(this.scales.getScale().getName());
    config.setScaleBase(Scales.BASES.get(this.scales.getScaleOffset()));
    config.setScaleInKey(!this.scales.isChromatic());
    config.setScaleLayout(this.scales.getScaleLayout().getName());
    this.updateNoteMapping();
}
Also used : MaschineJamConfiguration(de.mossgrabers.controller.ni.maschine.jam.MaschineJamConfiguration)

Example 2 with MaschineJamConfiguration

use of de.mossgrabers.controller.ni.maschine.jam.MaschineJamConfiguration in project DrivenByMoss by git-moss.

the class MaschineJamSoloCommand method executeShifted.

/**
 * {@inheritDoc}
 */
@Override
public void executeShifted(final ButtonEvent event) {
    if (event == ButtonEvent.UP) {
        final MaschineJamConfiguration configuration = this.surface.getConfiguration();
        configuration.nextNewClipLength();
        this.mvHelper.delayDisplay(() -> AbstractConfiguration.getNewClipLengthValue(configuration.getNewClipLength()));
    }
}
Also used : MaschineJamConfiguration(de.mossgrabers.controller.ni.maschine.jam.MaschineJamConfiguration)

Example 3 with MaschineJamConfiguration

use of de.mossgrabers.controller.ni.maschine.jam.MaschineJamConfiguration in project DrivenByMoss by git-moss.

the class NoteRepeatView method onGridNote.

/**
 * {@inheritDoc}
 */
@Override
public void onGridNote(final int note, final int velocity) {
    if (velocity == 0)
        return;
    final IHost host = this.model.getHost();
    final MaschineJamConfiguration configuration = this.surface.getConfiguration();
    switch(note) {
        // Note Repeat Octave
        case 36:
        case 37:
        case 38:
        case 39:
        case 40:
        case 41:
        case 42:
        case 43:
            if (host.supports(Capability.NOTE_REPEAT_OCTAVES)) {
                final int octave = note - 36;
                configuration.setNoteRepeatOctave(octave);
                this.surface.scheduleTask(() -> this.surface.getDisplay().notify("Note Repeat Octave: " + octave), 100);
            }
            return;
        // Arpeggiator type
        case 76:
        case 77:
            if (host.supports(Capability.NOTE_REPEAT_MODE)) {
                configuration.setPrevNextNoteRepeatMode(note == 77);
                this.surface.scheduleTask(() -> this.surface.getDisplay().notify("Note Repeat Mode: " + configuration.getNoteRepeatMode().getName()), 100);
            }
            break;
        // Note Repeat period
        case 79:
            this.setPeriod(0);
            return;
        case 80:
            this.setPeriod(1);
            return;
        case 71:
            this.setPeriod(2);
            return;
        case 72:
            this.setPeriod(3);
            return;
        case 63:
            this.setPeriod(4);
            return;
        case 64:
            this.setPeriod(5);
            return;
        case 55:
            this.setPeriod(6);
            return;
        case 56:
            this.setPeriod(7);
            return;
        // Note Repeat Length
        case 81:
            this.setNoteLength(0);
            return;
        case 82:
            this.setNoteLength(1);
            return;
        case 73:
            this.setNoteLength(2);
            return;
        case 74:
            this.setNoteLength(3);
            return;
        case 65:
            this.setNoteLength(4);
            return;
        case 66:
            this.setNoteLength(5);
            return;
        case 57:
            this.setNoteLength(6);
            return;
        case 58:
            this.setNoteLength(7);
            return;
        default:
            // Fall through to be handled below
            break;
    }
}
Also used : IHost(de.mossgrabers.framework.daw.IHost) MaschineJamConfiguration(de.mossgrabers.controller.ni.maschine.jam.MaschineJamConfiguration)

Example 4 with MaschineJamConfiguration

use of de.mossgrabers.controller.ni.maschine.jam.MaschineJamConfiguration in project DrivenByMoss by git-moss.

the class MaschineJamViewCommand method executeNormal.

/**
 * {@inheritDoc}
 */
@Override
public void executeNormal(final ButtonEvent event) {
    switch(event) {
        case LONG:
            this.wasUsed = true;
            return;
        case DOWN:
            this.wasUsed = false;
            this.encoderManager.enableTemporaryEncodeMode(this.encoderMode);
            if (this.encoderMode == EncoderMode.TEMPORARY_LOCK)
                this.surface.getViewManager().setTemporary(Views.CONTROL);
            break;
        case UP:
            this.encoderManager.disableTemporaryEncodeMode();
            if (!this.wasUsed && this.encoderMode == EncoderMode.TEMPORARY_LOCK) {
                final MaschineJamConfiguration configuration = this.surface.getConfiguration();
                configuration.setAccentEnabled(!configuration.isAccentActive());
            }
            if (this.encoderMode == EncoderMode.TEMPORARY_LOCK)
                this.surface.getViewManager().restore();
            break;
    }
}
Also used : MaschineJamConfiguration(de.mossgrabers.controller.ni.maschine.jam.MaschineJamConfiguration)

Aggregations

MaschineJamConfiguration (de.mossgrabers.controller.ni.maschine.jam.MaschineJamConfiguration)4 IHost (de.mossgrabers.framework.daw.IHost)1