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;
}
}
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());
}
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();
}
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();
}
}
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);
}
Aggregations